diff options
author | Jason Chen <jason.chen@linaro.org> | 2011-12-05 18:12:27 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2012-01-11 21:39:12 +0800 |
commit | 17157c9ca7d42aaa38b3c6698a6f83cadc845de0 (patch) | |
tree | b5fe8f20e014aa83855c7cb5df85f0dc6969391b /arch | |
parent | ddf51fe00663c6ddeacbf0c2b77bf5aa23425ae3 (diff) |
imx6q-sabrelite: add pwm and pwm-bl dt support
Signed-off-by: Jason Chen <jason.chen@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/imx6q-sabrelite.dts | 14 | ||||
-rw-r--r-- | arch/arm/boot/dts/imx6q.dtsi | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/clock-imx6q.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/pwm.c | 9 |
4 files changed, 35 insertions, 8 deletions
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index b199cd9a7e6..965dfbc802c 100644 --- a/arch/arm/boot/dts/imx6q-sabrelite.dts +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts @@ -72,6 +72,20 @@ }; }; + backlight { + #address-cells = <1>; + #size-cells = <0>; + compatible = "simple-bus"; + + pwm_bl { + compatible = "pwm-bl"; + pwm-parent = <&pwm4>; + max_brightness = <255>; + dft_brightness = <128>; + pwm_period_ns = <50000>; + }; + }; + displays { #address-cells = <1>; #size-cells = <1>; diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index c46e917a799..3b7436008ea 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -211,22 +211,26 @@ reg = <0x0207c000 0x4000>; }; - pwm@02080000 { /* PWM1 */ + pwm1: pwm@02080000 { /* PWM1 */ + compatible = "fsl,imx6q-pwm"; reg = <0x02080000 0x4000>; interrupts = <0 83 0x04>; }; - pwm@02084000 { /* PWM2 */ + pwm2: pwm@02084000 { /* PWM2 */ + compatible = "fsl,imx6q-pwm"; reg = <0x02084000 0x4000>; interrupts = <0 84 0x04>; }; - pwm@02088000 { /* PWM3 */ + pwm3: pwm@02088000 { /* PWM3 */ + compatible = "fsl,imx6q-pwm"; reg = <0x02088000 0x4000>; interrupts = <0 85 0x04>; }; - pwm@0208c000 { /* PWM4 */ + pwm4: pwm@0208c000 { /* PWM4 */ + compatible = "fsl,imx6q-pwm"; reg = <0x0208c000 0x4000>; interrupts = <0 86 0x04>; }; diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c index 34567c0af25..eca30e4b8c1 100644 --- a/arch/arm/mach-imx/clock-imx6q.c +++ b/arch/arm/mach-imx/clock-imx6q.c @@ -1922,10 +1922,10 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "iim_clk", iim_clk), _REGISTER_CLOCK(NULL, "mlb_clk", mlb_clk), _REGISTER_CLOCK(NULL, "openvg_axi_clk", openvg_axi_clk), - _REGISTER_CLOCK(NULL, "pwm1_clk", pwm1_clk), - _REGISTER_CLOCK(NULL, "pwm2_clk", pwm2_clk), - _REGISTER_CLOCK(NULL, "pwm3_clk", pwm3_clk), - _REGISTER_CLOCK(NULL, "pwm4_clk", pwm4_clk), + _REGISTER_CLOCK("2080000.pwm", NULL, pwm1_clk), + _REGISTER_CLOCK("2084000.pwm", NULL, pwm2_clk), + _REGISTER_CLOCK("2088000.pwm", NULL, pwm3_clk), + _REGISTER_CLOCK("208c000.pwm", NULL, pwm4_clk), _REGISTER_CLOCK(NULL, "gpmi_io_clk", gpmi_io_clk), _REGISTER_CLOCK(NULL, "usboh3_clk", usboh3_clk), _REGISTER_CLOCK(NULL, "sata_clk", sata_clk), diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c index e032717f7d0..be76dcb4921 100644 --- a/arch/arm/plat-mxc/pwm.c +++ b/arch/arm/plat-mxc/pwm.c @@ -165,6 +165,9 @@ struct pwm_device *pwm_request(int pwm_id, const char *label) if (pwm->pwm_id == pwm_id) { found = 1; break; + } else if ((int)pwm->pdev->dev.of_node == pwm_id) { + found = 1; + break; } } @@ -282,9 +285,15 @@ static int __devexit mxc_pwm_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id mxc_pwm_dt_ids[] = { + { .compatible = "fsl,imx6q-pwm", }, + { /* sentinel */ } +}; + static struct platform_driver mxc_pwm_driver = { .driver = { .name = "mxc_pwm", + .of_match_table = mxc_pwm_dt_ids, }, .probe = mxc_pwm_probe, .remove = __devexit_p(mxc_pwm_remove), |