From b9732c840e725ceb574993f39f796c12f9b1096d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=AE=B8=E7=9B=9B=E9=A3=9E?= Date: Tue, 21 Jan 2014 19:51:19 +0800 Subject: [PATCH] pwm-bl: rename of pwm-rockhip.c and change the backlight-driver configuration --- arch/arm/boot/dts/rk3188-tb.dts | 11 +++++++++++ arch/arm/boot/dts/rk3188.dtsi | 11 +---------- drivers/pwm/Makefile | 2 +- drivers/pwm/{pwm_rk.c => pwm-rockchip.c} | 0 drivers/video/backlight/pwm_bl.c | 9 +++------ 5 files changed, 16 insertions(+), 17 deletions(-) rename drivers/pwm/{pwm_rk.c => pwm-rockchip.c} (100%) diff --git a/arch/arm/boot/dts/rk3188-tb.dts b/arch/arm/boot/dts/rk3188-tb.dts index 34bf60416b22..75c973262a39 100644 --- a/arch/arm/boot/dts/rk3188-tb.dts +++ b/arch/arm/boot/dts/rk3188-tb.dts @@ -18,6 +18,16 @@ serial-id = <2>; status = "okay"; }; + + backlight { + compatible = "pwm-backlight"; + pwms = <&pwm3 0 5000000>; + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <6>; + gpios = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>; +}; + + }; &uart0 { @@ -61,3 +71,4 @@ status = "okay"; }; + diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index 3896aeab3bf7..3ade1bb1c3d6 100755 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -349,7 +349,7 @@ pwm0: pwm@20030000{ compatible = "rockchip,pwm"; - reg = <0x20030000 0x10>; /*0x20030000*/ + reg = <0x20030000 0x10>; #pwm-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&pwm0_pin>; @@ -385,13 +385,4 @@ status = "disabled"; }; - - backlight { - compatible = "pwm-backlight"; - pwms = <&pwm3 0 5000000>; - brightness-levels = <0 4 8 16 32 64 128 255>; - default-brightness-level = <6>; - gpios = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>; - }; - }; diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index da7f5cfa8675..639e388128c5 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -17,4 +17,4 @@ obj-$(CONFIG_PWM_TIPWMSS) += pwm-tipwmss.o obj-$(CONFIG_PWM_TWL) += pwm-twl.o obj-$(CONFIG_PWM_TWL_LED) += pwm-twl-led.o obj-$(CONFIG_PWM_VT8500) += pwm-vt8500.o -obj-$(CONFIG_PWM_ROCKCHIPS) += pwm_rk.o +obj-$(CONFIG_PWM_ROCKCHIPS) += pwm-rockchip.o diff --git a/drivers/pwm/pwm_rk.c b/drivers/pwm/pwm-rockchip.c similarity index 100% rename from drivers/pwm/pwm_rk.c rename to drivers/pwm/pwm-rockchip.c diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 07cb9aa119e4..7dd9b2be7c85 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -147,11 +147,11 @@ static int pwm_backlight_parse_dt(struct device *dev, ret = devm_gpio_request(dev, gpio, "gpio_pwm_bl_en"); if(ret){ data->gpio->gpio = -1; - goto err_free_pwm; + printk("PWM_BL_EN request ERROR"); } - ret = gpio_direction_output(data->gpio->gpio , flags); + ret = gpio_direction_output(data->gpio->gpio , !flags); if(ret){ - goto err_free_pwm; + printk("PWM_BL_EN request ERROR"); } } @@ -167,9 +167,6 @@ static int pwm_backlight_parse_dt(struct device *dev, */ return 0; - err_free_pwm: - printk("PWM_BL_EN request ERROR"); - return 1; } static struct of_device_id pwm_backlight_of_match[] = { -- 2.34.1