linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/3] Add MediaTek display PWM driver
@ 2015-08-18  7:27 YH Huang
  2015-08-18  7:27 ` [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings YH Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: YH Huang @ 2015-08-18  7:27 UTC (permalink / raw)
  To: Matthias Brugger, Mark Rutland, Thierry Reding
  Cc: Rob Herring, Pawel Moll, linux-pwm, devicetree, linux-kernel,
	linux-arm-kernel, srv_heupstream, linux-mediatek, Sascha Hauer,
	yingjoe.chen

This patch series add the use of display PWM driver, documentation 
and device tree for Mediatek SoCs. The driver is used to support 
the backlight of the panel. This is based on v4.2-rc1.

The clock definitions (CLK_MM_DISP_PWM*) are added by James Liao's patch: 
clk: mediatek: Add subsystem clocks of MT8173

Change in v7:
1. Add the dependency HAS_IOMEM in Kconfig.
2. Revise misprints and coding style for readability.

Change in v6:
1. Enable clocks in the pwm_enable function.
2. Remove suspend/resume code since pwm-backlight driver has done the
same things.
3. Revise some code to make it easier to read.

Change in v5:
1. Configure PWM output via pinctrl.
2. Fix the parameter name in dtsi.

Change in v4:
1. Codebase is on v4.2-rc1.
2. Add the PWM node in dtsi.
3. Change the dependency in Kconfig.
4. Rewrite some code for readability.

Change in v3:
1. Add suspend/resume function.
2. Fix the formula for high_width calculation.
3. Rewrite some code to make it easier to read.
4. Add more information in the commit message.

Change in v2:
1. Rewrite descriptions for driver in kconfig to make it much clear.
2. Rename the driver from "pwm-mediatek-disp" to "pwm-mtk-disp".
3. Disable clocks in the error path.
4. Change the shift values in decimal instead of hex.
5. Rename and add some variables or function name for consistency and
readability.
6. Drop unnecessary parentheses, spaces, variables and add newlines to
make the code easiler to read.

YH Huang (3):
  dt-bindings: pwm: add MediaTek display PWM bindings
  pwm: add MediaTek display PWM driver support
  arm64: dts: mt8173: add MT8173 display PWM driver support node

 .../devicetree/bindings/pwm/pwm-mtk-disp.txt       |   42 ++++
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts        |   13 ++
 arch/arm64/boot/dts/mediatek/mt8173.dtsi           |   22 ++
 drivers/pwm/Kconfig                                |   11 +
 drivers/pwm/Makefile                               |    1 +
 drivers/pwm/pwm-mtk-disp.c                         |  232 ++++++++++++++++++++
 6 files changed, 321 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt
 create mode 100644 drivers/pwm/pwm-mtk-disp.c

--
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings
  2015-08-18  7:27 [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
@ 2015-08-18  7:27 ` YH Huang
  2015-10-05 15:58   ` Thierry Reding
  2015-08-18  7:27 ` [PATCH v7 2/3] pwm: add MediaTek display PWM driver support YH Huang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: YH Huang @ 2015-08-18  7:27 UTC (permalink / raw)
  To: Matthias Brugger, Mark Rutland, Thierry Reding
  Cc: Rob Herring, Pawel Moll, linux-pwm, devicetree, linux-kernel,
	linux-arm-kernel, srv_heupstream, linux-mediatek, Sascha Hauer,
	yingjoe.chen, YH Huang

Document the device-tree binding of MediaTek display PWM.
The PWM has one channel to control the backlight brightness for display.
It supports MT8173 and MT6595.

Signed-off-by: YH Huang <yh.huang@mediatek.com>
---
 .../devicetree/bindings/pwm/pwm-mtk-disp.txt       |   42 ++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt

diff --git a/Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt b/Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt
new file mode 100644
index 0000000..f8f59ba
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt
@@ -0,0 +1,42 @@
+MediaTek display PWM controller
+
+Required properties:
+ - compatible: should be "mediatek,<name>-disp-pwm":
+   - "mediatek,mt8173-disp-pwm": found on mt8173 SoC.
+   - "mediatek,mt6595-disp-pwm": found on mt6595 SoC.
+ - reg: physical base address and length of the controller's registers.
+ - #pwm-cells: must be 2. See pwm.txt in this directory for a description of
+   the cell format.
+ - clocks: phandle and clock specifier of the PWM reference clock.
+ - clock-names: must contain the following:
+   - "main": clock used to generate PWM signals.
+   - "mm": sync signals from the modules of mmsys.
+ - pinctrl-names: Must contain a "default" entry.
+ - pinctrl-0: One property must exist for each entry in pinctrl-names.
+   See pinctrl/pinctrl-bindings.txt for details of the property values.
+
+Example:
+	pwm0: pwm@1401e000 {
+		compatible = "mediatek,mt8173-disp-pwm",
+			     "mediatek,mt6595-disp-pwm";
+		reg = <0 0x1401e000 0 0x1000>;
+		#pwm-cells = <2>;
+		clocks = <&mmsys CLK_MM_DISP_PWM026M>,
+			 <&mmsys CLK_MM_DISP_PWM0MM>;
+		clock-names = "main", "mm";
+		pinctrl-names = "default";
+		pinctrl-0 = <&disp_pwm0_pins>;
+	};
+
+	backlight_lcd: backlight_lcd {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 1000000>;
+		brightness-levels = <
+			  0  16  32  48  64  80  96 112
+			128 144 160 176 192 208 224 240
+			255
+		>;
+		default-brightness-level = <9>;
+		power-supply = <&mt6397_vio18_reg>;
+		enable-gpios = <&pio 95 GPIO_ACTIVE_HIGH>;
+	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v7 2/3] pwm: add MediaTek display PWM driver support
  2015-08-18  7:27 [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
  2015-08-18  7:27 ` [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings YH Huang
@ 2015-08-18  7:27 ` YH Huang
  2015-10-05 15:59   ` Thierry Reding
  2015-08-18  7:27 ` [PATCH v7 3/3] arm64: dts: mt8173: add MT8173 display PWM driver support node YH Huang
  2015-09-15  3:52 ` [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
  3 siblings, 1 reply; 7+ messages in thread
From: YH Huang @ 2015-08-18  7:27 UTC (permalink / raw)
  To: Matthias Brugger, Mark Rutland, Thierry Reding
  Cc: Rob Herring, Pawel Moll, linux-pwm, devicetree, linux-kernel,
	linux-arm-kernel, srv_heupstream, linux-mediatek, Sascha Hauer,
	yingjoe.chen, YH Huang

Add display PWM driver support to modify backlight for MT8173 and MT6595.
The PWM has one channel to control the brightness of the display.
When the (high_width / period) is closer to 1, the screen is brighter;
otherwise, it is darker.

Signed-off-by: YH Huang <yh.huang@mediatek.com>
---
 drivers/pwm/Kconfig        |   11 +++
 drivers/pwm/Makefile       |    1 +
 drivers/pwm/pwm-mtk-disp.c |  232 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 244 insertions(+)
 create mode 100644 drivers/pwm/pwm-mtk-disp.c

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index b1541f4..24acd8f 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -211,6 +211,17 @@ config PWM_LPSS_PLATFORM
 	  To compile this driver as a module, choose M here: the module
 	  will be called pwm-lpss-platform.
 
+config PWM_MTK_DISP
+	tristate "MediaTek display PWM driver"
+	depends on ARCH_MEDIATEK || COMPILE_TEST
+	depends on HAS_IOMEM
+	help
+	  Generic PWM framework driver for MediaTek disp-pwm device.
+	  The PWM is used to control the backlight brightness for display.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called pwm-mtk-disp.
+
 config PWM_MXS
 	tristate "Freescale MXS PWM support"
 	depends on ARCH_MXS && OF
diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile
index ec50eb5..99c9e75 100644
--- a/drivers/pwm/Makefile
+++ b/drivers/pwm/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_PWM_LPC32XX)	+= pwm-lpc32xx.o
 obj-$(CONFIG_PWM_LPSS)		+= pwm-lpss.o
 obj-$(CONFIG_PWM_LPSS_PCI)	+= pwm-lpss-pci.o
 obj-$(CONFIG_PWM_LPSS_PLATFORM)	+= pwm-lpss-platform.o
+obj-$(CONFIG_PWM_MTK_DISP)	+= pwm-mtk-disp.o
 obj-$(CONFIG_PWM_MXS)		+= pwm-mxs.o
 obj-$(CONFIG_PWM_PCA9685)	+= pwm-pca9685.o
 obj-$(CONFIG_PWM_PUV3)		+= pwm-puv3.o
diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c
new file mode 100644
index 0000000..90aea6f
--- /dev/null
+++ b/drivers/pwm/pwm-mtk-disp.c
@@ -0,0 +1,232 @@
+/*
+ * MediaTek display pulse-width-modulation controller driver.
+ * Copyright (c) 2015 MediaTek Inc.
+ * Author: YH Huang <yh.huang@mediatek.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/pwm.h>
+#include <linux/slab.h>
+
+#define DISP_PWM_EN		0x00
+#define PWM_ENABLE_MASK		BIT(0)
+
+#define DISP_PWM_COMMIT		0x08
+#define PWM_COMMIT_MASK		BIT(0)
+
+#define DISP_PWM_CON_0		0x10
+#define PWM_CLKDIV_SHIFT	16
+#define PWM_CLKDIV_MAX		0x3ff
+#define PWM_CLKDIV_MASK		(PWM_CLKDIV_MAX << PWM_CLKDIV_SHIFT)
+
+#define DISP_PWM_CON_1		0x14
+#define PWM_PERIOD_BIT_WIDTH	12
+#define PWM_PERIOD_MASK		((1 << PWM_PERIOD_BIT_WIDTH) - 1)
+
+#define PWM_HIGH_WIDTH_SHIFT	16
+#define PWM_HIGH_WIDTH_MASK	(0x1fff << PWM_HIGH_WIDTH_SHIFT)
+
+struct mtk_disp_pwm {
+	struct pwm_chip chip;
+	struct clk *clk_main;
+	struct clk *clk_mm;
+	void __iomem *base;
+};
+
+static inline struct mtk_disp_pwm *to_mtk_disp_pwm(struct pwm_chip *chip)
+{
+	return container_of(chip, struct mtk_disp_pwm, chip);
+}
+
+static void mtk_disp_pwm_update_bits(struct mtk_disp_pwm *mdp, u32 offset,
+				     u32 mask, u32 value)
+{
+	void __iomem *address;
+	u32 val;
+
+	address = mdp->base + offset;
+	val = readl(address);
+	val &= ~mask;
+	val |= value;
+	writel(val, address);
+}
+
+static int mtk_disp_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
+			       int duty_ns, int period_ns)
+{
+	struct mtk_disp_pwm *mdp = to_mtk_disp_pwm(chip);
+	u64 div, rate;
+	u32 clk_div, period, high_width, value;
+
+	/*
+	 * Find period, high_width and clk_div to suit duty_ns and period_ns.
+	 * Calculate proper div value to keep period value in the bound.
+	 *
+	 * period_ns = 10^9 * (clk_div + 1) * (period + 1) / PWM_CLK_RATE
+	 * duty_ns = 10^9 * (clk_div + 1) * high_width / PWM_CLK_RATE
+	 *
+	 * period = (PWM_CLK_RATE * period_ns) / (10^9 * (clk_div + 1)) - 1
+	 * high_width = (PWM_CLK_RATE * duty_ns) / (10^9 * (clk_div + 1))
+	 */
+	rate = clk_get_rate(mdp->clk_main);
+	clk_div = div_u64(rate * period_ns, NSEC_PER_SEC) >>
+			  PWM_PERIOD_BIT_WIDTH;
+	if (clk_div > PWM_CLKDIV_MAX)
+		return -EINVAL;
+
+	div = NSEC_PER_SEC * (clk_div + 1);
+	period = div64_u64(rate * period_ns, div);
+	if (period > 0)
+		period--;
+
+	high_width = div64_u64(rate * duty_ns, div);
+	value = period | (high_width << PWM_HIGH_WIDTH_SHIFT);
+
+	clk_enable(mdp->clk_main);
+	clk_enable(mdp->clk_mm);
+
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_CON_0,
+				 PWM_CLKDIV_MASK, clk_div << PWM_CLKDIV_SHIFT);
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_CON_1,
+				 PWM_PERIOD_MASK | PWM_HIGH_WIDTH_MASK, value);
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_COMMIT,
+				 PWM_COMMIT_MASK, 1);
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_COMMIT,
+				 PWM_COMMIT_MASK, 0);
+
+	clk_disable(mdp->clk_mm);
+	clk_disable(mdp->clk_main);
+
+	return 0;
+}
+
+static int mtk_disp_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+	struct mtk_disp_pwm *mdp = to_mtk_disp_pwm(chip);
+
+	clk_enable(mdp->clk_main);
+	clk_enable(mdp->clk_mm);
+
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_EN,
+				 PWM_ENABLE_MASK, 1);
+
+	return 0;
+}
+
+static void mtk_disp_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+{
+	struct mtk_disp_pwm *mdp = to_mtk_disp_pwm(chip);
+
+	mtk_disp_pwm_update_bits(mdp, DISP_PWM_EN,
+				 PWM_ENABLE_MASK, 0);
+
+	clk_disable(mdp->clk_mm);
+	clk_disable(mdp->clk_main);
+}
+
+static const struct pwm_ops mtk_disp_pwm_ops = {
+	.config = mtk_disp_pwm_config,
+	.enable = mtk_disp_pwm_enable,
+	.disable = mtk_disp_pwm_disable,
+	.owner = THIS_MODULE,
+};
+
+static int mtk_disp_pwm_probe(struct platform_device *pdev)
+{
+	struct mtk_disp_pwm *mdp;
+	struct resource *r;
+	int ret;
+
+	mdp = devm_kzalloc(&pdev->dev, sizeof(*mdp), GFP_KERNEL);
+	if (!mdp)
+		return -ENOMEM;
+
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	mdp->base = devm_ioremap_resource(&pdev->dev, r);
+	if (IS_ERR(mdp->base))
+		return PTR_ERR(mdp->base);
+
+	mdp->clk_main = devm_clk_get(&pdev->dev, "main");
+	if (IS_ERR(mdp->clk_main))
+		return PTR_ERR(mdp->clk_main);
+
+	mdp->clk_mm = devm_clk_get(&pdev->dev, "mm");
+	if (IS_ERR(mdp->clk_mm))
+		return PTR_ERR(mdp->clk_mm);
+
+	ret = clk_prepare(mdp->clk_main);
+	if (ret < 0)
+		return ret;
+
+	ret = clk_prepare(mdp->clk_mm);
+	if (ret < 0)
+		goto disable_clk_main;
+
+	mdp->chip.dev = &pdev->dev;
+	mdp->chip.ops = &mtk_disp_pwm_ops;
+	mdp->chip.base = -1;
+	mdp->chip.npwm = 1;
+
+	ret = pwmchip_add(&mdp->chip);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
+		goto disable_clk_mm;
+	}
+
+	platform_set_drvdata(pdev, mdp);
+
+	return 0;
+
+disable_clk_mm:
+	clk_unprepare(mdp->clk_mm);
+disable_clk_main:
+	clk_unprepare(mdp->clk_main);
+	return ret;
+}
+
+static int mtk_disp_pwm_remove(struct platform_device *pdev)
+{
+	struct mtk_disp_pwm *mdp = platform_get_drvdata(pdev);
+	int ret;
+
+	ret = pwmchip_remove(&mdp->chip);
+	clk_unprepare(mdp->clk_mm);
+	clk_unprepare(mdp->clk_main);
+
+	return ret;
+}
+
+static const struct of_device_id mtk_disp_pwm_of_match[] = {
+	{ .compatible = "mediatek,mt8173-disp-pwm" },
+	{ .compatible = "mediatek,mt6595-disp-pwm" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, mtk_disp_pwm_of_match);
+
+static struct platform_driver mtk_disp_pwm_driver = {
+	.driver = {
+		.name = "mediatek-disp-pwm",
+		.of_match_table = mtk_disp_pwm_of_match,
+	},
+	.probe = mtk_disp_pwm_probe,
+	.remove = mtk_disp_pwm_remove,
+};
+module_platform_driver(mtk_disp_pwm_driver);
+
+MODULE_AUTHOR("YH Huang <yh.huang@mediatek.com>");
+MODULE_DESCRIPTION("MediaTek SoC display PWM driver");
+MODULE_LICENSE("GPL v2");
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v7 3/3] arm64: dts: mt8173: add MT8173 display PWM driver support node
  2015-08-18  7:27 [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
  2015-08-18  7:27 ` [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings YH Huang
  2015-08-18  7:27 ` [PATCH v7 2/3] pwm: add MediaTek display PWM driver support YH Huang
@ 2015-08-18  7:27 ` YH Huang
  2015-09-15  3:52 ` [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
  3 siblings, 0 replies; 7+ messages in thread
From: YH Huang @ 2015-08-18  7:27 UTC (permalink / raw)
  To: Matthias Brugger, Mark Rutland, Thierry Reding
  Cc: Rob Herring, Pawel Moll, linux-pwm, devicetree, linux-kernel,
	linux-arm-kernel, srv_heupstream, linux-mediatek, Sascha Hauer,
	yingjoe.chen, YH Huang

Add display PWM node in mt8173-evb.dts and mt8173.dtsi.

Signed-off-by: YH Huang <yh.huang@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts |   13 +++++++++++++
 arch/arm64/boot/dts/mediatek/mt8173.dtsi    |   22 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
index 4be66ca..de95cf3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
@@ -92,6 +92,13 @@
 };
 
 &pio {
+	disp_pwm0_pins: disp_pwm0_pins {
+		pins1 {
+			pinmux = <MT8173_PIN_87_DISP_PWM0__FUNC_DISP_PWM0>;
+			output-low;
+		};
+	};
+
 	mmc0_pins_default: mmc0default {
 		pins_cmd_dat {
 			pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
@@ -190,6 +197,12 @@
 	};
 };
 
+&pwm0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&disp_pwm0_pins>;
+	status = "okay";
+};
+
 &pwrap {
 	pmic: mt6397 {
 		compatible = "mediatek,mt6397";
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 6c3f047..68b1ef0 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -501,6 +501,28 @@
 			#clock-cells = <1>;
 		};
 
+		pwm0: pwm@1401e000 {
+			compatible = "mediatek,mt8173-disp-pwm",
+				     "mediatek,mt6595-disp-pwm";
+			reg = <0 0x1401e000 0 0x1000>;
+			#pwm-cells = <2>;
+			clocks = <&mmsys CLK_MM_DISP_PWM026M>,
+				 <&mmsys CLK_MM_DISP_PWM0MM>;
+			clock-names = "main", "mm";
+			status = "disabled";
+		};
+
+		pwm1: pwm@1401f000 {
+			compatible = "mediatek,mt8173-disp-pwm",
+				     "mediatek,mt6595-disp-pwm";
+			reg = <0 0x1401f000 0 0x1000>;
+			#pwm-cells = <2>;
+			clocks = <&mmsys CLK_MM_DISP_PWM126M>,
+				 <&mmsys CLK_MM_DISP_PWM1MM>;
+			clock-names = "main", "mm";
+			status = "disabled";
+		};
+
 		imgsys: clock-controller@15000000 {
 			compatible = "mediatek,mt8173-imgsys", "syscon";
 			reg = <0 0x15000000 0 0x1000>;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v7 0/3] Add MediaTek display PWM driver
  2015-08-18  7:27 [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
                   ` (2 preceding siblings ...)
  2015-08-18  7:27 ` [PATCH v7 3/3] arm64: dts: mt8173: add MT8173 display PWM driver support node YH Huang
@ 2015-09-15  3:52 ` YH Huang
  3 siblings, 0 replies; 7+ messages in thread
From: YH Huang @ 2015-09-15  3:52 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Matthias Brugger, Mark Rutland, linux-pwm, srv_heupstream,
	Pawel Moll, devicetree, linux-kernel, Rob Herring,
	linux-mediatek, Sascha Hauer,
	Yingjoe Chen (陳英洲),
	linux-arm-kernel

On Tue, 2015-08-18 at 15:27 +0800, YH Huang wrote:
> This patch series add the use of display PWM driver, documentation
> and device tree for Mediatek SoCs. The driver is used to support
> the backlight of the panel. This is based on v4.2-rc1.
> 
> The clock definitions (CLK_MM_DISP_PWM*) are added by James Liao's patch:
> clk: mediatek: Add subsystem clocks of MT8173
> 
> Change in v7:
> 1. Add the dependency HAS_IOMEM in Kconfig.
> 2. Revise misprints and coding style for readability.
> 
> Change in v6:
> 1. Enable clocks in the pwm_enable function.
> 2. Remove suspend/resume code since pwm-backlight driver has done the
> same things.
> 3. Revise some code to make it easier to read.
> 
> Change in v5:
> 1. Configure PWM output via pinctrl.
> 2. Fix the parameter name in dtsi.
> 
> Change in v4:
> 1. Codebase is on v4.2-rc1.
> 2. Add the PWM node in dtsi.
> 3. Change the dependency in Kconfig.
> 4. Rewrite some code for readability.
> 
> Change in v3:
> 1. Add suspend/resume function.
> 2. Fix the formula for high_width calculation.
> 3. Rewrite some code to make it easier to read.
> 4. Add more information in the commit message.
> 
> Change in v2:
> 1. Rewrite descriptions for driver in kconfig to make it much clear.
> 2. Rename the driver from "pwm-mediatek-disp" to "pwm-mtk-disp".
> 3. Disable clocks in the error path.
> 4. Change the shift values in decimal instead of hex.
> 5. Rename and add some variables or function name for consistency and
> readability.
> 6. Drop unnecessary parentheses, spaces, variables and add newlines to
> make the code easiler to read.
> 
> YH Huang (3):
>   dt-bindings: pwm: add MediaTek display PWM bindings
>   pwm: add MediaTek display PWM driver support
>   arm64: dts: mt8173: add MT8173 display PWM driver support node
> 
>  .../devicetree/bindings/pwm/pwm-mtk-disp.txt       |   42 ++++
>  arch/arm64/boot/dts/mediatek/mt8173-evb.dts        |   13 ++
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi           |   22 ++
>  drivers/pwm/Kconfig                                |   11 +
>  drivers/pwm/Makefile                               |    1 +
>  drivers/pwm/pwm-mtk-disp.c                         |  232 ++++++++++++++++++++
>  6 files changed, 321 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt
>  create mode 100644 drivers/pwm/pwm-mtk-disp.c
> 
> --
> 1.7.9.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Hi Thierry,

Will you please pick up these patches in your pwm tree?
Should I rebase to 4.3-rc1?

Regards,
YH Huang


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings
  2015-08-18  7:27 ` [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings YH Huang
@ 2015-10-05 15:58   ` Thierry Reding
  0 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2015-10-05 15:58 UTC (permalink / raw)
  To: YH Huang
  Cc: Matthias Brugger, Mark Rutland, Rob Herring, Pawel Moll,
	linux-pwm, devicetree, linux-kernel, linux-arm-kernel,
	srv_heupstream, linux-mediatek, Sascha Hauer, yingjoe.chen

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Tue, Aug 18, 2015 at 03:27:53PM +0800, YH Huang wrote:
> Document the device-tree binding of MediaTek display PWM.
> The PWM has one channel to control the backlight brightness for display.
> It supports MT8173 and MT6595.
> 
> Signed-off-by: YH Huang <yh.huang@mediatek.com>
> ---
>  .../devicetree/bindings/pwm/pwm-mtk-disp.txt       |   42 ++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/pwm-mtk-disp.txt

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v7 2/3] pwm: add MediaTek display PWM driver support
  2015-08-18  7:27 ` [PATCH v7 2/3] pwm: add MediaTek display PWM driver support YH Huang
@ 2015-10-05 15:59   ` Thierry Reding
  0 siblings, 0 replies; 7+ messages in thread
From: Thierry Reding @ 2015-10-05 15:59 UTC (permalink / raw)
  To: YH Huang
  Cc: Matthias Brugger, Mark Rutland, Rob Herring, Pawel Moll,
	linux-pwm, devicetree, linux-kernel, linux-arm-kernel,
	srv_heupstream, linux-mediatek, Sascha Hauer, yingjoe.chen

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

On Tue, Aug 18, 2015 at 03:27:54PM +0800, YH Huang wrote:
> Add display PWM driver support to modify backlight for MT8173 and MT6595.
> The PWM has one channel to control the brightness of the display.
> When the (high_width / period) is closer to 1, the screen is brighter;
> otherwise, it is darker.
> 
> Signed-off-by: YH Huang <yh.huang@mediatek.com>
> ---
>  drivers/pwm/Kconfig        |   11 +++
>  drivers/pwm/Makefile       |    1 +
>  drivers/pwm/pwm-mtk-disp.c |  232 ++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 244 insertions(+)
>  create mode 100644 drivers/pwm/pwm-mtk-disp.c

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-05 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18  7:27 [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang
2015-08-18  7:27 ` [PATCH v7 1/3] dt-bindings: pwm: add MediaTek display PWM bindings YH Huang
2015-10-05 15:58   ` Thierry Reding
2015-08-18  7:27 ` [PATCH v7 2/3] pwm: add MediaTek display PWM driver support YH Huang
2015-10-05 15:59   ` Thierry Reding
2015-08-18  7:27 ` [PATCH v7 3/3] arm64: dts: mt8173: add MT8173 display PWM driver support node YH Huang
2015-09-15  3:52 ` [PATCH v7 0/3] Add MediaTek display PWM driver YH Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).