};
gpio3_pwm {
- pwm0:pwm0 {
+ pwm0_pin:pwm0 {
rockchip,pins = <PWM0>;
rockchip,pull = <VALUE_PULL_DISABLE>;
//rockchip,voltage = <VALUE_VOL_DEFAULT>;
};
- pwm1:pwm1 {
+ pwm1_pin:pwm1 {
rockchip,pins = <PWM1>;
rockchip,pull = <VALUE_PULL_DISABLE>;
//rockchip,voltage = <VALUE_VOL_DEFAULT>;
};
- pwm2:pwm2 {
+ pwm2_pin:pwm2 {
rockchip,pins = <PWM2>;
rockchip,pull = <VALUE_PULL_DISABLE>;
//rockchip,voltage = <VALUE_VOL_DEFAULT>;
};
- pwm3:pwm3 {
+ pwm3_pin:pwm3 {
rockchip,pins = <PWM3>;
rockchip,pull = <VALUE_PULL_DISABLE>;
//rockchip,voltage = <VALUE_VOL_DEFAULT>;
&lcdc1 {
status = "okay";
};
-&rk_pwm3 {
+&pwm3 {
status = "okay";
};
i2c4 = &i2c4;
lcdc0 = &lcdc0;
lcdc1 = &lcdc1;
- pwm0 = &rk_pwm0;
- pwm1 = &rk_pwm1;
- pmw2 = &rk_pwm2;
- pwm3 = &rk_pwm3;
};
cpus {
status = "disabled";
};
- rk_pwm0: pwm@20030000{
+ pwm0: pwm@20030000{
compatible = "rockchip,pwm";
reg = <0x20030000 0x10>; /*0x20030000*/
#pwm-cells = <2>;
pinctrl-names = "default";
- pinctrl-0 = <&pwm0>;
+ pinctrl-0 = <&pwm0_pin>;
status = "disabled";
};
- rk_pwm1: pwm@20030010{
+ pwm1: pwm@20030010{
compatible = "rockchip,pwm";
reg = <0x20030010 0x10>; /*0x20030000*/
#pwm-cells = <2>;
pinctrl-names = "default";
- pinctrl-0 = <&pwm1>;
+ pinctrl-0 = <&pwm1_pin>;
status = "disabled";
};
- rk_pwm2: pwm@20050020{
+ pwm2: pwm@20050020{
compatible = "rockchip,pwm";
reg = <0x20050020 0x10>; /*0x20030000*/
#pwm-cells = <2>;
pinctrl-names = "default";
- pinctrl-0 = <&pwm2>;
+ pinctrl-0 = <&pwm2_pin>;
status = "disabled";
};
- rk_pwm3: pwm@20050030{
+ pwm3: pwm@20050030{
compatible = "rockchip,pwm";
reg = <0x20050030 0x10>; /*0x20030000*/
#pwm-cells = <2>;
pinctrl-names = "default";
- pinctrl-0 = <&pwm3>;
+ pinctrl-0 = <&pwm3_pin>;
status = "disabled";
};
backlight {
compatible = "pwm-backlight";
- pwms = <&rk_pwm3 0 5000000>;
+ 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>;
int length;
u32 value;
int gpio,ret;
+ enum of_gpio_flags flags;
+
if (!node)
return -ENODEV;
&value);
if (ret < 0)
return ret;
- data->gpios = devm_kzalloc(dev,
+ data->gpio = devm_kzalloc(dev,
sizeof(struct gpio) * 1,
GFP_KERNEL);
- gpio = of_get_named_gpio(node, "gpios", 0);
- data->gpios->gpio = gpio;
+ gpio = of_get_named_gpio_flags(node, "gpios", 0, &flags);
+ data->gpio->gpio = gpio;
if (gpio != -1) {
ret = devm_gpio_request(dev, gpio, "gpio_pwm_bl_en");
if(ret){
- data->gpios->gpio = -1;
+ data->gpio->gpio = -1;
goto err_free_pwm;
}
- ret = gpio_direction_output(data->gpios->gpio , 1);
+ ret = gpio_direction_output(data->gpio->gpio , flags);
if(ret){
goto err_free_pwm;
}
unsigned int pwm_period_ns;
unsigned int *levels;
- struct gpio *gpios;
+ struct gpio *gpio;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);