ARM imx53: add pwm devices support
Subsystems (3)
PATCH 1/2 ARM imx53: add pwm devices support
--- arch/arm/mach-mx5/clock-mx51-mx53.c | 2 ++ arch/arm/mach-mx5/devices-imx53.h | 4 ++++ arch/arm/mach-mx5/devices.c | 10 ++++++++++ arch/arm/mach-mx5/devices.h | 2 ++ arch/arm/plat-mxc/devices/Kconfig | 1 + arch/arm/plat-mxc/devices/platform-mxc_pwm.c | 9 +++++++++ arch/arm/plat-mxc/pwm.c | 3 ++- 7 files changed, 30 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +2 -0
@@ -1338,6 +1338,8 @@ static struct clk_lookup mx53_lookups[] = { _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) + _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) + _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) };static void clk_tree_init (void )
arch/arm/mach-mx5/devices-imx53.h +4 -0
@@ -33,3 +33,7 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst;extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[]__initconst ;#define imx53_add_imx2_wdt (id, pdata) \ imx_add_imx2_wdt(&imx53_imx2_wdt_data[id]) + +extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst ; +#define imx53_add_mxc_pwm (id) \ + imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])
arch/arm/mach-mx5/devices.c +10 -0
@@ -120,6 +120,16 @@ struct platform_device mxc_usbh2_device = { }, }; +struct platform_device mxc_pwm1_backlight_device = { + .name ="pwm-backlight" , + .id =0 , +}; + +struct platform_device mxc_pwm2_backlight_device = { + .name ="pwm-backlight" , + .id =1 , +}; +static struct mxc_gpio_port mxc_gpio_ports[] = { { .chip.label ="gpio-0" ,
arch/arm/mach-mx5/devices.h +2 -0
@@ -3,3 +3,5 @@ extern struct platform_device mxc_usbh1_device;extern struct platform_device mxc_usbh2_device;extern struct platform_device mxc_usbdr_udc_device;extern struct platform_device mxc_hsi2c_device; +extern struct platform_device mxc_pwm1_backlight_device; +extern struct platform_device mxc_pwm2_backlight_device;
arch/arm/plat-mxc/devices/Kconfig +1 -0
@@ -58,6 +58,7 @@ config IMX_HAVE_PLATFORM_MXC_NAND config IMX_HAVE_PLATFORM_MXC_PWM bool + default y if ARCH_MX21 || ARCH_MX25 || SOC_IMX27 || SOC_IMX51 || SOC_IMX53 config IMX_HAVE_PLATFORM_MXC_RNGA bool
arch/arm/plat-mxc/devices/platform-mxc_pwm.c +9 -0
@@ -49,6 +49,15 @@ const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { };#endif /* ifdef CONFIG_SOC_IMX51 */ +#ifdef CONFIG_SOC_IMX53 +const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst = { +#define imx53_mxc_pwm_data_entry(_id, _hwid) \ + imx_mxc_pwm_data_entry(MX53, _id, _hwid, SZ_16K) +imx53_mxc_pwm_data_entry (0 ,1 ), +imx53_mxc_pwm_data_entry (1 ,2 ), +}; +#endif /* ifdef CONFIG_SOC_IMX53 */ +struct platform_device *__init imx_add_mxc_pwm (const struct imx_mxc_pwm_data *data) {
arch/arm/plat-mxc/pwm.c +2 -1
@@ -57,7 +57,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)if (pwm ==NULL || period_ns ==0 || duty_ns > period_ns)return -EINVAL ; -if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 ()) { +if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 () || +cpu_is_mx53 ()) {unsigned long long c;unsigned long period_cycles, duty_cycles, prescale;u32 cr;
Signature · 1 line
1.7.1
PATCH 2/2 ARM MX53_LOCO: add pwm backlight device
--- arch/arm/mach-mx5/board-mx53_loco.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/board-mx53_loco.c +13 -0
@@ -23,6 +23,7 @@#include <linux/fec.h> #include <linux/delay.h> #include <linux/gpio.h> +#include <linux/pwm_backlight.h> #include <mach/common.h> #include <mach/hardware.h>
@@ -35,6 +36,7 @@#include "crm_regs.h" #include "devices-imx53.h" +#include "devices.h" #define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6)
@@ -203,6 +205,13 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = { .bitrate = 100000, }; +static struct platform_pwm_backlight_data loco_pwm_backlight_data = { + .pwm_id =1 , + .max_brightness =255 , + .dft_brightness =128 , + .pwm_period_ns =50000 , +}; +static void __init mx53_loco_board_init (void ) { mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
@@ -213,6 +222,10 @@ static void __init mx53_loco_board_init(void)imx53_add_imx2_wdt (0 ,NULL );imx53_add_imx_i2c (0 , &mx53_loco_i2c_data);imx53_add_imx_i2c (1 , &mx53_loco_i2c_data); + +imx53_add_mxc_pwm (1 ); +mxc_register_device (&mxc_pwm1_backlight_device, + &loco_pwm_backlight_data); }static void __init mx53_loco_timer_init (void )
Signature · 1 line
1.7.1
PATCH 1/2 ARM imx53: add pwm devices support
In reply to Jason ChenQuoted 1 line · Jason Chen
Signed-off-by Jason Chen <[email protected]>
Looks perfect to me. Sascha?
Quoted 103 lines
---
?arch/arm/mach-mx5/clock-mx51-mx53.c ? ? ? ? ?| ? ?2 ++ ?arch/arm/mach-mx5/devices-imx53.h ? ? ? ? ? ?| ? ?4 ++++ ?arch/arm/mach-mx5/devices.c ? ? ? ? ? ? ? ? ?| ? 10 ++++++++++ ?arch/arm/mach-mx5/devices.h ? ? ? ? ? ? ? ? ?| ? ?2 ++ ?arch/arm/plat-mxc/devices/Kconfig ? ? ? ? ? ?| ? ?1 + ?arch/arm/plat-mxc/devices/platform-mxc_pwm.c | ? ?9 +++++++++ ?arch/arm/plat-mxc/pwm.c ? ? ? ? ? ? ? ? ? ? ?| ? ?3 ++-?7 files changed, 30 insertions(+), 1 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +2
-0@@ -1338,6 +1338,8 @@ static struct clk_lookup mx53_lookups[] = { ? ? ? ?_REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) ? ? ? ?_REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) ? ? ? ?_REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) + ? ? ? _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) + ? ? ? _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) ?}; ?static void clk_tree_init(void)arch/arm/mach-mx5/devices-imx53.h +4
-0@@ -33,3 +33,7 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst; ?extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst; ?#define imx53_add_imx2_wdt(id, pdata) ?\ ? ? ? ?imx_add_imx2_wdt(&imx53_imx2_wdt_data[id]) + +extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst ; +#define imx53_add_mxc_pwm (id) ?\ + ? ? ? imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])arch/arm/mach-mx5/devices.c +10
-0@@ -120,6 +120,16 @@ struct platform_device mxc_usbh2_device = { ? ? ? ?}, ?}; +struct platform_device mxc_pwm1_backlight_device = { + ? ? ? .name = "pwm-backlight", + ? ? ? .id = 0, +}; + +struct platform_device mxc_pwm2_backlight_device = { + ? ? ? .name = "pwm-backlight", + ? ? ? .id = 1, +}; + ?static struct mxc_gpio_port mxc_gpio_ports[] = { ? ? ? ?{ ? ? ? ? ? ? ? ?.chip.label = "gpio-0",arch/arm/mach-mx5/devices.h +2
-0@@ -3,3 +3,5 @@ extern struct platform_device mxc_usbh1_device; ?extern struct platform_device mxc_usbh2_device; ?extern struct platform_device mxc_usbdr_udc_device; ?extern struct platform_device mxc_hsi2c_device; +extern struct platform_device mxc_pwm1_backlight_device; +extern struct platform_device mxc_pwm2_backlight_device;arch/arm/plat-mxc/devices/Kconfig +0
-0@@ -58,6 +58,7 @@ config IMX_HAVE_PLATFORM_MXC_NAND?config
IMX_HAVE_PLATFORM_MXC_PWM
? ? ? ?bool
+ ? ? ? default y ifARCH_MX21||ARCH_MX25||SOC_IMX27||SOC_IMX51||SOC_IMX53?config
IMX_HAVE_PLATFORM_MXC_RNGA
? ? ? ?boolarch/arm/plat-mxc/devices/platform-mxc_pwm.c +0
-0@@ -49,6 +49,15 @@ const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { ?};?#endif /* ifdef
CONFIG_SOC_IMX51*/arch/arm/plat-mxc/devices/platform-mxc_pwm.c +9
-0+#ifdef CONFIG_SOC_IMX53 +const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst = { +#define imx53_mxc_pwm_data_entry(_id, _hwid) ? ? ? ? ? ? ? ? ? ? ? ? ? \ + ? ? ? imx_mxc_pwm_data_entry(MX53, _id, _hwid, SZ_16K) + ? ? ? imx53_mxc_pwm_data_entry(0, 1), + ? ? ? imx53_mxc_pwm_data_entry(1, 2), +}; +#endif /* ifdef CONFIG_SOC_IMX53 */ +?struct
platform_device*__initimx_add_mxc_pwm( ? ? ? ? ? ? ? ?const struct imx_mxc_pwm_data *data)?{arch/arm/plat-mxc/pwm.c +0
-0
arch/arm/plat-mxc/pwm.c int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) · line 61
Quoted 6 lines
arch/arm/plat-mxc/pwm.c +2
-1@@ -57,7 +57,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) ? ? ? ?if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) ? ? ? ? ? ? ? ?return -EINVAL; - ? ? ? if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) { + ? ? ? if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51() || + ? ? ? ? ? ? ? cpu_is_mx53()) {
This might be improved in the future by using platform_device_id, or by introducing some flags from platform_data, or when registering the pwm devices.
Quoted 13 lines
arch/arm/plat-mxc/pwm.c +0
-1? ? ? ? ? ? ? ?unsigned long long c; ? ? ? ? ? ? ? ?unsigned long period_cycles, duty_cycles, prescale; ? ? ? ? ? ? ? ?u32 cr; --1.7.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/2 ARM imx53: add pwm devices support
In reply to Jason ChenQuoted 16 lines · Jason Chen
Signed-off-by Jason Chen <[email protected]>--- arch/arm/mach-mx5/clock-mx51-mx53.c | 2 ++ arch/arm/mach-mx5/devices-imx53.h | 4 ++++ arch/arm/mach-mx5/devices.c | 10 ++++++++++ arch/arm/mach-mx5/devices.h | 2 ++ arch/arm/plat-mxc/devices/Kconfig | 1 + arch/arm/plat-mxc/devices/platform-mxc_pwm.c | 9 +++++++++ arch/arm/plat-mxc/pwm.c | 3 ++- 7 files changed, 30 insertions(+), 1 deletions(-)arch/arm/mach-mx5/clock-mx51-mx53.c +0
-0
arch/arm/mach-mx5/clock-mx51-mx53.c static struct clk_lookup mx53_lookups[] = { · line 1342
Quoted 5 lines
arch/arm/mach-mx5/clock-mx51-mx53.c +2
-0@@ -1338,6 +1338,8 @@ static struct clk_lookup mx53_lookups[] = { _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) + _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) +_REGISTER_CLOCK ("mxc_pwm.1" ,"pwm" , pwm2_clk)
Do you really need "pwm"? I think NULL should do the job.
Quoted 23 lines
arch/arm/mach-mx5/clock-mx51-mx53.c +0
-0};static void clk_tree_init (void )arch/arm/mach-mx5/devices-imx53.h +4
-0@@ -33,3 +33,7 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst;extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[]__initconst ;#define imx53_add_imx2_wdt (id, pdata) \ imx_add_imx2_wdt(&imx53_imx2_wdt_data[id]) + +extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst ; +#define imx53_add_mxc_pwm (id) \ + imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])arch/arm/mach-mx5/devices.c +0
-0@@ -120,6 +120,16 @@ struct platform_device mxc_usbh2_device = { }, };
arch/arm/mach-mx5/devices.c struct platform_device mxc_usbh2_device = { · line 132
Quoted 10 lines
arch/arm/mach-mx5/devices.c +10
-0+struct platform_device mxc_pwm1_backlight_device = { + .name ="pwm-backlight" , + .id =0 , +}; + +struct platform_device mxc_pwm2_backlight_device = { + .name ="pwm-backlight" , + .id =1 , +}; +
IMHO these should go into a seperate patch and preferably dynamically allocated.
Quoted 18 lines
arch/arm/mach-mx5/devices.c +0
-0static struct mxc_gpio_port mxc_gpio_ports[] = { { .chip.label ="gpio-0" ,arch/arm/mach-mx5/devices.h +2
-0@@ -3,3 +3,5 @@ extern struct platform_device mxc_usbh1_device;extern struct platform_device mxc_usbh2_device;extern struct platform_device mxc_usbdr_udc_device;extern struct platform_device mxc_hsi2c_device; +extern struct platform_device mxc_pwm1_backlight_device; +extern struct platform_device mxc_pwm2_backlight_device;arch/arm/plat-mxc/devices/Kconfig +0
-0
arch/arm/plat-mxc/devices/Kconfig config IMX_HAVE_PLATFORM_MXC_NAND · line 61
Quoted 4 lines
arch/arm/plat-mxc/devices/Kconfig +1
-0@@ -58,6 +58,7 @@ config IMX_HAVE_PLATFORM_MXC_NAND config IMX_HAVE_PLATFORM_MXC_PWM bool + default y if ARCH_MX21 || ARCH_MX25 || SOC_IMX27 || SOC_IMX51 || SOC_IMX53
If you do this, can you please use SOC_IMX21 and SOC_IMX25? Or maybe even def_bool y?
Quoted 27 lines
arch/arm/plat-mxc/devices/Kconfig +0
-0config IMX_HAVE_PLATFORM_MXC_RNGA boolarch/arm/plat-mxc/devices/platform-mxc_pwm.c +9
-0@@ -49,6 +49,15 @@ const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { };#endif /* ifdef CONFIG_SOC_IMX51 */ +#ifdef CONFIG_SOC_IMX53 +const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst = { +#define imx53_mxc_pwm_data_entry(_id, _hwid) \ + imx_mxc_pwm_data_entry(MX53, _id, _hwid, SZ_16K) +imx53_mxc_pwm_data_entry (0 ,1 ), +imx53_mxc_pwm_data_entry (1 ,2 ), +}; +#endif /* ifdef CONFIG_SOC_IMX53 */ +struct platform_device *__init imx_add_mxc_pwm (const struct imx_mxc_pwm_data *data) {arch/arm/plat-mxc/pwm.c +0
-0
arch/arm/plat-mxc/pwm.c int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) · line 64
Quoted 9 lines
arch/arm/plat-mxc/pwm.c +2
-1@@ -57,7 +57,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)if (pwm ==NULL || period_ns ==0 || duty_ns > period_ns)return -EINVAL ; -if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 ()) { +if (cpu_is_mx27 () ||cpu_is_mx3 () ||cpu_is_mx25 () ||cpu_is_mx51 () || +cpu_is_mx53 ()) {unsigned long long c;unsigned long period_cycles, duty_cycles, prescale;u32 cr;
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/2 ARM imx53: add pwm devices support
Quoted 6 lines
Quoted 3 lines
?config
IMX_HAVE_PLATFORM_MXC_PWM
? ? ? bool
+ ? ? default y ifARCH_MX21||ARCH_MX25||SOC_IMX27||SOC_IMX51||SOC_IMX53If you do this, can you please use
SOC_IMX21andSOC_IMX25? ?Or maybe evendef_booly?
Or the other way, in config SOC_IMX53, select IMX_HAVE_PLATFORM_MXC_PWM?
PATCH 1/2 ARM imx53: add pwm devices support
Quoted 8 lines · Eric Miao
Quoted 6 lines
Quoted 3 lines
?config
IMX_HAVE_PLATFORM_MXC_PWM
? ? ? bool
+ ? ? default y ifARCH_MX21||ARCH_MX25||SOC_IMX27||SOC_IMX51||SOC_IMX53If you do this, can you please use
SOC_IMX21andSOC_IMX25? ?Or maybe evendef_booly?Or the other way, in config
SOC_IMX53, selectIMX_HAVE_PLATFORM_MXC_PWM?
Yeah, that's how most of the other IMX_HAVE_PLATFORM_XYZ work.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 1/2 ARM imx53: add pwm devices support
In reply to Uwe Kleine-Könighi, Uwe,
Thanks for your comments.
2011/3/1 Uwe Kleine-K?nig <[email protected]>:
Quoted 12 lines · Jason Chen
Quoted 11 lines
Signed-off-by Jason Chen <[email protected]>---
?arch/arm/mach-mx5/clock-mx51-mx53.c ? ? ? ? ?| ? ?2 ++ ?arch/arm/mach-mx5/devices-imx53.h ? ? ? ? ? ?| ? ?4 ++++ ?arch/arm/mach-mx5/devices.c ? ? ? ? ? ? ? ? ?| ? 10 ++++++++++ ?arch/arm/mach-mx5/devices.h ? ? ? ? ? ? ? ? ?| ? ?2 ++ ?arch/arm/plat-mxc/devices/Kconfig ? ? ? ? ? ?| ? ?1 + ?arch/arm/plat-mxc/devices/platform-mxc_pwm.c | ? ?9 +++++++++ ?arch/arm/plat-mxc/pwm.c ? ? ? ? ? ? ? ? ? ? ?| ? ?3 ++-?7 files changed, 30 insertions(+), 1 deletions(-)
Quoted 11 lines
arch/arm/mach-mx5/clock-mx51-mx53.c static struct clk_lookup mx53_lookups[] = { · line 1342
Quoted 10 lines
arch/arm/mach-mx5/clock-mx51-mx53.c +2
-0@@ -1338,6 +1338,8 @@ static struct clk_lookup mx53_lookups[] = { ? ? ? _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) ? ? ? _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) ? ? ? _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) + ? ? _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) + ? ? _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk)Do you really need "pwm"? ?I think NULL should do the job.
yes, I will remove it.
Quoted 24 lines
Quoted 24 lines
arch/arm/mach-mx5/clock-mx51-mx53.c +0
-0?}; ?static void clk_tree_init(void)arch/arm/mach-mx5/devices-imx53.h +4
-0@@ -33,3 +33,7 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst; ?extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst; ?#define imx53_add_imx2_wdt(id, pdata) ? ? ? ?\ ? ? ? imx_add_imx2_wdt(&imx53_imx2_wdt_data[id]) + +extern const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst ; +#define imx53_add_mxc_pwm (id) ? ? ? ?\ + ? ? imx_add_mxc_pwm(&imx53_mxc_pwm_data[id])arch/arm/mach-mx5/devices.c +0
-0@@ -120,6 +120,16 @@ struct platform_device mxc_usbh2_device = { ? ? ? }, ?};
Quoted 12 lines
arch/arm/mach-mx5/devices.c struct platform_device mxc_usbh2_device = { · line 132
Quoted 10 lines
arch/arm/mach-mx5/devices.c +10
-0+struct platform_device mxc_pwm1_backlight_device = { + ? ? .name = "pwm-backlight", + ? ? .id = 0, +}; + +struct platform_device mxc_pwm2_backlight_device = { + ? ? .name = "pwm-backlight", + ? ? .id = 1, +}; +IMHO these should go into a seperate patch and preferably dynamically allocated.
ok, I will seperate this.
Quoted 20 lines
Quoted 20 lines
arch/arm/mach-mx5/devices.c +0
-0?static struct mxc_gpio_port mxc_gpio_ports[] = { ? ? ? { ? ? ? ? ? ? ? .chip.label = "gpio-0",arch/arm/mach-mx5/devices.h +2
-0@@ -3,3 +3,5 @@ extern struct platform_device mxc_usbh1_device; ?extern struct platform_device mxc_usbh2_device; ?extern struct platform_device mxc_usbdr_udc_device; ?extern struct platform_device mxc_hsi2c_device; +extern struct platform_device mxc_pwm1_backlight_device; +extern struct platform_device mxc_pwm2_backlight_device;arch/arm/plat-mxc/devices/Kconfig +0
-0@@ -58,6 +58,7 @@ config IMX_HAVE_PLATFORM_MXC_NAND
Quoted 6 lines
Quoted 3 lines
?config
IMX_HAVE_PLATFORM_MXC_PWM
? ? ? bool
+ ? ? default y ifARCH_MX21||ARCH_MX25||SOC_IMX27||SOC_IMX51||SOC_IMX53If you do this, can you please use
SOC_IMX21andSOC_IMX25? ?Or maybe evendef_booly?
sure
Quoted 49 lines
Quoted 27 lines
?config
IMX_HAVE_PLATFORM_MXC_RNGA
? ? ? boolarch/arm/plat-mxc/devices/platform-mxc_pwm.c +0
-0@@ -49,6 +49,15 @@ const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { ?};?#endif /* ifdef
CONFIG_SOC_IMX51*/arch/arm/plat-mxc/devices/platform-mxc_pwm.c +9
-0+#ifdef CONFIG_SOC_IMX53 +const struct imx_mxc_pwm_data imx53_mxc_pwm_data[]__initconst = { +#define imx53_mxc_pwm_data_entry(_id, _hwid) ? ? ? ? ? ? ? ? ? ? ? ? \ + ? ? imx_mxc_pwm_data_entry(MX53, _id, _hwid, SZ_16K) + ? ? imx53_mxc_pwm_data_entry(0, 1), + ? ? imx53_mxc_pwm_data_entry(1, 2), +}; +#endif /* ifdef CONFIG_SOC_IMX53 */ +?struct
platform_device*__initimx_add_mxc_pwm( ? ? ? ? ? ? ? const struct imx_mxc_pwm_data *data)?{arch/arm/plat-mxc/pwm.c +0
-0arch/arm/plat-mxc/pwm.c int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) · line 64
Quoted 9 lines
arch/arm/plat-mxc/pwm.c +2
-1@@ -57,7 +57,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) ? ? ? if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) ? ? ? ? ? ? ? return -EINVAL; - ? ? if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) { + ? ? if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51() || + ? ? ? ? ? ? cpu_is_mx53()) { ? ? ? ? ? ? ? unsigned long long c; ? ? ? ? ? ? ? unsigned long period_cycles, duty_cycles, prescale; ? ? ? ? ? ? ? u32 cr;Best regards
Uwe--
Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | Uwe Kleine-K?nig ? ? ? ? ? ?| Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel