[PATCH v1 2/2] pinctrl: rockchip: only enable gpio clock when it setting

2015-08-02 Thread huang lin
gpio can keep state even the clock disable, for save power
consumption, only enable gpio clock when it setting

Signed-off-by: Heiko Stuebner 
Signed-off-by: huang lin 

Signed-off-by: huang lin 
---
 drivers/pinctrl/pinctrl-rockchip.c | 60 ++
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c 
b/drivers/pinctrl/pinctrl-rockchip.c
index cc2843a..445829f 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -945,17 +945,20 @@ static int _rockchip_pmx_gpio_set_direction(struct 
gpio_chip *chip,
if (ret < 0)
return ret;
 
+   clk_enable(bank->clk);
spin_lock_irqsave(>slock, flags);
 
-   data = readl_relaxed(bank->reg_base + GPIO_SWPORT_DDR);
+   data = readl(bank->reg_base + GPIO_SWPORT_DDR);
/* set bit to 1 for output, 0 for input */
if (!input)
data |= BIT(pin);
else
data &= ~BIT(pin);
+
writel_relaxed(data, bank->reg_base + GPIO_SWPORT_DDR);
 
spin_unlock_irqrestore(>slock, flags);
+   clk_disable(bank->clk);
 
return 0;
 }
@@ -1389,6 +1392,7 @@ static void rockchip_gpio_set(struct gpio_chip *gc, 
unsigned offset, int value)
unsigned long flags;
u32 data;
 
+   clk_enable(bank->clk);
spin_lock_irqsave(>slock, flags);
 
data = readl(reg);
@@ -1398,6 +1402,7 @@ static void rockchip_gpio_set(struct gpio_chip *gc, 
unsigned offset, int value)
writel(data, reg);
 
spin_unlock_irqrestore(>slock, flags);
+   clk_disable(bank->clk);
 }
 
 /*
@@ -1409,7 +1414,9 @@ static int rockchip_gpio_get(struct gpio_chip *gc, 
unsigned offset)
struct rockchip_pin_bank *bank = gc_to_pin_bank(gc);
u32 data;
 
+   clk_enable(bank->clk);
data = readl(bank->reg_base + GPIO_EXT_PORT);
+   clk_disable(bank->clk);
data >>= offset;
data &= 1;
return data;
@@ -1546,9 +1553,10 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
if (ret < 0)
return ret;
 
+   clk_enable(bank->clk);
spin_lock_irqsave(>slock, flags);
 
-   data = readl_relaxed(bank->reg_base + GPIO_SWPORT_DDR);
+   data = readl(bank->reg_base + GPIO_SWPORT_DDR);
data &= ~mask;
writel_relaxed(data, bank->reg_base + GPIO_SWPORT_DDR);
 
@@ -1603,6 +1611,7 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
default:
irq_gc_unlock(gc);
spin_unlock_irqrestore(>slock, flags);
+   clk_disable(bank->clk);
return -EINVAL;
}
 
@@ -1611,6 +1620,7 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
 
irq_gc_unlock(gc);
spin_unlock_irqrestore(>slock, flags);
+   clk_disable(bank->clk);
 
return 0;
 }
@@ -1620,8 +1630,10 @@ static void rockchip_irq_suspend(struct irq_data *d)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct rockchip_pin_bank *bank = gc->private;
 
+   clk_enable(bank->clk);
bank->saved_masks = irq_reg_readl(gc, GPIO_INTMASK);
irq_reg_writel(gc, ~gc->wake_active, GPIO_INTMASK);
+   clk_disable(bank->clk);
 }
 
 static void rockchip_irq_resume(struct irq_data *d)
@@ -1629,7 +1641,27 @@ static void rockchip_irq_resume(struct irq_data *d)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct rockchip_pin_bank *bank = gc->private;
 
+   clk_enable(bank->clk);
irq_reg_writel(gc, bank->saved_masks, GPIO_INTMASK);
+   clk_disable(bank->clk);
+}
+
+static void rockchip_irq_gc_mask_clr_bit(struct irq_data *d)
+{
+   struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+   struct rockchip_pin_bank *bank = gc->private;
+
+   clk_enable(bank->clk);
+   irq_gc_mask_clr_bit(d);
+}
+
+void rockchip_irq_gc_mask_set_bit(struct irq_data *d)
+{
+   struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+   struct rockchip_pin_bank *bank = gc->private;
+
+   irq_gc_mask_set_bit(d);
+   clk_disable(bank->clk);
 }
 
 static int rockchip_interrupts_register(struct platform_device *pdev,
@@ -1640,7 +1672,7 @@ static int rockchip_interrupts_register(struct 
platform_device *pdev,
unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
struct irq_chip_generic *gc;
int ret;
-   int i;
+   int i, j;
 
for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
if (!bank->valid) {
@@ -1649,11 +1681,19 @@ static int rockchip_interrupts_register(struct 
platform_device *pdev,
continue;
}
 
+   ret = clk_enable(bank->clk)

[PATCH v1 1/2] clk: rockchip: add pclk_pd_pmu to the list of rk3288 critical clocks

2015-08-02 Thread huang lin
pclk_pd_pmu needs to keep running and with the upcoming gpio clock
handling this is not always the case anymore. So add it to the list
of critical clocks for now.

Signed-off-by: Heiko Stuebner 

Signed-off-by: huang lin 
---
 drivers/clk/rockchip/clk-rk3288.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/rockchip/clk-rk3288.c 
b/drivers/clk/rockchip/clk-rk3288.c
index 0df5bae..9040878 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -780,6 +780,7 @@ static const char *const rk3288_critical_clocks[] 
__initconst = {
"aclk_cpu",
"aclk_peri",
"hclk_peri",
+   "pclk_pd_pmu",
 };
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v1 1/2] clk: rockchip: add pclk_pd_pmu to the list of rk3288 critical clocks

2015-08-02 Thread huang lin
pclk_pd_pmu needs to keep running and with the upcoming gpio clock
handling this is not always the case anymore. So add it to the list
of critical clocks for now.

Signed-off-by: Heiko Stuebner he...@sntech.de

Signed-off-by: huang lin h...@rock-chips.com
---
 drivers/clk/rockchip/clk-rk3288.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/rockchip/clk-rk3288.c 
b/drivers/clk/rockchip/clk-rk3288.c
index 0df5bae..9040878 100644
--- a/drivers/clk/rockchip/clk-rk3288.c
+++ b/drivers/clk/rockchip/clk-rk3288.c
@@ -780,6 +780,7 @@ static const char *const rk3288_critical_clocks[] 
__initconst = {
aclk_cpu,
aclk_peri,
hclk_peri,
+   pclk_pd_pmu,
 };
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v1 2/2] pinctrl: rockchip: only enable gpio clock when it setting

2015-08-02 Thread huang lin
gpio can keep state even the clock disable, for save power
consumption, only enable gpio clock when it setting

Signed-off-by: Heiko Stuebner he...@sntech.de
Signed-off-by: huang lin h...@rock-chips.com

Signed-off-by: huang lin h...@rock-chips.com
---
 drivers/pinctrl/pinctrl-rockchip.c | 60 ++
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c 
b/drivers/pinctrl/pinctrl-rockchip.c
index cc2843a..445829f 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -945,17 +945,20 @@ static int _rockchip_pmx_gpio_set_direction(struct 
gpio_chip *chip,
if (ret  0)
return ret;
 
+   clk_enable(bank-clk);
spin_lock_irqsave(bank-slock, flags);
 
-   data = readl_relaxed(bank-reg_base + GPIO_SWPORT_DDR);
+   data = readl(bank-reg_base + GPIO_SWPORT_DDR);
/* set bit to 1 for output, 0 for input */
if (!input)
data |= BIT(pin);
else
data = ~BIT(pin);
+
writel_relaxed(data, bank-reg_base + GPIO_SWPORT_DDR);
 
spin_unlock_irqrestore(bank-slock, flags);
+   clk_disable(bank-clk);
 
return 0;
 }
@@ -1389,6 +1392,7 @@ static void rockchip_gpio_set(struct gpio_chip *gc, 
unsigned offset, int value)
unsigned long flags;
u32 data;
 
+   clk_enable(bank-clk);
spin_lock_irqsave(bank-slock, flags);
 
data = readl(reg);
@@ -1398,6 +1402,7 @@ static void rockchip_gpio_set(struct gpio_chip *gc, 
unsigned offset, int value)
writel(data, reg);
 
spin_unlock_irqrestore(bank-slock, flags);
+   clk_disable(bank-clk);
 }
 
 /*
@@ -1409,7 +1414,9 @@ static int rockchip_gpio_get(struct gpio_chip *gc, 
unsigned offset)
struct rockchip_pin_bank *bank = gc_to_pin_bank(gc);
u32 data;
 
+   clk_enable(bank-clk);
data = readl(bank-reg_base + GPIO_EXT_PORT);
+   clk_disable(bank-clk);
data = offset;
data = 1;
return data;
@@ -1546,9 +1553,10 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
if (ret  0)
return ret;
 
+   clk_enable(bank-clk);
spin_lock_irqsave(bank-slock, flags);
 
-   data = readl_relaxed(bank-reg_base + GPIO_SWPORT_DDR);
+   data = readl(bank-reg_base + GPIO_SWPORT_DDR);
data = ~mask;
writel_relaxed(data, bank-reg_base + GPIO_SWPORT_DDR);
 
@@ -1603,6 +1611,7 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
default:
irq_gc_unlock(gc);
spin_unlock_irqrestore(bank-slock, flags);
+   clk_disable(bank-clk);
return -EINVAL;
}
 
@@ -1611,6 +1620,7 @@ static int rockchip_irq_set_type(struct irq_data *d, 
unsigned int type)
 
irq_gc_unlock(gc);
spin_unlock_irqrestore(bank-slock, flags);
+   clk_disable(bank-clk);
 
return 0;
 }
@@ -1620,8 +1630,10 @@ static void rockchip_irq_suspend(struct irq_data *d)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct rockchip_pin_bank *bank = gc-private;
 
+   clk_enable(bank-clk);
bank-saved_masks = irq_reg_readl(gc, GPIO_INTMASK);
irq_reg_writel(gc, ~gc-wake_active, GPIO_INTMASK);
+   clk_disable(bank-clk);
 }
 
 static void rockchip_irq_resume(struct irq_data *d)
@@ -1629,7 +1641,27 @@ static void rockchip_irq_resume(struct irq_data *d)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct rockchip_pin_bank *bank = gc-private;
 
+   clk_enable(bank-clk);
irq_reg_writel(gc, bank-saved_masks, GPIO_INTMASK);
+   clk_disable(bank-clk);
+}
+
+static void rockchip_irq_gc_mask_clr_bit(struct irq_data *d)
+{
+   struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+   struct rockchip_pin_bank *bank = gc-private;
+
+   clk_enable(bank-clk);
+   irq_gc_mask_clr_bit(d);
+}
+
+void rockchip_irq_gc_mask_set_bit(struct irq_data *d)
+{
+   struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+   struct rockchip_pin_bank *bank = gc-private;
+
+   irq_gc_mask_set_bit(d);
+   clk_disable(bank-clk);
 }
 
 static int rockchip_interrupts_register(struct platform_device *pdev,
@@ -1640,7 +1672,7 @@ static int rockchip_interrupts_register(struct 
platform_device *pdev,
unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
struct irq_chip_generic *gc;
int ret;
-   int i;
+   int i, j;
 
for (i = 0; i  ctrl-nr_banks; ++i, ++bank) {
if (!bank-valid) {
@@ -1649,11 +1681,19 @@ static int rockchip_interrupts_register(struct 
platform_device *pdev,
continue;
}
 
+   ret = clk_enable(bank-clk);
+   if (ret) {
+   dev_err(pdev-dev, failed to enable clock for bank 
%s\n

[PATCH] phy: rockchip-usb: power down phy when rockchip phy probe

2015-07-17 Thread huang lin
rockchip phy are enable when soc reset, to save power consumption,
we disable it when probe, and enable each phy when it use

Signed-off-by: huang lin 
---
 drivers/phy/phy-rockchip-usb.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c
index 7d4c336..3b92d7f 100644
--- a/drivers/phy/phy-rockchip-usb.c
+++ b/drivers/phy/phy-rockchip-usb.c
@@ -98,6 +98,7 @@ static int rockchip_usb_phy_probe(struct platform_device 
*pdev)
struct device_node *child;
struct regmap *grf;
unsigned int reg_offset;
+   int err;
 
grf = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf");
if (IS_ERR(grf)) {
@@ -129,6 +130,11 @@ static int rockchip_usb_phy_probe(struct platform_device 
*pdev)
return PTR_ERR(rk_phy->phy);
}
phy_set_drvdata(rk_phy->phy, rk_phy);
+
+   /* only power up usb phy when it use, so disable it when init*/
+   err = rockchip_usb_phy_power(rk_phy, 1);
+   if (err)
+   return err;
}
 
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] phy: rockchip-usb: power down phy when rockchip phy probe

2015-07-17 Thread huang lin
rockchip phy are enable when soc reset, to save power consumption,
we disable it when probe, and enable each phy when it use

Signed-off-by: huang lin h...@rock-chips.com
---
 drivers/phy/phy-rockchip-usb.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c
index 7d4c336..3b92d7f 100644
--- a/drivers/phy/phy-rockchip-usb.c
+++ b/drivers/phy/phy-rockchip-usb.c
@@ -98,6 +98,7 @@ static int rockchip_usb_phy_probe(struct platform_device 
*pdev)
struct device_node *child;
struct regmap *grf;
unsigned int reg_offset;
+   int err;
 
grf = syscon_regmap_lookup_by_phandle(dev-of_node, rockchip,grf);
if (IS_ERR(grf)) {
@@ -129,6 +130,11 @@ static int rockchip_usb_phy_probe(struct platform_device 
*pdev)
return PTR_ERR(rk_phy-phy);
}
phy_set_drvdata(rk_phy-phy, rk_phy);
+
+   /* only power up usb phy when it use, so disable it when init*/
+   err = rockchip_usb_phy_power(rk_phy, 1);
+   if (err)
+   return err;
}
 
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5] drm/panel: Add support for AUO b101ean01 panel

2015-02-27 Thread huang lin
The AUO b101ean01 panel is a 10.1" 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin 

---

Changes in v5:
- increase the vsync time

 .../devicetree/bindings/panel/auo,b101ean01.txt|  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b101ean01.txt

diff --git a/Documentation/devicetree/bindings/panel/auo,b101ean01.txt 
b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
new file mode 100644
index 000..3590b07
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
@@ -0,0 +1,7 @@
+AU Optronics Corporation 10.1" WSVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "auo,b101ean01"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..375812b 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 119,
+   .hsync_end = 1280 + 119 + 32,
+   .htotal = 1280 + 119 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 20,
+   .vtotal = 800 + 4 + 20 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = _b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "auo,b101aw03",
.data = _b101aw03,
}, {
+   .compatible = "auo,b101ean01",
+   .data = _b101ean01,
+   }, {
.compatible = "auo,b101xtn01",
.data = _b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5] drm/panel: Add support for AUO b101ean01 panel

2015-02-27 Thread huang lin
The AUO b101ean01 panel is a 10.1 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin h...@rock-chips.com

---

Changes in v5:
- increase the vsync time

 .../devicetree/bindings/panel/auo,b101ean01.txt|  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b101ean01.txt

diff --git a/Documentation/devicetree/bindings/panel/auo,b101ean01.txt 
b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
new file mode 100644
index 000..3590b07
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
@@ -0,0 +1,7 @@
+AU Optronics Corporation 10.1 WSVGA TFT LCD panel
+
+Required properties:
+- compatible: should be auo,b101ean01
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..375812b 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 119,
+   .hsync_end = 1280 + 119 + 32,
+   .htotal = 1280 + 119 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 20,
+   .vtotal = 800 + 4 + 20 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = auo_b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = auo,b101aw03,
.data = auo_b101aw03,
}, {
+   .compatible = auo,b101ean01,
+   .data = auo_b101ean01,
+   }, {
.compatible = auo,b101xtn01,
.data = auo_b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] backlight: pwm: Add backlight-boot-off property

2015-02-25 Thread huang lin

Add backlight-boot-off property, so we can keeping the
backlight disabled at boot until it is enabled implicitly
by a panel driver, or explicitly by userspace



huang lin (2):
  Documentation: devicetree: add backlight-boot-off property in
pwm-backlight
  backlight: pwm: Add backlight-boot-off property

 Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 +
 drivers/video/backlight/pwm_bl.c| 4 
 2 files changed, 5 insertions(+)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Documentation: devicetree: add backlight-boot-off property in pwm-backlight

2015-02-25 Thread huang lin
Add the backlight-boot-ff property, so we can keeping the backlight
disabled at boot until it is enabled implicitly by a panel driver,
or explicitly by userspace.

Signed-off-by: huang lin 

---

 Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt 
b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
index 764db86..28b0b4d 100644
--- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
+++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
@@ -17,6 +17,7 @@ Optional properties:
"pwms" property (see PWM binding[0])
   - enable-gpios: contains a single GPIO specifier for the GPIO which enables
   and disables the backlight (see GPIO binding[1])
+  - backlight-boot-off: turn off backlight when pwm backlight probe
 
 [0]: Documentation/devicetree/bindings/pwm/pwm.txt
 [1]: Documentation/devicetree/bindings/gpio/gpio.txt
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] backlight: pwm: Add backlight-boot-off property

2015-02-25 Thread huang lin

Add backlight-boot-off property, so we can keeping the
backlight disabled at boot until it is enabled implicitly
by a panel driver, or explicitly by userspace



huang lin (2):
  Documentation: devicetree: add backlight-boot-off property in
pwm-backlight
  backlight: pwm: Add backlight-boot-off property

 Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 +
 drivers/video/backlight/pwm_bl.c| 4 
 2 files changed, 5 insertions(+)

-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Documentation: devicetree: add backlight-boot-off property in pwm-backlight

2015-02-25 Thread huang lin
Add the backlight-boot-ff property, so we can keeping the backlight
disabled at boot until it is enabled implicitly by a panel driver,
or explicitly by userspace.

Signed-off-by: huang lin h...@rock-chips.com

---

 Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt 
b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
index 764db86..28b0b4d 100644
--- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
+++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
@@ -17,6 +17,7 @@ Optional properties:
pwms property (see PWM binding[0])
   - enable-gpios: contains a single GPIO specifier for the GPIO which enables
   and disables the backlight (see GPIO binding[1])
+  - backlight-boot-off: turn off backlight when pwm backlight probe
 
 [0]: Documentation/devicetree/bindings/pwm/pwm.txt
 [1]: Documentation/devicetree/bindings/gpio/gpio.txt
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4] drm/panel: Add support for AUO b101ean01 panel

2015-01-25 Thread huang lin
The AUO b101ean01 panel is a 10.1" 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin 

---

Changes in v4:
- Add auo,b101ean01.txt file

 .../devicetree/bindings/panel/auo,b101ean01.txt|  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b101ean01.txt

diff --git a/Documentation/devicetree/bindings/panel/auo,b101ean01.txt 
b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
new file mode 100644
index 000..3590b07
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
@@ -0,0 +1,7 @@
+AU Optronics Corporation 10.1" WSVGA TFT LCD panel
+
+Required properties:
+- compatible: should be "auo,b101ean01"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..24828e0 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = _b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "auo,b101aw03",
.data = _b101aw03,
}, {
+   .compatible = "auo,b101ean01",
+   .data = _b101ean01,
+   }, {
.compatible = "auo,b101xtn01",
.data = _b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4] drm/panel: Add support for AUO b101ean01 panel

2015-01-25 Thread huang lin
The AUO b101ean01 panel is a 10.1 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin h...@rock-chips.com

---

Changes in v4:
- Add auo,b101ean01.txt file

 .../devicetree/bindings/panel/auo,b101ean01.txt|  7 ++
 drivers/gpu/drm/panel/panel-simple.c   | 26 ++
 2 files changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/auo,b101ean01.txt

diff --git a/Documentation/devicetree/bindings/panel/auo,b101ean01.txt 
b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
new file mode 100644
index 000..3590b07
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/auo,b101ean01.txt
@@ -0,0 +1,7 @@
+AU Optronics Corporation 10.1 WSVGA TFT LCD panel
+
+Required properties:
+- compatible: should be auo,b101ean01
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..24828e0 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = auo_b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = auo,b101aw03,
.data = auo_b101aw03,
}, {
+   .compatible = auo,b101ean01,
+   .data = auo_b101ean01,
+   }, {
.compatible = auo,b101xtn01,
.data = auo_b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] drm/panel: Add support for AUO b101ean01 panel

2015-01-15 Thread huang lin
The AUO b101ean01 panel is a 10.1" 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin 

---

Changes in v3:
- changed moving auo_b101ean01 definitions under auo_b101aw03

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..24828e0 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = _b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "auo,b101aw03",
.data = _b101aw03,
}, {
+   .compatible = "auo,b101ean01",
+   .data = _b101ean01,
+   }, {
.compatible = "auo,b101xtn01",
.data = _b101xtn01,
}, {
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] drm/panel: Add support for AUO b101ean01 panel

2015-01-15 Thread huang lin
The AUO b101ean01 panel is a 10.1 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin h...@rock-chips.com

---

Changes in v3:
- changed moving auo_b101ean01 definitions under auo_b101aw03

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..24828e0 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -345,6 +345,29 @@ static const struct panel_desc auo_b101aw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = auo_b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b101xtn01_mode = {
.clock = 72000,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = auo,b101aw03,
.data = auo_b101aw03,
}, {
+   .compatible = auo,b101ean01,
+   .data = auo_b101ean01,
+   }, {
.compatible = auo,b101xtn01,
.data = auo_b101xtn01,
}, {
-- 
1.9.1


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] drm/panel: Add support for AUO b101ean01 panel

2015-01-14 Thread huang lin
The AUO b101ean01 panel is a 10.1" 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin 

---

Changes in v2:
- changed panel timing

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..c02f0e6 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -392,6 +392,29 @@ static const struct panel_desc auo_b116xw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = _b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b133xtn01_mode = {
.clock = 69500,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "auo,b101aw03",
.data = _b101aw03,
}, {
+   .compatible = "auo,b101ean01",
+   .data = _b101ean01,
+   }, {
.compatible = "auo,b101xtn01",
.data = _b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] drm/panel: Add support for AUO b101ean01 panel

2015-01-14 Thread huang lin
The AUO b101ean01 panel is a 10.1 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin h...@rock-chips.com

---

Changes in v2:
- changed panel timing

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..c02f0e6 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -392,6 +392,29 @@ static const struct panel_desc auo_b116xw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 147,
+   .hsync_end = 1280 + 147 + 32,
+   .htotal = 1280 + 147 + 32 + 21,
+   .vdisplay = 800,
+   .vsync_start = 800 + 4,
+   .vsync_end = 800 + 4 + 4,
+   .vtotal = 800 + 4 + 4 + 8,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = auo_b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 217,
+   .height = 136,
+   },
+};
+
 static const struct drm_display_mode auo_b133xtn01_mode = {
.clock = 69500,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = auo,b101aw03,
.data = auo_b101aw03,
}, {
+   .compatible = auo,b101ean01,
+   .data = auo_b101ean01,
+   }, {
.compatible = auo,b101xtn01,
.data = auo_b101xtn01,
}, {
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drm/panel: Add support for AUO b101ean01 panel

2015-01-08 Thread huang lin
The AUO b101ean01 panel is a 10.1" 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin 

---

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..4f2baee 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -392,6 +392,29 @@ static const struct panel_desc auo_b116xw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 200,
+   .hsync_end = 1280 + 200 + 147,
+   .htotal = 1280 + 200 + 147 + 32,
+   .vdisplay = 800,
+   .vsync_start = 800 + 16,
+   .vsync_end = 800 + 16 + 4,
+   .vtotal = 800 + 16 + 4 + 4,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = _b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 228,
+   .height = 148,
+   },
+};
+
 static const struct drm_display_mode auo_b133xtn01_mode = {
.clock = 69500,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "auo,b101aw03",
.data = _b101aw03,
}, {
+   .compatible = "auo,b101ean01",
+   .data = _b101ean01,
+   }, {
.compatible = "auo,b101xtn01",
.data = _b101xtn01,
}, {
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drm/panel: Add support for AUO b101ean01 panel

2015-01-08 Thread huang lin
The AUO b101ean01 panel is a 10.1 1280x800 panel,
which can be supported by the simple panel driver.

Signed-off-by: huang lin h...@rock-chips.com

---

 drivers/gpu/drm/panel/panel-simple.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index e95385b..4f2baee 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -392,6 +392,29 @@ static const struct panel_desc auo_b116xw03 = {
},
 };
 
+static const struct drm_display_mode auo_b101ean01_mode = {
+   .clock = 72500,
+   .hdisplay = 1280,
+   .hsync_start = 1280 + 200,
+   .hsync_end = 1280 + 200 + 147,
+   .htotal = 1280 + 200 + 147 + 32,
+   .vdisplay = 800,
+   .vsync_start = 800 + 16,
+   .vsync_end = 800 + 16 + 4,
+   .vtotal = 800 + 16 + 4 + 4,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc auo_b101ean01 = {
+   .modes = auo_b101ean01_mode,
+   .num_modes = 1,
+   .bpc = 6,
+   .size = {
+   .width = 228,
+   .height = 148,
+   },
+};
+
 static const struct drm_display_mode auo_b133xtn01_mode = {
.clock = 69500,
.hdisplay = 1366,
@@ -727,6 +750,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = auo,b101aw03,
.data = auo_b101aw03,
}, {
+   .compatible = auo,b101ean01,
+   .data = auo_b101ean01,
+   }, {
.compatible = auo,b101xtn01,
.data = auo_b101xtn01,
}, {
-- 
1.9.1


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/