function = "pwm_b";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_4";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
/* Audio Related End */
function = "pwm_b";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_4";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
/* Audio Related End */
function = "pwm_b";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_4";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
/* Audio Related End */
function = "pwm_b";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_4";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
/* Audio Related End */
function = "pwm_b";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_4";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
/* Audio Related End */
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
};
bl_extern_i2c {
- compatible = "amlogic, bl_extern_i2c";
- status = "disabled";
- reg = <0x2c>; /*reg_address for lp8556*/
+ compatible = "bl_extern, i2c";
dev_name = "lp8556";
- };
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
+ reg = <0x2c>;
status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
- dev_name = "i2c_T5800Q";
};
};
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
};
bl_extern_i2c {
- compatible = "amlogic, bl_extern_i2c";
- status = "disabled";
- reg = <0x2c>; /*reg_address for lp8556*/
+ compatible = "bl_extern, i2c";
dev_name = "lp8556";
- };
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
+ reg = <0x2c>;
status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
- dev_name = "i2c_T5800Q";
};
};
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
};
bl_extern_i2c {
- compatible = "amlogic, bl_extern_i2c";
- status = "disabled";
- reg = <0x2c>; /*reg_address for lp8556*/
+ compatible = "bl_extern, i2c";
dev_name = "lp8556";
- };
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
+ reg = <0x2c>;
status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
- dev_name = "i2c_T5800Q";
};
};
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
};
bl_extern_i2c {
- compatible = "amlogic, bl_extern_i2c";
- status = "disabled";
- reg = <0x2c>; /*reg_address for lp8556*/
+ compatible = "bl_extern, i2c";
dev_name = "lp8556";
+ reg = <0x2c>;
+ status = "disabled";
};
};
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
/dts-v1/;
#include "mesong12a.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal_P_32.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
/dts-v1/;
#include "mesong12a.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
#include "mesong12a.dtsi"
#include "partition_mbox_normal.dtsi"
-#include "mesong12a_skt-panel.dtsi"
/ {
model = "Amlogic";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
differential_pair = <1>;
status = "disabled";
};
+
+ bl_extern_i2c {
+ compatible = "bl_extern, i2c";
+ dev_name = "lp8556";
+ reg = <0x2c>;
+ status = "disabled";
+ };
};
&audiobus {
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
differential_pair = <1>;
status = "disabled";
};
+
+ bl_extern_i2c {
+ compatible = "bl_extern, i2c";
+ dev_name = "lp8556";
+ reg = <0x2c>;
+ status = "disabled";
+ };
};
&audiobus {
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOH_5";
+ function = "gpio_periphs";
+ output-high;
+ };
+ };
+
}; /* end of pinctrl_periphs */
&pinctrl_aobus {
dev_name = "backlight";
status = "okay";
key_valid = <0>;
- pinctrl-names = "pwm_on";
+ pinctrl-names = "pwm_on","pwm_off";
pinctrl-0 = <&bl_pwm_on_pins>;
+ pinctrl-1 = <&bl_pwm_off_pins>;
pinctrl_version = <1>; /* for uboot */
+ bl_pwm_config = <&bl_pwm_conf>;
+ bl-gpios = <&gpio GPIOZ_4 GPIO_ACTIVE_HIGH
+ &gpio GPIOZ_5 GPIO_ACTIVE_HIGH>;
+ bl_gpio_names = "GPIOZ_4","GPIOZ_5";
/* pwm port: PWM_A, PWM_B, PWM_C, PWM_D, PWM_VS*/
/* power index:(point gpios_index, 0xff=invalid)
* power value:(0=output low, 1=output high, 2=input)
* power delay:(unit in ms)
*/
- bl-gpios = <&gpio GPIOZ_4 GPIO_ACTIVE_HIGH
- &gpio GPIOZ_5 GPIO_ACTIVE_HIGH>;
- bl_gpio_names = "GPIOZ_4","GPIOZ_5";
- bl_pwm_config = <&bl_pwm_conf>;
backlight_0{
index = <0>;
bl_pwm_attr = <0 /*pwm_method*/
180 /*pwm_freq(pwm:Hz, pwm_vs:multiple of vs)*/
100 25>; /*duty_max(%), duty_min(%)*/
- bl_pwm_power = <0 0 /*pwm_gpio_index, pwm_gpio_off*/
+ bl_pwm_power = <0 1 /*pwm_gpio_index, pwm_gpio_off*/
10 10>; /*pwm_on_delay(ms), pwm_off_delay(ms)*/
bl_pwm_en_sequence_reverse = <0>; /* 1 for reverse */
};
compatible = "amlogic, bl_extern";
dev_name = "bl_extern";
status = "disabled";
+ i2c_bus = "i2c_bus_3";
extern_0{
index = <0>;
extern_name = "i2c_lp8556";
-
type = <0>; /*0=i2c, 1=spi, 2=mipi*/
i2c_address = <0x2c>; /*7bit i2c address*/
- i2c_bus = "i2c_bus_c";
dim_max_min = <255 10>;
};
extern_1{
index = <1>;
extern_name = "mipi_lt070me05";
-
type = <2>; /*0=i2c, 1=spi, 2=mipi*/
dim_max_min = <255 10>;
};
};
-
-
};/* end of panel */
dev_name = "backlight";
status = "okay";
key_valid = <0>;
- pinctrl-names = "pwm_on";
+ pinctrl-names = "pwm_on","pwm_off";
pinctrl-0 = <&pwm_f_pins2>;
+ pinctrl-1 = <&bl_pwm_off_pins>;
pinctrl_version = <2>; /* for uboot */
bl_pwm_config = <&bl_pwm_conf>;
bl-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH
pwms = <&pwm_ef MESON_PWM_1 30040 0>;
};
};
+
bl_extern{
compatible = "amlogic, bl_extern";
dev_name = "bl_extern";
status = "disabled";
+ i2c_bus = "i2c_bus_3";
+
extern_0{
index = <0>;
extern_name = "i2c_lp8556";
type = <0>; /*0=i2c, 1=spi, 2=mipi*/
i2c_address = <0x2c>; /*7bit i2c address*/
- i2c_bus = "i2c_bus_c";
dim_max_min = <255 10>;
};
+
extern_1{
index = <1>;
extern_name = "mipi_lt070me05";
dev_name = "backlight";
status = "okay";
key_valid = <0>;
- pinctrl-names = "pwm_on";
+ pinctrl-names = "pwm_on","pwm_off";
pinctrl-0 = <&pwm_f_pins2>;
+ pinctrl-1 = <&bl_pwm_off_pins>;
pinctrl_version = <2>; /* for uboot */
bl_pwm_config = <&bl_pwm_conf>;
bl-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH
pwms = <&pwm_ef MESON_PWM_1 30040 0>;
};
};
+
bl_extern{
compatible = "amlogic, bl_extern";
dev_name = "bl_extern";
status = "disabled";
+ i2c_bus = "i2c_bus_3";
+
extern_0{
index = <0>;
extern_name = "i2c_lp8556";
type = <0>; /*0=i2c, 1=spi, 2=mipi*/
i2c_address = <0x2c>; /*7bit i2c address*/
- i2c_bus = "i2c_bus_c";
dim_max_min = <255 10>;
};
+
extern_1{
index = <1>;
extern_name = "mipi_lt070me05";
};
};
+ lcd_ttl_rgb_6bit_on_pins:lcd_ttl_rgb_6bit_on{
+ mux {
+ groups = "lcd_r2_7",
+ "lcd_g2_7",
+ "lcd_b2_7";
+ function = "lcd_ttl";
+ };
+ };
+ lcd_ttl_rgb_6bit_off_pins:lcd_ttl_rgb_6bit_off{
+ mux {
+ groups = "GPIODV_2","GPIODV_3","GPIODV_4",
+ "GPIODV_5","GPIODV_6","GPIODV_7",
+ "GPIODV_10","GPIODV_11","GPIODV_12",
+ "GPIODV_13","GPIODV_14","GPIODV_15",
+ "GPIODV_18","GPIODV_19","GPIODV_20",
+ "GPIODV_21","GPIODV_22","GPIODV_23";
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
+
+ lcd_ttl_rgb_8bit_on_pins:lcd_ttl_rgb_8bit_on{
+ mux {
+ groups = "lcd_r0_1", "lcd_r2_7",
+ "lcd_g0_1", "lcd_g2_7",
+ "lcd_b0_1", "lcd_b2_7";
+ function = "lcd_ttl";
+ };
+ };
+ lcd_ttl_rgb_8bit_off_pins:lcd_ttl_rgb_8bit_off{
+ mux {
+ groups = "GPIODV_0","GPIODV_1","GPIODV_2","GPIODV_3",
+ "GPIODV_4","GPIODV_5","GPIODV_6","GPIODV_7",
+ "GPIODV_8","GPIODV_9","GPIODV_10","GPIODV_11",
+ "GPIODV_12","GPIODV_13","GPIODV_14","GPIODV_15",
+ "GPIODV_16","GPIODV_17","GPIODV_18","GPIODV_19",
+ "GPIODV_20","GPIODV_21","GPIODV_22","GPIODV_23";
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
+ /* DE + clk */
+ lcd_ttl_de_on_pins:lcd_ttl_de_on_pin{
+ mux {
+ groups = "tcon_cph", /* clk */
+ "tcon_oeh"; /* DE */
+ function = "lcd_ttl";
+ };
+ };
+ /* hvsync + clk */
+ lcd_ttl_hvsync_on_pins:lcd_ttl_hvsync_on_pin{
+ mux {
+ groups = "tcon_cph", /* clk */
+ "tcon_stv1", /* vs */
+ "tcon_sth1"; /* hs */
+ function = "lcd_ttl";
+ };
+ };
+ /* DE + hvsync + clk */
+ lcd_ttl_de_hvsync_on_pins:lcd_ttl_de_hvsync_on_pin{
+ mux {
+ groups = "tcon_cph", /* clk */
+ "tcon_oeh", /* DE */
+ "tcon_stv1", /* vs */
+ "tcon_sth1"; /* hs */
+ function = "lcd_ttl";
+ };
+ };
+ lcd_ttl_de_hvsync_off_pins:lcd_ttl_de_hvsync_off_pin{
+ mux {
+ groups = "GPIODV_26", /* clk */
+ "GPIODV_27", /* DE */
+ "GPIODV_24", /* vs */
+ "GPIODV_25"; /* hs */
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
}; /* end of pinctrl_periphs */
&periphs {
interrupts = <0 3 1>;
interrupt-names = "vsync";
pinctrl_version = <1>; /* for uboot */
+ pinctrl-names = "ttl_6bit_hvsync_de_on",
+ "ttl_6bit_hvsync_on",
+ "ttl_6bit_de_on",
+ "ttl_6bit_hvsync_de_off",
+ "ttl_8bit_hvsync_de_on",
+ "ttl_8bit_hvsync_on",
+ "ttl_8bit_de_on",
+ "ttl_8bit_hvsync_de_off";
+ pinctrl-0 = <&lcd_ttl_rgb_6bit_on_pins
+ &lcd_ttl_de_hvsync_on_pins>;
+ pinctrl-1 = <&lcd_ttl_rgb_6bit_on_pins
+ &lcd_ttl_hvsync_on_pins>;
+ pinctrl-2 = <&lcd_ttl_rgb_6bit_on_pins
+ &lcd_ttl_de_on_pins>;
+ pinctrl-3 = <&lcd_ttl_rgb_6bit_off_pins
+ &lcd_ttl_de_hvsync_off_pins>;
+ pinctrl-4 = <&lcd_ttl_rgb_8bit_on_pins
+ &lcd_ttl_de_hvsync_on_pins>;
+ pinctrl-5 = <&lcd_ttl_rgb_8bit_on_pins
+ &lcd_ttl_hvsync_on_pins>;
+ pinctrl-6 = <&lcd_ttl_rgb_8bit_on_pins
+ &lcd_ttl_de_on_pins>;
+ pinctrl-7 = <&lcd_ttl_rgb_8bit_off_pins
+ &lcd_ttl_de_hvsync_off_pins>;
/* power type:
* (0=cpu_gpio, 1=pmu_gpio, 2=signal,3=extern, 0xff=ending)
* power value:(0=output low, 1=output high, 2=input)
* power delay:(unit in ms)
*/
- /*lcd_cpu-gpios = <&gpio GPIOX_3 1>;*/
+ /*lcd_cpu-gpios = <&gpio GPIOX_3 GPIO_ACTIVE_HIGH>;*/
/*lcd_cpu_gpio_names = "GPIOX_3";*/
lcd_0{
backlight_index = <0xff>;
};
};
+
+ lcd_extern{
+ compatible = "amlogic, lcd_extern";
+ dev_name = "lcd_extern";
+ status = "disabled";
+ i2c_bus = "i2c_bus_d";
+ key_valid = <0>;
+
+ extern_0{
+ index = <0>;
+ extern_name = "ext_default";
+ status = "disabled";
+ type = <0>; /* 0=i2c, 1=spi, 2=mipi */
+ i2c_address = <0x1c>; /* 7bit i2c address */
+ i2c_second_address = <0xff>; /* 0xff for none */
+ cmd_size = <0xff>; /*0xff for dynamic cmd_size*/
+
+ /* init on/off:
+ * fixed cmd_size: (type, value..., delay);
+ * cmd_size include all data.
+ * dynamic cmd_size: (type, cmd_size, value..., delay);
+ * cmd_size include value+delay.
+ */
+ /* type: 0x00=cmd(bit[3:0]=1 for second_addr),
+ * 0xf0=gpio, 0xff=ending
+ */
+ /* value: i2c or spi cmd, or gpio index & level,
+ * fill 0x0 for no use
+ */
+ /* delay: unit ms */
+ init_on = <0x00 8 0x20 0x01 0x02 0x00 0x40 0xFF 0x00 0
+ 0x00 8 0x80 0x02 0x00 0x40 0x62 0x51 0x73 0
+ 0x00 8 0x61 0x06 0x00 0x00 0x00 0x00 0x00 0
+ 0x00 8 0xC1 0x05 0x0F 0x00 0x08 0x70 0x00 0
+ 0x00 8 0x13 0x01 0x00 0x00 0x00 0x00 0x00 0
+ 0x00 8 0x3D 0x02 0x01 0x00 0x00 0x00 0x00 0
+ 0x00 8 0xED 0x0D 0x01 0x00 0x00 0x00 0x00 0
+ 0x00 8 0x23 0x02 0x00 0x00 0x00 0x00 0x00 10
+ 0xff 0>; /*ending*/
+ init_off = <0xff 0>; /*ending*/
+ };
+
+ extern_1{
+ index = <1>;
+ extern_name = "i2c_DLPC3439";
+ status = "disabled";
+ type = <0>; /* 0=i2c, 1=spi, 2=mipi */
+ i2c_address = <0x1b>; /* 7bit i2c address */
+ cmd_size = <0xff>; /*0xff for dynamic cmd_size*/
+ };
+ };
};/* end of panel */
};
};
- lcd_ttl_rgb_6bit_pins_on:lcd_ttl_rgb_6bit_on{
+ lcd_ttl_rgb_6bit_on_pins:lcd_ttl_rgb_6bit_on{
mux {
groups = "lcd_r2_7",
"lcd_g2_7",
function = "lcd_ttl";
};
};
+ lcd_ttl_rgb_6bit_off_pins:lcd_ttl_rgb_6bit_off{
+ mux {
+ groups = "GPIODV_2","GPIODV_3","GPIODV_4",
+ "GPIODV_5","GPIODV_6","GPIODV_7",
+ "GPIODV_10","GPIODV_11","GPIODV_12",
+ "GPIODV_13","GPIODV_14","GPIODV_15",
+ "GPIODV_18","GPIODV_19","GPIODV_20",
+ "GPIODV_21","GPIODV_22","GPIODV_23";
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
- lcd_ttl_rgb_8bit_pins_on:lcd_ttl_rgb_8bit_on{
+ lcd_ttl_rgb_8bit_on_pins:lcd_ttl_rgb_8bit_on{
mux {
groups = "lcd_r0_1", "lcd_r2_7",
"lcd_g0_1", "lcd_g2_7",
function = "lcd_ttl";
};
};
+ lcd_ttl_rgb_8bit_off_pins:lcd_ttl_rgb_8bit_off{
+ mux {
+ groups = "GPIODV_0","GPIODV_1","GPIODV_2","GPIODV_3",
+ "GPIODV_4","GPIODV_5","GPIODV_6","GPIODV_7",
+ "GPIODV_8","GPIODV_9","GPIODV_10","GPIODV_11",
+ "GPIODV_12","GPIODV_13","GPIODV_14","GPIODV_15",
+ "GPIODV_16","GPIODV_17","GPIODV_18","GPIODV_19",
+ "GPIODV_20","GPIODV_21","GPIODV_22","GPIODV_23";
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
/* DE + clk */
lcd_ttl_de_on_pins:lcd_ttl_de_on_pin{
mux {
function = "lcd_ttl";
};
};
+ lcd_ttl_de_hvsync_off_pins:lcd_ttl_de_hvsync_off_pin{
+ mux {
+ groups = "GPIODV_26", /* clk */
+ "GPIODV_27", /* DE */
+ "GPIODV_24", /* vs */
+ "GPIODV_25"; /* hs */
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
}; /* end of pinctrl_periphs */
&periphs {
interrupts = <0 3 1>;
interrupt-names = "vsync";
pinctrl_version = <1>; /* for uboot */
- pinctrl-names = "ttl_6bit_hvsync_de_on","ttl_6bit_hvsync_on",
- "ttl_6bit_de_on","ttl_8bit_hvsync_de_on",
- "ttl_8bit_hvsync_on","ttl_8bit_de_on";
- pinctrl-0 = <&lcd_ttl_rgb_6bit_pins_on
+ pinctrl-names = "ttl_6bit_hvsync_de_on",
+ "ttl_6bit_hvsync_on",
+ "ttl_6bit_de_on",
+ "ttl_6bit_hvsync_de_off",
+ "ttl_8bit_hvsync_de_on",
+ "ttl_8bit_hvsync_on",
+ "ttl_8bit_de_on",
+ "ttl_8bit_hvsync_de_off";
+ pinctrl-0 = <&lcd_ttl_rgb_6bit_on_pins
&lcd_ttl_de_hvsync_on_pins>;
- pinctrl-1 = <&lcd_ttl_rgb_6bit_pins_on
+ pinctrl-1 = <&lcd_ttl_rgb_6bit_on_pins
&lcd_ttl_hvsync_on_pins>;
- pinctrl-2 = <&lcd_ttl_rgb_6bit_pins_on
+ pinctrl-2 = <&lcd_ttl_rgb_6bit_on_pins
&lcd_ttl_de_on_pins>;
- pinctrl-3 = <&lcd_ttl_rgb_8bit_pins_on
+ pinctrl-3 = <&lcd_ttl_rgb_6bit_off_pins
+ &lcd_ttl_de_hvsync_off_pins>;
+ pinctrl-4 = <&lcd_ttl_rgb_8bit_on_pins
&lcd_ttl_de_hvsync_on_pins>;
- pinctrl-4 = <&lcd_ttl_rgb_8bit_pins_on
+ pinctrl-5 = <&lcd_ttl_rgb_8bit_on_pins
&lcd_ttl_hvsync_on_pins>;
- pinctrl-5 = <&lcd_ttl_rgb_8bit_pins_on
+ pinctrl-6 = <&lcd_ttl_rgb_8bit_on_pins
&lcd_ttl_de_on_pins>;
+ pinctrl-7 = <&lcd_ttl_rgb_8bit_off_pins
+ &lcd_ttl_de_hvsync_off_pins>;
/* power type:
* (0=cpu_gpio, 1=pmu_gpio, 2=signal,3=extern, 0xff=ending)
* power value:(0=output low, 1=output high, 2=input)
* power delay:(unit in ms)
*/
- /*lcd_cpu-gpios = <&gpio GPIOX_3 1>;*/
+ /*lcd_cpu-gpios = <&gpio GPIOX_3 GPIO_ACTIVE_HIGH>;*/
/*lcd_cpu_gpio_names = "GPIOX_3";*/
lcd_0{
};
extern_1{
- index = <2>;
+ index = <1>;
extern_name = "i2c_DLPC3439";
status = "disabled";
type = <0>; /* 0=i2c, 1=spi, 2=mipi */
i2c_address = <0x1b>; /* 7bit i2c address */
- i2c_bus = "i2c_bus_d";
+ cmd_size = <0xff>; /*0xff for dynamic cmd_size*/
};
};
};/* end of panel */
status = "okay";
key_valid = <1>;
i2c_bus = "i2c_bus_c";
- /*pinctrl-names="extern_pins";*/
- /*pinctrl_names_uboot = "i2c_c";*/ /* i2c_a, i2c_b, i2c_c */
- /*pinctrl-0=<&i2c_c_master>;*/
- /*extern-gpios = <&gpio GPIOH_2 1*/
- /*&gpio GPIOH_3 1>;*/
+ /*pinctrl-names="extern_on", */
+ /* "extern_off"; */
+ /*pinctrl-0=<&i2c2_h_pins */
+ /* &lcd_extern_off_pins>; */
+ /*pinctrl_gpio_off = <0>; */
+ /*extern-gpios = <&gpio GPIOH_2 GPIO_ACTIVE_HIGH*/
+ /* &gpio GPIOH_3 GPIO_ACTIVE_HIGH>;*/
/*extern_gpio_names = "GPIOH_2","GPIOH_3";*/
- /*i2c_gpio_off = <0 0 1 0>; */
- /* I2C_SCK_gpio_index, I2C_SCK_gpio_off,
- * I2C_SDA_gpio_index, I2C_SCK_gpio_off
- */
+ /*i2c_gpio = <0 1>; //i2c_sck, i2c_sda gpio_index */
extern_0{
index = <0>;
pinctrl-names = "pwm_on","pwm_vs_on",
"pwm_combo_0_1_on",
"pwm_combo_0_vs_1_on",
- "pwm_combo_0_1_vs_on";
+ "pwm_combo_0_1_vs_on",
+ "pwm_off",
+ "pwm_combo_off";
pinctrl-0 = <&pwm_b_z6_pins>;
pinctrl-1 = <&pwm_vs_z6_pins>;
pinctrl-2 = <&pwm_b_z6_pins &pwm_c_z7_pins>;
pinctrl-3 = <&pwm_vs_z6_pins &pwm_c_z7_pins>;
pinctrl-4 = <&pwm_b_z6_pins &pwm_vs_z7_pins>;
+ pinctrl-5 = <&bl_pwm_off_pins>;
+ pinctrl-6 = <&bl_pwm_combo_off_pins>;
pinctrl_version = <2>; /* for uboot */
bl_pwm_config = <&bl_pwm_conf>;
function = "vbyone";
};
};
+ lcd_vbyone_off_pins: lcd_vbyone_off_pin {
+ mux {
+ groups = "GPIOH_0","GPIOH_1";
+ function = "gpio_periphs";
+ input-enable;
+ };
+ };
- lcd_ttl_rgb_6bit_pins_on:lcd_ttl_rgb_6bit_on{
+ lcd_ttl_rgb_6bit_on_pins:lcd_ttl_rgb_6bit_on{
mux {
groups = "lcd_r2_7","lcd_g2_7","lcd_b2_7";
function = "lcd";
};
};
- lcd_ttl_rgb_6bit_pins_off:lcd_ttl_rgb_6bit_off{
+ lcd_ttl_rgb_6bit_off_pins:lcd_ttl_rgb_6bit_off{
mux {
groups = "GPIOY_2","GPIOY_3","GPIOY_4","GPIOY_5",
"GPIOY_6","GPIOY_7", /*r2~7*/
input-enable;
};
};
- lcd_ttl_rgb_8bit_pins_on:lcd_ttl_rgb_8bit_on{
+ lcd_ttl_rgb_8bit_on_pins:lcd_ttl_rgb_8bit_on{
mux {
groups = "lcd_r0_1","lcd_r2_7",
"lcd_g0_1","lcd_g2_7",
function = "lcd";
};
};
- lcd_ttl_rgb_8bit_pins_off:lcd_ttl_rgb_8bit_off{
+ lcd_ttl_rgb_8bit_off_pins:lcd_ttl_rgb_8bit_off{
mux {
groups = "GPIOY_0","GPIOY_1","GPIOY_2","GPIOY_3",
"GPIOY_4","GPIOY_5", "GPIOY_6","GPIOY_7",
interrupts = <0 3 1
0 78 1>;
interrupt-names = "vsync","vbyone";
- pinctrl-names = "vbyone";
+ pinctrl-names = "vbyone","vbyone_off";
pinctrl-0 = <&lcd_vbyone_pins>;
+ pinctrl-1 = <&lcd_vbyone_off_pins>;
pinctrl_version = <2>; /* for uboot */
/* power type:(0=cpu_gpio, 2=signal, 3=extern, 0xff=ending) */
status = "okay";
key_valid = <1>;
i2c_bus = "i2c_bus_c";
- /*pinctrl-names="extern_pins";*/
- /*pinctrl_names_uboot = "i2c_c";*/ /* i2c_a, i2c_b, i2c_c */
- /*pinctrl-0=<&i2c_c_master>;*/
- /*extern-gpios = <&gpio GPIOH_2 1*/
- /*&gpio GPIOH_3 1>;*/
+ /*pinctrl-names="extern_on", */
+ /* "extern_off"; */
+ /*pinctrl-0=<&i2c2_h_pins */
+ /* &lcd_extern_off_pins>; */
+ /*pinctrl_gpio_off = <0>; */
+ /*extern-gpios = <&gpio GPIOH_2 GPIO_ACTIVE_HIGH*/
+ /* &gpio GPIOH_3 GPIO_ACTIVE_HIGH>;*/
/*extern_gpio_names = "GPIOH_2","GPIOH_3";*/
- /*i2c_gpio_off = <0 0 1 0>; */
- /* I2C_SCK_gpio_index, I2C_SCK_gpio_off,
- * I2C_SDA_gpio_index, I2C_SCK_gpio_off
- */
+ /*i2c_gpio = <0 1>; //i2c_sck, i2c_sda gpio_index */
extern_0{
index = <0>;
pinctrl-names = "pwm_on","pwm_vs_on",
"pwm_combo_0_1_on",
"pwm_combo_0_vs_1_on",
- "pwm_combo_0_1_vs_on";
+ "pwm_combo_0_1_vs_on",
+ "pwm_off",
+ "pwm_combo_off";
pinctrl-0 = <&bl_pwm_on_pins>;
pinctrl-1 = <&bl_pwm_vs_on_pins>;
pinctrl-2 = <&bl_pwm_combo_0_on_pins
&bl_pwm_combo_1_on_pins>;
pinctrl-4 = <&bl_pwm_combo_0_on_pins
&bl_pwm_combo_1_vs_on_pins>;
+ pinctrl-5 = <&bl_pwm_off_pins>;
+ pinctrl-6 = <&bl_pwm_combo_off_pins>;
pinctrl_version = <2>; /* for uboot */
interrupts = <0 3 1>;
interrupt-names = "ldim_vsync";
compatible = "amlogic, ldim_dev";
dev_name = "ldim_dev";
status = "okay";
- pinctrl-names = "ldim_pwm","ldim_pwm_vs";
- pinctrl-0 = <&ldim_pwm_pins>;
- pinctrl-1 = <&ldim_pwm_vs_pins>;
+ pinctrl-names = "ldim_pwm",
+ "ldim_pwm_vs",
+ "ldim_pwm_off";
+ pinctrl-0 = <&bl_pwm_on_pins>;
+ pinctrl-1 = <&bl_pwm_vs_on_pins>;
+ pinctrl-2 = <&bl_pwm_off_pins>;
pinctrl_version = <1>; /* for uboot */
/* pwm port: PWM_A, PWM_B, PWM_C, PWM_D, PWM_E, PWM_F, PWM_VS*/
};
};
/* end AUDIO_RELATED */
+
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
+ /*backlight*/
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
+ mux {
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
};
&i2c1 {
pinctrl-0=<&i2c1_dv_pins>;
};
+&i2c2 {
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_h_pins>;
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
+ dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "disabled";
+ };
+};
+
&dwc3 {
status = "okay";
};
};
};
/* end AUDIO_RELATED */
+
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
+ /*backlight*/
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
+ mux {
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
};
&i2c1 {
pinctrl-0=<&i2c1_dv_pins>;
};
+&i2c2 {
+ status = "disabled";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_h_pins>;
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
+ dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "disabled";
+ };
+};
+
&dwc3 {
status = "okay";
};
};
};
/* end AUDIO_RELATED */
+
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
+ /*backlight*/
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
+ mux {
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
};
&i2c0 {
pinctrl-0=<&i2c1_dv_pins>;
};
+&i2c2 {
+ status = "okay";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_h_pins>;
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
+ dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "okay";
+ };
+};
+
&dwc3 {
status = "okay";
};
};
};
/* end AUDIO_RELATED */
+
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
+ /*backlight*/
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
+ mux {
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
};
&i2c0 {
pinctrl-0=<&i2c1_dv_pins>;
};
+&i2c2 {
+ status = "okay";
+ pinctrl-names="default";
+ pinctrl-0=<&i2c2_h_pins>;
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
+ dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "okay";
+ };
+};
+
&dwc3 {
status = "okay";
};
status = "okay";
};
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
- status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "okay";
};
};
};
};
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
/*backlight*/
bl_pwm_on_pins:bl_pwm_on_pin {
mux {
function = "pwm_vs";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
bl_pwm_combo_0_on_pins:bl_pwm_combo_0_on_pin {
mux {
pins = "pwm_b";
function = "pwm_vs";
};
};
-
- /*ldim*/
- ldim_pwm_pins:ldim_pwm_pin {
- mux {
- pins = "pwm_b";
- function = "pwm_b";
- };
- };
- ldim_pwm_vs_pins:ldim_pwm_vs_pin {
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
mux {
- pins = "pwm_vs_z6";
- function = "pwm_vs";
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
};
};
};
drc_enable = <0>;
status = "okay";
};
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
- status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "okay";
};
};
};
};
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
/*backlight*/
bl_pwm_on_pins:bl_pwm_on_pin {
mux {
function = "pwm_vs";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
bl_pwm_combo_0_on_pins:bl_pwm_combo_0_on_pin {
mux {
pins = "pwm_b";
function = "pwm_vs";
};
};
-
- /*ldim*/
- ldim_pwm_pins:ldim_pwm_pin {
- mux {
- pins = "pwm_b";
- function = "pwm_b";
- };
- };
- ldim_pwm_vs_pins:ldim_pwm_vs_pin {
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
mux {
- pins = "pwm_vs_z6";
- function = "pwm_vs";
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
};
};
};
drc_enable = <0>;
status = "okay";
};
- lcd_extern_i2c {
- compatible = "amlogic, lcd_i2c_T5800Q";
- status = "disabled";
- reg = <0x1c>; /*reg_address for i2c_T5800Q*/
+
+ lcd_extern_i2c0: lcd_extern_i2c@0 {
+ compatible = "lcd_ext, i2c";
dev_name = "i2c_T5800Q";
+ reg = <0x1c>;
+ status = "okay";
};
};
};
};
+ /*lcd_extern*/
+ lcd_extern_off_pins:lcd_extern_off_pin {
+ mux {
+ pins = "GPIOH_2",
+ "GPIOH_3";
+ function = "gpio_periphs";
+ /*output-high;*/
+ output-low;
+ /*input-enable;*/
+ };
+ };
+
/*backlight*/
bl_pwm_on_pins:bl_pwm_on_pin {
mux {
function = "pwm_vs";
};
};
+ bl_pwm_off_pins:bl_pwm_off_pin {
+ mux {
+ pins = "GPIOZ_6";
+ function = "gpio_periphs";
+ output-low;
+ };
+ };
bl_pwm_combo_0_on_pins:bl_pwm_combo_0_on_pin {
mux {
pins = "pwm_b";
function = "pwm_vs";
};
};
-
- /*ldim*/
- ldim_pwm_pins:ldim_pwm_pin {
- mux {
- pins = "pwm_b";
- function = "pwm_b";
- };
- };
- ldim_pwm_vs_pins:ldim_pwm_vs_pin {
+ bl_pwm_combo_off_pins:bl_pwm_combo_off_pin {
mux {
- pins = "pwm_vs_z6";
- function = "pwm_vs";
+ pins = "GPIOZ_6",
+ "GPIOZ_7";
+ function = "gpio_periphs";
+ output-low;
};
};
};
#include "aml_bl_reg.h"
/* #define AML_BACKLIGHT_DEBUG */
-static unsigned int bl_debug_print_flag;
+unsigned int bl_debug_print_flag;
static struct aml_bl_drv_s *bl_drv;
{.probe_flag = 0, .register_flag = 0,},
{.probe_flag = 0, .register_flag = 0,},
},
+
+ .pinmux_flag = 0xff,
};
const char *bl_chip_table[] = {
}
/* ****************************************************** */
-#define BL_PINMUX_MAX 6
+#define BL_PINMUX_MAX 8
static char *bl_pinmux_str[BL_PINMUX_MAX] = {
"pwm_on", /* 0 */
"pwm_vs_on", /* 1 */
"pwm_combo_0_1_on", /* 2 */
"pwm_combo_0_vs_1_on", /* 3 */
"pwm_combo_0_1_vs_on", /* 4 */
+ "pwm_off", /* 5 */
+ "pwm_combo_off", /* 6 */
"none",
};
-static void bl_pwm_pinmux_set(struct bl_config_s *bconf)
+static void bl_pwm_pinmux_set(struct bl_config_s *bconf, int status)
{
int index = 0xff;
switch (bconf->method) {
case BL_CTRL_PWM:
- if (bconf->bl_pwm->pwm_port == BL_PWM_VS)
- index = 1;
- else
- index = 0;
+ if (status) {
+ if (bconf->bl_pwm->pwm_port == BL_PWM_VS)
+ index = 1;
+ else
+ index = 0;
+ } else {
+ index = 5;
+ }
break;
case BL_CTRL_PWM_COMBO:
- if (bconf->bl_pwm_combo0->pwm_port == BL_PWM_VS)
- index = 3;
- else {
- if (bconf->bl_pwm_combo1->pwm_port == BL_PWM_VS)
- index = 4;
- else
- index = 2;
+ if (status) {
+ if (bconf->bl_pwm_combo0->pwm_port == BL_PWM_VS) {
+ index = 3;
+ } else {
+ if (bconf->bl_pwm_combo1->pwm_port == BL_PWM_VS)
+ index = 4;
+ else
+ index = 2;
+ }
+ } else {
+ index = 6;
}
break;
default:
return;
}
+ if (bconf->pinmux_flag == index) {
+ BLPR("pinmux %s is already selected\n",
+ bl_pinmux_str[index]);
+ return;
+ }
+
/* request pwm pinmux */
bconf->pin = devm_pinctrl_get_select(bl_drv->dev, bl_pinmux_str[index]);
if (IS_ERR(bconf->pin)) {
- BLERR("set %s pinmux error\n", bl_pinmux_str[index]);
+ BLERR("set pinmux %s error\n", bl_pinmux_str[index]);
} else {
if (bl_debug_print_flag) {
- BLPR("request %s pinmux: %p\n",
+ BLPR("set pinmux %s: %p\n",
bl_pinmux_str[index], bconf->pin);
}
}
+ bconf->pinmux_flag = index;
}
/* ****************************************************** */
msleep(bconf->pwm_on_delay);
/* step 2: power on pwm */
bl_pwm_ctrl(bconf->bl_pwm, 1);
+ bl_pwm_pinmux_set(bconf, 1);
} else {
/* step 1: power on pwm */
bl_pwm_ctrl(bconf->bl_pwm, 1);
+ bl_pwm_pinmux_set(bconf, 1);
if (bconf->pwm_on_delay > 0)
msleep(bconf->pwm_on_delay);
/* step 2: power on enable */
/* step 2: power on pwm_combo */
bl_pwm_ctrl(bconf->bl_pwm_combo0, 1);
bl_pwm_ctrl(bconf->bl_pwm_combo1, 1);
+ bl_pwm_pinmux_set(bconf, 1);
} else {
/* step 1: power on pwm_combo */
bl_pwm_ctrl(bconf->bl_pwm_combo0, 1);
bl_pwm_ctrl(bconf->bl_pwm_combo1, 1);
+ bl_pwm_pinmux_set(bconf, 1);
if (bconf->pwm_on_delay > 0)
msleep(bconf->pwm_on_delay);
/* step 2: power on enable */
case BL_CTRL_PWM:
if (bconf->en_sequence_reverse) {
/* step 1: power off pwm */
+ bl_pwm_pinmux_set(bconf, 0);
bl_pwm_ctrl(bconf->bl_pwm, 0);
if (bconf->pwm_off_delay > 0)
msleep(bconf->pwm_off_delay);
/* step 2: power off pwm */
if (bconf->pwm_off_delay > 0)
msleep(bconf->pwm_off_delay);
+ bl_pwm_pinmux_set(bconf, 0);
bl_pwm_ctrl(bconf->bl_pwm, 0);
}
break;
case BL_CTRL_PWM_COMBO:
if (bconf->en_sequence_reverse) {
/* step 1: power off pwm_combo */
+ bl_pwm_pinmux_set(bconf, 0);
bl_pwm_ctrl(bconf->bl_pwm_combo0, 0);
bl_pwm_ctrl(bconf->bl_pwm_combo1, 0);
if (bconf->pwm_off_delay > 0)
/* step 2: power off pwm_combo */
if (bconf->pwm_off_delay > 0)
msleep(bconf->pwm_off_delay);
+ bl_pwm_pinmux_set(bconf, 0);
bl_pwm_ctrl(bconf->bl_pwm_combo0, 0);
bl_pwm_ctrl(bconf->bl_pwm_combo1, 0);
}
case BL_CTRL_PWM:
case BL_CTRL_PWM_COMBO:
ret = aml_bl_pwm_channel_register(bconf, pdev->dev.of_node);
- bl_pwm_pinmux_set(bconf);
break;
#ifdef CONFIG_AMLOGIC_BL_EXTERN
case BL_CTRL_EXTERN:
aml_bl_set_level(bl_on_level);
else
aml_bl_update_status(bl_drv->bldev);
+
+ bl_pwm_pinmux_set(bl_drv->bconf, 1);
}
static int aml_bl_probe(struct platform_device *pdev)
const struct of_device_id *match;
struct backlight_properties props;
struct backlight_device *bldev;
- struct bl_config_s *bconf;
int ret;
#ifdef AML_BACKLIGHT_DEBUG
bl_drv->data->chip_type,
bl_drv->data->chip_name);
- bconf = &bl_config;
bl_drv->dev = &pdev->dev;
- bl_drv->bconf = bconf;
- ret = aml_bl_config_load(bconf, pdev);
+ bl_drv->bconf = &bl_config;
+ ret = aml_bl_config_load(bl_drv->bconf, pdev);
if (ret)
goto err;
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.power = FB_BLANK_UNBLANK; /* full on */
- props.max_brightness = (bconf->level_max > 0 ?
- bconf->level_max : BL_LEVEL_MAX);
+ props.max_brightness = (bl_drv->bconf->level_max > 0 ?
+ bl_drv->bconf->level_max : BL_LEVEL_MAX);
props.brightness = bl_on_level;
bldev = backlight_device_register(AML_BL_NAME, &pdev->dev,
{
struct aml_ldim_driver_s *ldim_drv = aml_ldim_get_driver();
- ldim_drv->pinmux_ctrl(ldim_drv->ldev_conf->pinmux_name);
+ ldim_set_duty_pwm(&(ldim_drv->ldev_conf->pwm_config));
+ ldim_drv->pinmux_ctrl(1);
mdelay(2);
ldim_gpio_set(ldim_drv->ldev_conf->en_gpio,
ldim_drv->ldev_conf->en_gpio_on);
ldim_gpio_set(ldim_drv->ldev_conf->en_gpio,
ldim_drv->ldev_conf->en_gpio_off);
+ ldim_drv->pinmux_ctrl(0);
ldim_pwm_off(&(ldim_drv->ldev_conf->pwm_config));
return 0;
iw7027_power_on_init(IW7027_POWER_ON);
/* step 5: supply stable vsync */
- ldim_drv->pinmux_ctrl(ldim_drv->ldev_conf->pinmux_name);
+ ldim_set_duty_pwm(&(ldim_drv->ldev_conf->pwm_config));
+ ldim_drv->pinmux_ctrl(1);
/* step 6: delay for system clock and light bar PSU stable */
msleep(520);
ldim_gpio_set(ldim_drv->ldev_conf->en_gpio,
ldim_drv->ldev_conf->en_gpio_off);
+ ldim_drv->pinmux_ctrl(0);
ldim_pwm_off(&(ldim_drv->ldev_conf->pwm_config));
return 0;
static char *ldim_pinmux_str[] = {
"ldim_pwm", /* 0 */
"ldim_pwm_vs", /* 1 */
+ "ldim_pwm_off", /* 1 */
"none",
};
-/* set ldim pwm_vs */
-static int ldim_pwm_pinmux_ctrl(char *pin_str)
+static int ldim_pwm_pinmux_ctrl(int status)
{
struct aml_ldim_driver_s *ldim_drv = aml_ldim_get_driver();
struct bl_pwm_config_s *bl_pwm;
- int ret = 0;
+ int ret = 0, index = 0xff;
- if (strcmp(pin_str, "invalid") == 0)
+ if (strcmp(ldim_drv->ldev_conf->pinmux_name, "invalid") == 0)
return 0;
bl_pwm = &ldim_drv->ldev_conf->pwm_config;
if (bl_pwm->pwm_port >= BL_PWM_MAX)
return 0;
- ldim_set_duty_pwm(bl_pwm);
+ if (bl_pwm->pwm_port == BL_PWM_VS)
+ index = (status) ? 1 : 2;
+ else
+ index = (status) ? 0 : 2;
- if (ldim_drv->pinmux_flag)
+ if (ldim_drv->pinmux_flag == index) {
+ LDIMPR("pinmux %s is already selected\n",
+ ldim_pinmux_str[index]);
return 0;
+ }
/* request pwm pinmux */
- if (bl_pwm->pwm_port == BL_PWM_VS) {
- ldim_drv->pin = devm_pinctrl_get_select(ldim_drv->dev,
- ldim_pinmux_str[1]);
- if (IS_ERR(ldim_drv->pin)) {
- LDIMERR("set %s pinmux error\n",
- ldim_pinmux_str[1]);
- } else {
- LDIMPR("request %s pinmux: %p\n",
- ldim_pinmux_str[1], ldim_drv->pin);
- }
+ ldim_drv->pin = devm_pinctrl_get_select(ldim_drv->dev,
+ ldim_pinmux_str[index]);
+ if (IS_ERR(ldim_drv->pin)) {
+ LDIMERR("set pinmux %s error\n", ldim_pinmux_str[index]);
} else {
- ldim_drv->pin = devm_pinctrl_get_select(ldim_drv->dev,
- ldim_pinmux_str[0]);
- if (IS_ERR(ldim_drv->pin)) {
- LDIMERR("set %s pinmux error\n",
- ldim_pinmux_str[0]);
- } else {
- LDIMPR("request %s pinmux: %p\n",
- ldim_pinmux_str[0], ldim_drv->pin);
- }
+ LDIMPR("set pinmux %s: %p\n",
+ ldim_pinmux_str[index], ldim_drv->pin);
}
- ldim_drv->pinmux_flag = 1;
+ ldim_drv->pinmux_flag = index;
return ret;
}
break;
}
}
+ pr_info("pinmux_flag: %d\n"
+ "pinmux_pointer: 0x%p\n",
+ ldim_drv->pinmux_flag,
+ ldim_drv->pin);
} else {
pr_info("device config is null\n");
}
ret = of_property_read_string(child, "ldim_pwm_pinmux_sel", &str);
if (ret) {
LDIMERR("failed to get ldim_pwm_name\n");
- str = "invalid";
+ strcpy(ldim_dev_config.pinmux_name, "invalid");
+ } else {
+ strcpy(ldim_dev_config.pinmux_name, str);
}
- strcpy(ldim_dev_config.pinmux_name, str);
ret = of_property_read_string(child, "ldim_pwm_port", &str);
if (ret) {
static int ldim_on_init(void)
{
int ret = 0;
- struct aml_ldim_driver_s *ldim_drv = aml_ldim_get_driver();
LDIMPR("%s\n", __func__);
ldim_func_ctrl(0); /* default disable ldim function */
if (ldim_driver.pinmux_ctrl)
- ldim_driver.pinmux_ctrl(ldim_drv->ldev_conf->pinmux_name);
+ ldim_driver.pinmux_ctrl(1);
ldim_on_flag = 1;
ldim_level_update = 1;
.valid_flag = 0, /* default invalid, active when bl_ctrl_method=ldim */
.dev_index = 0xff,
.static_pic_flag = 0,
- .pinmux_flag = 0,
+ .pinmux_flag = 0xff,
.ldim_conf = &ldim_config,
.ldev_conf = NULL,
.ldim_matrix_buf = NULL,
ldim_drv->ldev_conf->en_gpio_on);
mdelay(2);
- ldim_drv->pinmux_ctrl(ldim_drv->ldev_conf->pinmux_name);
+ ldim_set_duty_pwm(&(ldim_drv->ldev_conf->pwm_config));
+ ldim_drv->pinmux_ctrl(1);
mdelay(20);
return 0;
ldim_gpio_set(ldim_drv->ldev_conf->en_gpio,
ldim_drv->ldev_conf->en_gpio_off);
+ ldim_drv->pinmux_ctrl(0);
ldim_pwm_off(&(ldim_drv->ldev_conf->pwm_config));
return 0;
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
-#include <linux/amlogic/i2c-amlogic.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/amlogic/media/vout/lcd/aml_bl.h>
#include "bl_extern.h"
-unsigned int bl_extern_brightness;
static struct aml_bl_extern_driver_s bl_extern_driver;
static int bl_extern_set_level(unsigned int level)
{
- bl_extern_brightness = level & 0xff;
+ struct aml_bl_drv_s *bl_drv = aml_bl_get_driver();
+ unsigned int level_max, level_min;
+ unsigned int dim_max, dim_min;
+ int ret = 0;
+
+ if (bl_drv == NULL)
+ return -1;
+ level_max = bl_drv->bconf->level_max;
+ level_min = bl_drv->bconf->level_min;
+ dim_max = bl_extern_driver.config.dim_max;
+ dim_min = bl_extern_driver.config.dim_min;
+ level = dim_min - ((level - level_min) * (dim_min - dim_max)) /
+ (level_max - level_min);
+
+ bl_extern_driver.brightness = level;
+ if (bl_extern_driver.status == 0)
+ return 0;
if (bl_extern_driver.device_bri_update)
- bl_extern_driver.device_bri_update(level);
+ ret = bl_extern_driver.device_bri_update(level);
- return 0;
+ return ret;
}
static int bl_extern_power_on(void)
BLEX("%s\n", __func__);
if (bl_extern_driver.device_power_on)
- bl_extern_driver.device_power_on();
+ ret = bl_extern_driver.device_power_on();
+ bl_extern_driver.status = 1;
/* restore bl level */
- bl_extern_set_level(bl_extern_brightness);
+ bl_extern_set_level(bl_extern_driver.brightness);
return ret;
}
BLEX("%s\n", __func__);
+ bl_extern_driver.status = 0;
if (bl_extern_driver.device_power_off)
- bl_extern_driver.device_power_off();
+ ret = bl_extern_driver.device_power_off();
return ret;
}
static struct aml_bl_extern_driver_s bl_extern_driver = {
+ .status = 0,
+ .brightness = 0,
.power_on = bl_extern_power_on,
.power_off = bl_extern_power_off,
.set_level = bl_extern_set_level,
unsigned char i2c_bus;
if (strncmp(str, "i2c_bus_ao", 10) == 0)
- i2c_bus = AML_I2C_MASTER_AO;
+ i2c_bus = BL_EXTERN_I2C_BUS_4;
else if (strncmp(str, "i2c_bus_a", 9) == 0)
- i2c_bus = AML_I2C_MASTER_A;
+ i2c_bus = BL_EXTERN_I2C_BUS_0;
else if (strncmp(str, "i2c_bus_b", 9) == 0)
- i2c_bus = AML_I2C_MASTER_B;
+ i2c_bus = BL_EXTERN_I2C_BUS_1;
else if (strncmp(str, "i2c_bus_c", 9) == 0)
- i2c_bus = AML_I2C_MASTER_C;
+ i2c_bus = BL_EXTERN_I2C_BUS_2;
else if (strncmp(str, "i2c_bus_d", 9) == 0)
- i2c_bus = AML_I2C_MASTER_D;
+ i2c_bus = BL_EXTERN_I2C_BUS_3;
+ else if (strncmp(str, "i2c_bus_0", 10) == 0)
+ i2c_bus = BL_EXTERN_I2C_BUS_0;
+ else if (strncmp(str, "i2c_bus_1", 9) == 0)
+ i2c_bus = BL_EXTERN_I2C_BUS_1;
+ else if (strncmp(str, "i2c_bus_2", 9) == 0)
+ i2c_bus = BL_EXTERN_I2C_BUS_2;
+ else if (strncmp(str, "i2c_bus_3", 9) == 0)
+ i2c_bus = BL_EXTERN_I2C_BUS_3;
+ else if (strncmp(str, "i2c_bus_4", 9) == 0)
+ i2c_bus = BL_EXTERN_I2C_BUS_4;
else {
- i2c_bus = AML_I2C_MASTER_A;
+ i2c_bus = BL_EXTERN_I2C_BUS_MAX;
BLEXERR("invalid i2c_bus: %s\n", str);
}
BLEX("%s:\n", __func__);
switch (bl_extern->config.type) {
case BL_EXTERN_I2C:
- pr_info("index: %d\n"
+ pr_info("index: %d\n"
"name: %s\n"
"type: i2c(%d)\n"
"i2c_addr: 0x%02x\n"
case BL_EXTERN_SPI:
break;
case BL_EXTERN_MIPI:
- pr_info("index: %d\n"
+ pr_info("index: %d\n"
"name: %s\n"
"type: mipi(%d)\n"
"dim_min: %d\n"
static int bl_extern_config_from_dts(struct device_node *np, int index)
{
- char be_propname[20];
+ char propname[20];
struct device_node *child;
const char *str;
unsigned int temp[5], val;
int ret = 0;
struct aml_bl_extern_driver_s *bl_extern = aml_bl_extern_get_driver();
+ ret = of_property_read_string(np, "i2c_bus", &str);
+ if (ret == 0)
+ bl_extern->config.i2c_bus = BL_EXTERN_I2C_BUS_MAX;
+ else
+ bl_extern->config.i2c_bus = bl_extern_get_i2c_bus_str(str);
+
/* get device config */
- sprintf(be_propname, "extern_%d", index);
- BLEX("load: %s\n", be_propname);
- child = of_get_child_by_name(np, be_propname);
+ sprintf(propname, "extern_%d", index);
+ child = of_get_child_by_name(np, propname);
if (child == NULL) {
- BLEXERR("failed to get %s\n", be_propname);
+ BLEXERR("failed to get %s\n", propname);
return -1;
}
+ BLEX("load: %s\n", propname);
+
ret = of_property_read_u32_array(child, "index", &temp[0], 1);
- if (ret)
+ if (ret) {
BLEXERR("failed to get index, exit\n");
- else {
+ } else {
if (temp[0] == index)
bl_extern->config.index = temp[0];
else {
- BLEXERR("index not match, exit\n");
+ BLEXERR("index %d not match, exit\n", index);
return -1;
- }
}
+ }
ret = of_property_read_string(child, "extern_name", &str);
if (ret) {
BLEXERR("failed to get bl_extern_name\n");
- str = "bl_extern_name";
+ strcpy(bl_extern->config.name, "none");
+ } else {
+ strcpy(bl_extern->config.name, str);
}
- strcpy(bl_extern->config.name, str);
ret = of_property_read_u32(child, "type", &val);
if (ret) {
switch (bl_extern->config.type) {
case BL_EXTERN_I2C:
+ if (bl_extern->config.i2c_bus >= BL_EXTERN_I2C_BUS_MAX) {
+ BLEXERR("failed to get i2c_bus\n");
+ } else {
+ BLEX("%s i2c_bus=%s[%d]\n",
+ bl_extern->config.name,
+ str, bl_extern->config.i2c_bus);
+ }
+
ret = of_property_read_u32(child, "i2c_address", &val);
if (ret) {
BLEXERR("failed to get i2c_address\n");
} else {
bl_extern->config.i2c_addr = (unsigned char)val;
- }
- if (lcd_debug_print_flag) {
BLEX("%s i2c_address=0x%02x\n",
bl_extern->config.name,
bl_extern->config.i2c_addr);
}
-
- ret = of_property_read_string(child, "i2c_bus", &str);
- if (ret) {
- BLEXERR("failed to get i2c_bus\n");
- } else {
- bl_extern->config.i2c_bus =
- bl_extern_get_i2c_bus_str(str);
- }
- if (lcd_debug_print_flag) {
- BLEX("%s i2c_bus=%s[%d]\n",
- bl_extern->config.name, str,
- bl_extern->config.i2c_bus);
- }
break;
case BL_EXTERN_SPI:
break;
static int bl_extern_add_driver(void)
{
- int ret = 0;
+ int ret = -1;
struct bl_extern_config_s *extconf = &bl_extern_driver.config;
if (strcmp(extconf->name, "i2c_lp8556") == 0) {
#ifdef CONFIG_AMLOGIC_BL_EXTERN_I2C_LP8556
ret = i2c_lp8556_probe();
#endif
- goto bl_extern_add_driver_next;
} else if (strcmp(extconf->name, "mipi_lt070me05") == 0) {
#ifdef CONFIG_AMLOGIC_BL_EXTERN_MIPI_LT070ME05
ret = mipi_lt070me05_probe();
#endif
- goto bl_extern_add_driver_next;
} else {
BLEXERR("invalid device name: %s\n", extconf->name);
- ret = -1;
}
-bl_extern_add_driver_next:
if (ret) {
BLEXERR("add device driver failed %s(%d)\n",
extconf->name, extconf->index);
} else {
- BLEX("add device driver %s(%d)\n",
+ BLEX("add device driver %s(%d) ok\n",
extconf->name, extconf->index);
}
static int bl_extern_remove_driver(void)
{
- int ret = 0;
+ int ret = -1;
struct bl_extern_config_s *extconf = &bl_extern_driver.config;
if (strcmp(extconf->name, "i2c_lp8556") == 0) {
#ifdef CONFIG_AMLOGIC_BL_EXTERN_I2C_LP8556
ret = i2c_lp8556_remove();
#endif
- goto bl_extern_remove_driver_next;
} else if (strcmp(extconf->name, "mipi_lt070me05") == 0) {
#ifdef CONFIG_AMLOGIC_BL_EXTERN_MIPI_LT070ME05
ret = mipi_lt070me05_remove();
#endif
- goto bl_extern_remove_driver_next;
} else {
BLEXERR("invalid device name: %s\n", extconf->name);
- ret = -1;
}
-bl_extern_remove_driver_next:
if (ret) {
BLEXERR("remove device driver failed %s(%d)\n",
extconf->name, extconf->index);
} else {
- BLEX("remove device driver %s(%d)\n",
+ BLEX("remove device driver %s(%d) ok\n",
extconf->name, extconf->index);
}
{
int ret = 0;
- bl_extern_config_from_dts(bl_extern_driver.dev->of_node,
- index);
+ bl_extern_config_from_dts(bl_extern_driver.dev->of_node, index);
bl_extern_add_driver();
bl_extern_driver.config_print = bl_extern_config_print;
BLEX("%s OK\n", __func__);
{
int ret;
- if (lcd_debug_print_flag)
- BLEX("%s\n", __func__);
-
ret = platform_driver_register(&aml_bl_extern_driver);
if (ret) {
BLEXERR("driver register failed\n");
#ifndef _BL_EXTERN_H_
#define _BL_EXTERN_H_
#include <linux/of.h>
+#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/amlogic/aml_gpio_consumer.h>
#include <linux/pinctrl/consumer.h>
-#include <linux/amlogic/media/vout/lcd/lcd_vout.h>
+extern unsigned int bl_debug_print_flag;
#define BLEX(fmt, args...) pr_info("bl extern: "fmt"", ## args)
-#define BLEXERR(fmt, args...) pr_err("bl extern: error: "fmt"", ## args)
+#define BLEXERR(fmt, args...) pr_err("bl extern: error: "fmt"", ## args)
+
+#define BL_EXTERN_DRIVER "bl_extern"
+
+struct aml_bl_extern_i2c_dev_s {
+ char name[20];
+ struct i2c_client *client;
+};
+
+extern struct aml_bl_extern_i2c_dev_s *aml_bl_extern_i2c_get_dev(void);
+
+extern int bl_extern_i2c_write(struct i2c_client *i2client,
+ unsigned char *buff, unsigned int len);
+extern int bl_extern_i2c_read(struct i2c_client *i2client,
+ unsigned char *buff, unsigned int len);
-#define BL_EXTERN_DRIVER "bl_extern"
#ifdef CONFIG_AMLOGIC_BL_EXTERN_I2C_LP8556
extern int i2c_lp8556_probe(void);
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
-#include <linux/amlogic/i2c-amlogic.h>
#include <linux/amlogic/media/vout/lcd/aml_bl_extern.h>
#include "bl_extern.h"
return i2c_device;
}
+int bl_extern_i2c_write(struct i2c_client *i2client,
+ unsigned char *buff, unsigned int len)
+{
+ struct i2c_msg msg;
+ int ret = 0;
+
+ if (i2client == NULL) {
+ BLEXERR("i2client is null\n");
+ return -1;
+ }
+
+ msg.addr = i2client->addr;
+ msg.flags = 0;
+ msg.len = len;
+ msg.buf = buff;
+
+ ret = i2c_transfer(i2client->adapter, &msg, 1);
+ if (ret < 0)
+ BLEXERR("i2c write failed [addr 0x%02x]\n", i2client->addr);
+
+ return ret;
+}
+
+int bl_extern_i2c_read(struct i2c_client *i2client,
+ unsigned char *buff, unsigned int len)
+{
+ struct i2c_msg msgs[2];
+ int ret = 0;
+
+ if (i2client == NULL) {
+ BLEXERR("i2client is null\n");
+ return -1;
+ }
+
+ msgs[0].addr = i2client->addr;
+ msgs[0].flags = 0;
+ msgs[0].len = 1;
+ msgs[0].buf = buff;
+ msgs[1].addr = i2client->addr;
+ msgs[1].flags = I2C_M_RD;
+ msgs[1].len = len;
+ msgs[1].buf = buff;
+
+ ret = i2c_transfer(i2client->adapter, msgs, 2);
+ if (ret < 0) {
+ BLEXERR("%s: i2c transfer failed [addr 0x%02x]\n",
+ __func__, i2client->addr);
+ }
+
+ return ret;
+}
+
static int bl_extern_i2c_config_from_dts(struct device *dev,
- struct aml_bl_extern_i2c_dev_s *i2c_device)
+ struct aml_bl_extern_i2c_dev_s *i2c_dev)
{
int ret;
struct device_node *np = dev->of_node;
ret = of_property_read_string(np, "dev_name", &str);
if (ret) {
- BLEXERR("failed to get dev_i2c_name\n");
- str = "bl_extern_i2c_name";
+ BLEXERR("failed to get dev_name\n");
+ strcpy(i2c_dev->name, "none");
+ } else {
+ strcpy(i2c_dev->name, str);
}
- strcpy(i2c_device->name, str);
return 0;
}
static int aml_bl_extern_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
- BLEX("I2C Address: 0x%02x", client->addr);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
- BLEXERR("I2C check functionality failed.");
+ BLEXERR("i2c check functionality failed.");
return -ENODEV;
}
return -ENOMEM;
}
i2c_device->client = client;
+ BLEX("i2c Address: 0x%02x", i2c_device->client->addr);
+
bl_extern_i2c_config_from_dts(&client->dev, i2c_device);
return 0;
#ifdef CONFIG_OF
static const struct of_device_id aml_bl_extern_i2c_dt_match[] = {
{
- .compatible = "amlogic, bl_extern_i2c",
+ .compatible = "bl_extern, i2c",
},
{},
};
{
int ret;
- if (lcd_debug_print_flag)
+ if (bl_debug_print_flag)
BLEX("%s\n", __func__);
ret = i2c_add_driver(&aml_bl_extern_i2c_driver);
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
-#include <linux/amlogic/i2c-amlogic.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/amlogic/media/vout/lcd/aml_bl_extern.h>
-#include <linux/amlogic/media/vout/lcd/aml_bl.h>
#include "bl_extern.h"
-#define BL_EXTERN_INDEX 0
#define BL_EXTERN_NAME "i2c_lp8556"
#define BL_EXTERN_TYPE BL_EXTERN_I2C
-#define BL_EXTERN_CMD_SIZE 4
-
-static unsigned int bl_status;
+static struct bl_extern_config_s *ext_config;
+static struct aml_bl_extern_i2c_dev_s *i2c_dev;
+#define BL_EXTERN_CMD_SIZE 4
static unsigned char init_on_table[] = {
0x00, 0xa2, 0x20, 0x00,
0x00, 0xa5, 0x54, 0x00,
0x00, 0xa1, 0xb7, 0x00,
0x00, 0xa0, 0xff, 0x00,
0x00, 0x00, 0x80, 0x00,
- 0xff, 0x00, 0x00, 0x00, //ending
+ 0xff, 0x00, 0x00, 0x00, /*ending*/
};
static unsigned char init_off_table[] = {
- 0xff, 0x00, 0x00, 0x00, //ending
+ 0xff, 0x00, 0x00, 0x00, /*ending*/
};
-static int i2c_lp8556_write(struct i2c_client *i2client,
- unsigned char *buff, unsigned int len)
-{
- int ret = 0;
- struct i2c_msg msg[] = {
- {
- .addr = i2client->addr,
- .flags = 0,
- .len = len,
- .buf = buff,
- }
- };
- BLEX("%s\n", __func__);
-
- ret = i2c_transfer(i2client->adapter, msg, 1);
- if (ret < 0)
- BLEXERR("i2c write failed [addr 0x%02x]\n", i2client->addr);
-
- return ret;
-}
-
static int i2c_lp8556_power_cmd(unsigned char *init_table)
{
int i = 0, len;
int ret = 0;
- struct aml_bl_extern_driver_s *bl_extern = aml_bl_extern_get_driver();
- struct aml_bl_extern_i2c_dev_s *i2c_dev = aml_bl_extern_i2c_get_dev();
+
BLEX("%s\n", __func__);
+ if (ext_config == NULL) {
+ BLEXERR("invalid ext_config\n");
+ return -1;
+ }
+ if (i2c_dev == NULL) {
+ BLEXERR("invalid i2c device\n");
+ return -1;
+ }
len = BL_EXTERN_CMD_SIZE;
while (i <= BL_EXTERN_INIT_TABLE_MAX) {
} else if (init_table[i] == BL_EXTERN_INIT_NONE) {
/* do nothing, only for delay */
} else if (init_table[i] == BL_EXTERN_INIT_CMD) {
- if (i2c_dev == NULL) {
- BLEXERR("invalid i2c device\n");
- return -1;
- }
- ret = i2c_lp8556_write(i2c_dev->client,
+ ret = bl_extern_i2c_write(i2c_dev->client,
&init_table[i+1], (len-2));
} else {
- BLEXERR("%s(%d: %s): power_type %d is invalid\n",
- __func__, bl_extern->config.index,
- bl_extern->config.name, bl_extern->config.type);
+ BLEXERR("%s: %s(%d): power_type %d is invalid\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
}
if (init_table[i+len-1] > 0)
mdelay(init_table[i+len-1]);
static int i2c_lp8556_power_ctrl(int flag)
{
int ret = 0;
- struct aml_bl_extern_driver_s *bl_extern = aml_bl_extern_get_driver();
+
BLEX("%s\n", __func__);
+ if (ext_config == NULL) {
+ BLEXERR("invalid ext_config\n");
+ return -1;
+ }
+
if (flag)
ret = i2c_lp8556_power_cmd(init_on_table);
else
ret = i2c_lp8556_power_cmd(init_off_table);
- BLEX("%s(%d: %s): %d\n",
- __func__, bl_extern->config.index,
- bl_extern->config.name, flag);
+ BLEX("%s: %s(%d): %d\n",
+ __func__, ext_config->name, ext_config->index, flag);
return ret;
}
static int i2c_lp8556_power_on(void)
{
int ret;
+
BLEX("%s\n", __func__);
- bl_status = 1;
ret = i2c_lp8556_power_ctrl(1);
return ret;
-
}
static int i2c_lp8556_power_off(void)
{
int ret;
- bl_status = 0;
ret = i2c_lp8556_power_ctrl(0);
return ret;
-
}
static int i2c_lp8556_set_level(unsigned int level)
{
unsigned char tData[3];
int ret = 0;
- struct aml_bl_drv_s *bl_drv = aml_bl_get_driver();
- struct aml_bl_extern_driver_s *bl_extern = aml_bl_extern_get_driver();
- struct aml_bl_extern_i2c_dev_s *i2c_dev = aml_bl_extern_i2c_get_dev();
- unsigned int level_max, level_min;
- unsigned int dim_max, dim_min;
-
- if (bl_drv == NULL)
- return -1;
- level_max = bl_drv->bconf->level_max;
- level_min = bl_drv->bconf->level_min;
- dim_max = bl_extern->config.dim_max;
- dim_min = bl_extern->config.dim_min;
- level = dim_min - ((level - level_min) * (dim_min - dim_max)) /
- (level_max - level_min);
- level &= 0xff;
if (i2c_dev == NULL) {
BLEXERR("invalid i2c device\n");
return -1;
}
- if (bl_status) {
- tData[0] = 0x0;
- tData[1] = level;
- ret = i2c_lp8556_write(i2c_dev->client, tData, 2);
- }
+
+ tData[0] = 0x0;
+ tData[1] = level & 0xff;
+ ret = bl_extern_i2c_write(i2c_dev->client, tData, 2);
return ret;
}
return -1;
}
- if (bl_extern->config.type == BL_EXTERN_MAX) {
- bl_extern->config.index = BL_EXTERN_INDEX;
- bl_extern->config.type = BL_EXTERN_TYPE;
- strcpy(bl_extern->config.name, BL_EXTERN_NAME);
- }
+ ext_config = &bl_extern->config;
+ i2c_dev = aml_bl_extern_i2c_get_dev();
bl_extern->device_power_on = i2c_lp8556_power_on;
bl_extern->device_power_off = i2c_lp8556_power_off;
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
-#include <linux/amlogic/i2c-amlogic.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/amlogic/media/vout/lcd/aml_bl_extern.h>
-#include <linux/amlogic/media/vout/lcd/aml_bl.h>
#include "bl_extern.h"
-#define BL_EXTERN_INDEX 1
#define BL_EXTERN_NAME "mipi_lt070me05"
#define BL_EXTERN_TYPE BL_EXTERN_MIPI
-
-static unsigned int bl_status;
-
static int mipi_lt070me05_power_on(void)
{
- bl_status = 1;
-
return 0;
}
static int mipi_lt070me05_power_off(void)
{
- bl_status = 0;
-
return 0;
}
static int mipi_lt070me05_set_level(unsigned int level)
{
unsigned char payload[] = {0x15, 2, 0x51, 0xe6, 0xff, 0xff};
- struct aml_bl_drv_s *bl_drv = aml_bl_get_driver();
- struct aml_bl_extern_driver_s *bl_extern = aml_bl_extern_get_driver();
- unsigned int level_max, level_min;
- unsigned int dim_max, dim_min;
- if (bl_drv == NULL)
- return -1;
- level_max = bl_drv->bconf->level_max;
- level_min = bl_drv->bconf->level_min;
- dim_max = bl_extern->config.dim_max;
- dim_min = bl_extern->config.dim_min;
- level = dim_min - ((level - level_min) * (dim_min - dim_max)) /
- (level_max - level_min);
- level &= 0xff;
-
- if (bl_status) {
- payload[3] = level;
+ payload[3] = level & 0xff;
#ifdef CONFIG_AMLOGIC_LCD_TABLET
- dsi_write_cmd(&payload[0]);
+ dsi_write_cmd(&payload[0]);
#endif
- }
+
return 0;
}
return -1;
}
- if (bl_extern->config.type == BL_EXTERN_MAX) {
- bl_extern->config.index = BL_EXTERN_INDEX;
- bl_extern->config.type = BL_EXTERN_TYPE;
- strcpy(bl_extern->config.name, BL_EXTERN_NAME);
- }
-
bl_extern->device_power_on = mipi_lt070me05_power_on;
bl_extern->device_power_off = mipi_lt070me05_power_off;
bl_extern->device_bri_update = mipi_lt070me05_set_level;
return gpiod_get_value(cpu_gpio->gpio);
}
-const char *lcd_ttl_pinmux_str[] = {
+static char *lcd_ttl_pinmux_str[] = {
"ttl_6bit_hvsync_on", /* 0 */
"ttl_6bit_de_on", /* 1 */
"ttl_6bit_hvsync_de_on", /* 2 */
{
struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
struct lcd_config_s *pconf;
- unsigned int index, num;
+ unsigned int base, index;
if (lcd_debug_print_flag)
LCDPR("%s: %d\n", __func__, status);
pconf = lcd_drv->lcd_config;
if (pconf->lcd_basic.lcd_bits == 6)
- index = 0;
+ base = 0;
else
- index = 4;
+ base = 4;
if (status) {
- if (pconf->pinmux_flag == 0) {
- pconf->pinmux_flag = 1;
- switch (pconf->lcd_control.ttl_config->sync_valid) {
- case 1: /* hvsync */
- num = index + 0;
- break;
- case 2: /* DE */
- num = index + 1;
- break;
- default:
- case 3: /* DE + hvsync */
- num = index + 2;
- break;
- }
- } else {
- LCDPR("ttl pinmux is already selected\n");
- return;
+ switch (pconf->lcd_control.ttl_config->sync_valid) {
+ case 1: /* hvsync */
+ index = base + 0;
+ break;
+ case 2: /* DE */
+ index = base + 1;
+ break;
+ default:
+ case 3: /* DE + hvsync */
+ index = base + 2;
+ break;
}
} else {
- if (pconf->pinmux_flag) {
- pconf->pinmux_flag = 0;
- num = index + 3;
- } else {
- LCDPR("ttl pinmux is already released\n");
- return;
- }
+ index = base + 3;
+ }
+
+ if (pconf->pinmux_flag == index) {
+ LCDPR("pinmux %s is already selected\n",
+ lcd_ttl_pinmux_str[index]);
+ return;
}
/* request pinmux */
pconf->pin = devm_pinctrl_get_select(lcd_drv->dev,
- lcd_ttl_pinmux_str[num]);
+ lcd_ttl_pinmux_str[index]);
if (IS_ERR(pconf->pin))
- LCDERR("set ttl pinmux error\n");
+ LCDERR("set ttl pinmux %s error\n", lcd_ttl_pinmux_str[index]);
+ else {
+ if (lcd_debug_print_flag) {
+ LCDPR("set ttl pinmux %s: %p\n",
+ lcd_ttl_pinmux_str[index], pconf->pin);
+ }
+ }
+ pconf->pinmux_flag = index;
}
+static char *lcd_vbyone_pinmux_str[] = {
+ "vbyone",
+ "vbyone_off",
+ "none",
+};
+
/* set VX1_LOCKN && VX1_HTPDN */
void lcd_vbyone_pinmux_set(int status)
{
struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
struct lcd_config_s *pconf;
+ unsigned int index;
if (lcd_debug_print_flag)
LCDPR("%s: %d\n", __func__, status);
-#if 1
pconf = lcd_drv->lcd_config;
- if (status) {
- if (pconf->pinmux_flag == 0) {
- pconf->pinmux_flag = 1;
- /* request pinmux */
- pconf->pin = devm_pinctrl_get_select(lcd_drv->dev,
- "vbyone");
- if (IS_ERR(pconf->pin))
- LCDERR("set vbyone pinmux error\n");
- } else {
- LCDPR("vbyone pinmux is already selected\n");
- }
- } else {
- if (pconf->pinmux_flag) {
- pconf->pinmux_flag = 0;
- /* release pinmux */
- devm_pinctrl_put(pconf->pin);
- } else {
- LCDPR("vbyone pinmux is already released\n");
- }
+ index = (status) ? 0 : 1;
+
+ if (pconf->pinmux_flag == index) {
+ LCDPR("pinmux %s is already selected\n",
+ lcd_vbyone_pinmux_str[index]);
+ return;
}
-#else
- if (status) {
- lcd_pinmux_clr_mask(7,
- ((1 << 1) | (1 << 2) | (1 << 9) | (1 << 10)));
- lcd_pinmux_set_mask(7, ((1 << 11) | (1 << 12)));
+
+ pconf->pin = devm_pinctrl_get_select(lcd_drv->dev,
+ lcd_vbyone_pinmux_str[index]);
+ if (IS_ERR(pconf->pin)) {
+ LCDERR("set vbyone pinmux %s error\n",
+ lcd_vbyone_pinmux_str[index]);
} else {
- lcd_pinmux_clr_mask(7, ((1 << 11) | (1 << 12)));
+ if (lcd_debug_print_flag) {
+ LCDPR("set vbyone pinmux %s: %p\n",
+ lcd_vbyone_pinmux_str[index], pconf->pin);
+ }
}
-#endif
+ pconf->pinmux_flag = index;
}
unsigned int lcd_lvds_channel_on_value(struct lcd_config_s *pconf)
/* 20180620: fix coverity errors */
/* 20180626: txl suuport */
/* 20180718: mute: wait vsync for display shadow */
-#define LCD_DRV_VERSION "20180718"
+/* 20180827: add pinmux off support */
+#define LCD_DRV_VERSION "20180827"
#define VPP_OUT_SATURATE (1 << 0)
((pconf->lcd_control.ttl_config->sync_valid >> 1) & 1),
((pconf->lcd_control.ttl_config->swap_ctrl >> 1) & 1),
((pconf->lcd_control.ttl_config->swap_ctrl >> 0) & 1));
+
+ len += snprintf((buf+len), n,
+ "pinmux_flag %d\n"
+ "pinmux_pointer 0x%p\n\n",
+ pconf->pinmux_flag,
+ pconf->pin);
break;
case LCD_LVDS:
n = lcd_debug_info_len(len + offset);
((vx1_conf->ctrl_flag >> 2) & 0x1),
vx1_conf->cdr_training_hold);
}
+
+ len += snprintf((buf+len), n,
+ "pinmux_flag %d\n"
+ "pinmux_pointer 0x%p\n\n",
+ pconf->pinmux_flag,
+ pconf->pin);
break;
case LCD_MIPI:
#ifdef CONFIG_AMLOGIC_LCD_TABLET
if (init_table[i+cmd_size+1] > 0)
mdelay(init_table[i+cmd_size+1]);
} else {
- EXTERR("%s(%d: %s): type %d invalid\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): type %d invalid\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
}
i += (cmd_size + 2);
step++;
if (init_table[i+cmd_size+1] > 0)
mdelay(init_table[i+cmd_size+1]);
} else {
- EXTERR("%s(%d: %s): type %d invalid\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): type %d invalid\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
}
i += (cmd_size + 2);
step++;
}
break;
default:
- EXTERR("%s(%d: %s): extern_type %d is not support\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): extern_type %d is not support\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
break;
}
ret = lcd_extern_i2c_write(i2c1_dev->client,
&init_table[i+1], (cmd_size-2));
} else {
- EXTERR("%s(%d: %s): type %d invalid\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): type %d invalid\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
}
if (init_table[i+cmd_size-1] > 0)
mdelay(init_table[i+cmd_size-1]);
ret = lcd_extern_spi_write(&init_table[i+1],
(cmd_size-2));
} else {
- EXTERR("%s(%d: %s): type %d invalid\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): type %d invalid\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
}
if (init_table[i+cmd_size-1] > 0)
mdelay(init_table[i+cmd_size-1]);
}
break;
default:
- EXTERR("%s(%d: %s): extern_type %d is not support\n",
- __func__, ext_config->index,
- ext_config->name, ext_config->type);
+ EXTERR("%s: %s(%d): extern_type %d is not support\n",
+ __func__, ext_config->name,
+ ext_config->index, ext_config->type);
break;
}
return ret;
}
-static int lcd_extern_power_cmd(unsigned char *init_table, int flag)
+static int lcd_extern_power_ctrl(int flag)
{
+ unsigned char *init_table;
unsigned char cmd_size;
int ret = 0;
+ if (ext_config->type == LCD_EXTERN_SPI)
+ spi_gpio_init();
+
+ if (flag)
+ init_table = ext_config->table_init_on;
+ else
+ init_table = ext_config->table_init_off;
cmd_size = ext_config->cmd_size;
if (cmd_size < 1) {
EXTERR("%s: cmd_size %d is invalid\n", __func__, cmd_size);
else
ret = lcd_extern_power_cmd_fixed_size(init_table, flag);
- return ret;
-}
-
-static int lcd_extern_power_ctrl(int flag)
-{
- int ret = 0;
-
- if (ext_config->type == LCD_EXTERN_SPI)
- spi_gpio_init();
-
- if (flag)
- ret = lcd_extern_power_cmd(ext_config->table_init_on, 1);
- else
- ret = lcd_extern_power_cmd(ext_config->table_init_off, 0);
-
if (ext_config->type == LCD_EXTERN_SPI)
spi_gpio_off();
- EXTPR("%s(%d: %s): %d\n",
- __func__, ext_config->index, ext_config->name, flag);
+ EXTPR("%s: %s(%d): %d\n",
+ __func__, ext_config->name, ext_config->index, flag);
return ret;
}
.type = LCD_EXTERN_MAX,
.status = 0,
.pinmux_valid = 0,
+ .pinmux_gpio_off = 2,
.key_valid = 0,
.addr_sel = 0,
.i2c_addr2 = LCD_EXTERN_I2C_ADDR_INVALID,
.i2c_bus = LCD_EXTERN_I2C_BUS_INVALID,
.i2c_sck_gpio = LCD_EXTERN_GPIO_NUM_MAX,
- .i2c_sck_gpio_off = 2,
.i2c_sda_gpio = LCD_EXTERN_GPIO_NUM_MAX,
- .i2c_sda_gpio_off = 2,
.spi_gpio_cs = LCD_EXTERN_GPIO_NUM_MAX,
.spi_gpio_clk = LCD_EXTERN_GPIO_NUM_MAX,
return gpiod_get_value(ext_gpio->gpio);
}
+#define LCD_EXTERN_PINMUX_MAX 3
+static char *lcd_extern_pinmux_str[LCD_EXTERN_PINMUX_MAX] = {
+ "extern_on", /* 0 */
+ "extern_off", /* 1 */
+ "none",
+};
+
void lcd_extern_pinmux_set(int status)
{
- /* kernel4.9 can't release pins */
+ int index = 0xff;
+
if (lcd_ext_driver == NULL)
return;
if (lcd_ext_driver->config->pinmux_valid == 0) {
- if (lcd_debug_print_flag) {
- EXTPR("%s: pinmux_valid %d, bypass\n",
- __func__, lcd_ext_driver->config->pinmux_valid);
- }
+ if (lcd_debug_print_flag)
+ EXTPR("%s: pinmux invalid, bypass\n", __func__);
return;
}
if (lcd_debug_print_flag)
EXTPR("%s: %d\n", __func__, status);
- if (status) {
- /* release gpio */
- if (lcd_ext_driver->pinmux_flag) {
- EXTPR("drv_index %d pinmux is already selected\n",
- lcd_ext_driver->config->index);
- return;
- }
+ index = (status) ? 0 : 1;
- /* request pinmux */
- lcd_ext_driver->pin = devm_pinctrl_get_select(lcd_extern_dev,
- "extern_pins");
- if (IS_ERR(lcd_ext_driver->pin)) {
- EXTERR("set drv_index %d pinmux error\n",
- lcd_ext_driver->config->index);
- } else {
- if (lcd_debug_print_flag) {
- EXTPR("set drv_index %d pinmux ok\n",
- lcd_ext_driver->config->index);
- }
+ if (lcd_ext_driver->pinmux_flag == index) {
+ EXTPR("%s(%d) pinmux %s is already selected\n",
+ lcd_ext_driver->config->name,
+ lcd_ext_driver->config->index,
+ lcd_extern_pinmux_str[index]);
+ return;
+ }
+
+ /* request pinmux */
+ lcd_ext_driver->pin = devm_pinctrl_get_select(lcd_extern_dev,
+ lcd_extern_pinmux_str[index]);
+ if (IS_ERR(lcd_ext_driver->pin)) {
+ EXTERR("set %s(%d) pinmux %s error\n",
+ lcd_ext_driver->config->name,
+ lcd_ext_driver->config->index,
+ lcd_extern_pinmux_str[index]);
+ } else {
+ if (lcd_debug_print_flag) {
+ EXTPR("set %s(%d) pinmux %s ok\n",
+ lcd_ext_driver->config->name,
+ lcd_ext_driver->config->index,
+ lcd_extern_pinmux_str[index]);
}
- lcd_ext_driver->pinmux_flag = 1;
}
+ lcd_ext_driver->pinmux_flag = index;
}
#ifdef CONFIG_OF
lcd_extern_config.i2c_bus = lcd_extern_get_i2c_bus_str(str);
ret = of_property_read_u32_array(lcd_extern_dev->of_node,
- "i2c_gpio_off", &extern_para[0], 4);
+ "i2c_gpio", &extern_para[0], 2);
if (ret) {
lcd_extern_config.i2c_sck_gpio = LCD_EXTERN_GPIO_NUM_MAX;
- lcd_extern_config.i2c_sck_gpio_off = 2;
lcd_extern_config.i2c_sda_gpio = LCD_EXTERN_GPIO_NUM_MAX;
- lcd_extern_config.i2c_sda_gpio_off = 2;
} else {
lcd_extern_config.i2c_sck_gpio = (unsigned char)extern_para[0];
- lcd_extern_config.i2c_sck_gpio_off =
- (unsigned char) extern_para[1];
- lcd_extern_config.i2c_sda_gpio = (unsigned char)extern_para[2];
- lcd_extern_config.i2c_sda_gpio_off =
- (unsigned char)extern_para[3];
+ lcd_extern_config.i2c_sda_gpio = (unsigned char)extern_para[1];
}
ret = of_property_read_string(lcd_extern_dev->of_node,
lcd_extern_config.pinmux_valid = 1;
ret = of_property_read_u32(lcd_extern_dev->of_node,
+ "pinctrl_gpio_off", &extern_para[0]);
+ if (ret) {
+ lcd_extern_config.pinmux_gpio_off = 2;
+ } else {
+ lcd_extern_config.pinmux_gpio_off =
+ (unsigned char)extern_para[0];
+ }
+
+ ret = of_property_read_u32(lcd_extern_dev->of_node,
"key_valid", &extern_para[0]);
if (ret) {
if (lcd_debug_print_flag)
ext_drv = lcd_ext_driver;
ext_drv->config = extconf;
- ext_drv->pinmux_flag = 0;
+ ext_drv->pinmux_flag = 0xff;
switch (ext_drv->config->type) {
case LCD_EXTERN_I2C:
pr_info("not support extern_type\n");
break;
}
+ if (econf->pinmux_valid) {
+ pr_info("pinmux_flag: %d\n", lcd_ext_driver->pinmux_flag);
+ pr_info("pinmux_pointer: 0x%p\n", lcd_ext_driver->pin);
+ }
return sprintf(buf, "\n");
}
.mipi_config = &lcd_mipi_config,
},
.lcd_power = &lcd_power_config,
- .pinmux_flag = 0,
+ .pinmux_flag = 0xff,
.change_flag = 0,
.retry_enable_flag = 0,
.retry_enable_cnt = 0,
};
enum bl_extern_i2c_bus_e {
- BL_EXTERN_I2C_BUS_AO = 0,
- BL_EXTERN_I2C_BUS_A,
- BL_EXTERN_I2C_BUS_B,
- BL_EXTERN_I2C_BUS_C,
- BL_EXTERN_I2C_BUS_D,
+ BL_EXTERN_I2C_BUS_0 = 0,
+ BL_EXTERN_I2C_BUS_1,
+ BL_EXTERN_I2C_BUS_2,
+ BL_EXTERN_I2C_BUS_3,
+ BL_EXTERN_I2C_BUS_4,
BL_EXTERN_I2C_BUS_MAX,
};
#define BL_EXTERN_I2C_BUS_INVALID 0xff
};
/* global API */
-#define BL_EXT_DRIVER_MAX 10
struct aml_bl_extern_driver_s {
+ unsigned char status;
+ unsigned int brightness;
int (*power_on)(void);
int (*power_off)(void);
int (*set_level)(unsigned int level);
struct device *dev;
};
-struct aml_bl_extern_i2c_dev_s {
- char name[20];
- struct i2c_client *client;
-};
-
-extern struct aml_bl_extern_i2c_dev_s *aml_bl_extern_i2c_get_dev(void);
extern struct aml_bl_extern_driver_s *aml_bl_extern_get_driver(void);
extern int aml_bl_extern_device_load(int index);
int (*power_on)(void);
int (*power_off)(void);
int (*set_level)(unsigned int level);
- int (*pinmux_ctrl)(char *pin_str);
+ int (*pinmux_ctrl)(int status);
int (*pwm_vs_update)(void);
int (*device_power_on)(void);
int (*device_power_off)(void);
enum lcd_extern_type_e type;
unsigned char status;
unsigned char pinmux_valid;
+ unsigned char pinmux_gpio_off;
unsigned char key_valid;
unsigned char addr_sel; /* internal used */
unsigned char i2c_addr2;
unsigned char i2c_bus;
unsigned char i2c_sck_gpio;
- unsigned char i2c_sck_gpio_off;
unsigned char i2c_sda_gpio;
- unsigned char i2c_sda_gpio_off;
unsigned char spi_gpio_cs;
unsigned char spi_gpio_clk;