diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-05 13:40:49 +0200 |
---|---|---|
committer | Lars-Peter Clausen <lars@metafoo.de> | 2009-10-05 13:40:49 +0200 |
commit | ab5849e9a9e05749ef2f687e9ae5b4265a577a7f (patch) | |
tree | bc104021f127c0271d77a63f60544ef3b4355c3b /arch/arm/plat-s3c/include/plat | |
parent | 0fc21f0604bd935cd2e955fb96a27f736473dbaa (diff) |
Add s3c pwm device driver.
Diffstat (limited to 'arch/arm/plat-s3c/include/plat')
-rw-r--r-- | arch/arm/plat-s3c/include/plat/pwm.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/pwm.h b/arch/arm/plat-s3c/include/plat/pwm.h new file mode 100644 index 00000000000..6a41b0ad840 --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/pwm.h @@ -0,0 +1,45 @@ +#ifndef __S3C2410_PWM_H +#define __S3C2410_PWM_H + +#include <linux/err.h> +#include <linux/platform_device.h> +#include <linux/clk.h> + +#include <mach/io.h> +#include <mach/hardware.h> +#include <asm/mach-types.h> +#include <plat/regs-timer.h> + +enum pwm_timer { + PWM0, + PWM1, + PWM2, + PWM3, + PWM4 +}; + +struct s3c2410_pwm { + enum pwm_timer timerid; + struct clk *pclk; + unsigned long pclk_rate; + unsigned long prescaler; + unsigned long divider; + unsigned long counter; + unsigned long comparer; +}; + +struct s3c24xx_pwm_platform_data{ + /* callback to attach platform children (to enforce suspend / resume + * ordering */ + void (*attach_child_devices)(struct device *parent_device); +}; + +int s3c2410_pwm_init(struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_enable(struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_disable(struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_start(struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_stop(struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_duty_cycle(int reg_value, struct s3c2410_pwm *s3c2410_pwm); +int s3c2410_pwm_dumpregs(void); + +#endif /* __S3C2410_PWM_H */ |