]> rtime.felk.cvut.cz Git - shark/motorek-5200.git/commitdiff
Adde messages, converte to oout_be32()
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Jan 2009 11:46:25 +0000 (12:46 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 15 Jan 2009 11:46:25 +0000 (12:46 +0100)
motorek.c

index 98a2db1fcdadf92a9dae4e4825d9736dff361e77..83ee1d8cfbdaf7dcbc9a14aeb08e9b992199367a 100644 (file)
--- 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;
 }