From 614e519eec520424f4bae22913f87fd1352b55a1 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 15 Jan 2009 12:46:25 +0100 Subject: [PATCH] Adde messages, converte to oout_be32() --- motorek.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/motorek.c b/motorek.c index 98a2db1..83ee1d8 100644 --- a/motorek.c +++ b/motorek.c @@ -38,20 +38,20 @@ DEVICE_ATTR(position,0444,show_position,NULL); static void pwm_width(struct mpc52xx_gpt *gpt, u16 width) { - gpt->pwm = (width<<16) | MPC52xx_GPT_PWM_OP; + out_be32(&gpt->pwm, (width<<16) | MPC52xx_GPT_PWM_OP); } static void __devinit pwm_init(struct mpc52xx_gpt *gpt) { - gpt->count = (1<<16) | PWM_PERIOD; + out_be32(&gpt->count, (1<<16) | PWM_PERIOD); pwm_width(gpt, 0); - gpt->mode = MPC52xx_GPT_MODE_PWM; + out_be32(&gpt->mode, MPC52xx_GPT_MODE_PWM); } static void pwm_done(struct mpc52xx_gpt *gpt) { - gpt->mode = 0; - gpt->count = 0; + out_be32(&gpt->mode, 0); + out_be32(&gpt->count, 0); pwm_width(gpt, 0); } @@ -70,7 +70,9 @@ static int __devinit motorek_init(struct motorek *m) { pwm_init(m->pwmf); pwm_init(m->pwmb); - motorek_action(m, +45); +/* motorek_action(m, +45); */ + pwm_width(m->pwmb, 500); + pwm_width(m->pwmf, 500); return 0; } @@ -142,6 +144,8 @@ static int __devinit motorek_probe(struct platform_device *dev) if (err) return err; + printk(KERN_NOTICE "Motorek initialized\n"); + return 0; } @@ -150,6 +154,8 @@ static int __devexit motorek_remove(struct platform_device *dev) struct motorek *m; m = platform_get_drvdata(dev); + printk(KERN_NOTICE "Removing motorek\n"); + motorek_done(m); return 0; } -- 2.39.2