All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/2] mfd: add atmel-hlcdc driver
@ 2014-10-06 13:48 Boris Brezillon
  2014-10-06 13:48 ` [PATCH v8 1/2] " Boris Brezillon
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Boris Brezillon @ 2014-10-06 13:48 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: David Airlie, dri-devel, Thierry Reding, linux-pwm, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, devicetree,
	Boris Brezillon

Hi Lee,

As proposed in my last atmel-hlcdc series I have split the series in order
to get the accepted parts merged.

This series is the one all others depend on.
Could you take it in your tree so that other maintainers can rely on the
fact this part will be merged before other parts.

Moreover, I know this is late, but can you include it in one of your 3.18
pull request as suggested by Thierry.
If you can't, can you provide Thierry and Dave with a stable branch
including this driver ?

Best Regards,

Boris

Boris Brezillon (2):
  mfd: add atmel-hlcdc driver
  mfd: add documentation for atmel-hlcdc DT bindings

 .../devicetree/bindings/mfd/atmel-hlcdc.txt        |  51 +++++++++
 drivers/mfd/Kconfig                                |   6 +
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/atmel-hlcdc.c                          | 122 +++++++++++++++++++++
 include/linux/mfd/atmel-hlcdc.h                    |  85 ++++++++++++++
 5 files changed, 265 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
 create mode 100644 drivers/mfd/atmel-hlcdc.c
 create mode 100644 include/linux/mfd/atmel-hlcdc.h

-- 
1.9.1


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

* [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-06 13:48 [PATCH v8 0/2] mfd: add atmel-hlcdc driver Boris Brezillon
@ 2014-10-06 13:48 ` Boris Brezillon
  2014-10-07  9:44   ` Lee Jones
  2014-10-06 13:48 ` [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings Boris Brezillon
  2014-10-06 16:23 ` [PATCH v8 0/2] mfd: add atmel-hlcdc driver Lee Jones
  2 siblings, 1 reply; 19+ messages in thread
From: Boris Brezillon @ 2014-10-06 13:48 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: David Airlie, dri-devel, Thierry Reding, linux-pwm, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, devicetree,
	Boris Brezillon

The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
family or sama5d3 family) exposes 2 subdevices:
- a display controller (controlled by a DRM driver)
- a PWM chip

The MFD device provides a regmap and several clocks (those connected
to this hardware block) to its subdevices.

This way concurrent accesses to the iomem range are handled by the regmap
framework, and each subdevice can safely access HLCDC registers.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 drivers/mfd/Kconfig             |   6 ++
 drivers/mfd/Makefile            |   1 +
 drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
 4 files changed, 214 insertions(+)
 create mode 100644 drivers/mfd/atmel-hlcdc.c
 create mode 100644 include/linux/mfd/atmel-hlcdc.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index de5abf2..1b925f7 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -59,6 +59,12 @@ config MFD_AAT2870_CORE
 	  additional drivers must be enabled in order to use the
 	  functionality of the device.
 
+config MFD_ATMEL_HLCDC
+	tristate
+	select MFD_CORE
+	select REGMAP_MMIO
+	depends on OF
+
 config MFD_BCM590XX
 	tristate "Broadcom BCM590xx PMUs"
 	select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f001487..df36f68 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -156,6 +156,7 @@ obj-$(CONFIG_MFD_PM8921_CORE) 	+= pm8921-core.o ssbi.o
 obj-$(CONFIG_TPS65911_COMPARATOR)	+= tps65911-comparator.o
 obj-$(CONFIG_MFD_TPS65090)	+= tps65090.o
 obj-$(CONFIG_MFD_AAT2870_CORE)	+= aat2870-core.o
+obj-$(CONFIG_MFD_ATMEL_HLCDC)	+= atmel-hlcdc.o
 obj-$(CONFIG_MFD_INTEL_MSIC)	+= intel_msic.o
 obj-$(CONFIG_MFD_PALMAS)	+= palmas.o
 obj-$(CONFIG_MFD_VIPERBOARD)    += viperboard.o
diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
new file mode 100644
index 0000000..cfd58f4
--- /dev/null
+++ b/drivers/mfd/atmel-hlcdc.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2014 Free Electrons
+ * Copyright (C) 2014 Atmel
+ *
+ * Author: Boris BREZILLON <boris.brezillon@free-electrons.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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/clk.h>
+#include <linux/mfd/atmel-hlcdc.h>
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+
+#define ATMEL_HLCDC_REG_MAX		(0x4000 - 0x4)
+
+static const struct mfd_cell atmel_hlcdc_cells[] = {
+	{
+		.name = "atmel-hlcdc-pwm",
+		.of_compatible = "atmel,hlcdc-pwm",
+	},
+	{
+		.name = "atmel-hlcdc-dc",
+		.of_compatible = "atmel,hlcdc-display-controller",
+	},
+};
+
+static const struct regmap_config atmel_hlcdc_regmap_config = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+	.max_register = ATMEL_HLCDC_REG_MAX,
+};
+
+static int atmel_hlcdc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct atmel_hlcdc *hlcdc;
+	struct resource *res;
+	void __iomem *regs;
+
+	hlcdc = devm_kzalloc(dev, sizeof(*hlcdc), GFP_KERNEL);
+	if (!hlcdc)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	regs = devm_ioremap_resource(dev, res);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
+
+	hlcdc->irq = platform_get_irq(pdev, 0);
+	if (hlcdc->irq < 0)
+		return hlcdc->irq;
+
+	hlcdc->periph_clk = devm_clk_get(dev, "periph_clk");
+	if (IS_ERR(hlcdc->periph_clk)) {
+		dev_err(dev, "failed to get peripheral clock\n");
+		return PTR_ERR(hlcdc->periph_clk);
+	}
+
+	hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
+	if (IS_ERR(hlcdc->sys_clk)) {
+		dev_err(dev, "failed to get system clock\n");
+		return PTR_ERR(hlcdc->sys_clk);
+	}
+
+	hlcdc->slow_clk = devm_clk_get(dev, "slow_clk");
+	if (IS_ERR(hlcdc->slow_clk)) {
+		dev_err(dev, "failed to get slow clock\n");
+		return PTR_ERR(hlcdc->slow_clk);
+	}
+
+	hlcdc->regmap = devm_regmap_init_mmio(dev, regs,
+					      &atmel_hlcdc_regmap_config);
+	if (IS_ERR(hlcdc->regmap))
+		return PTR_ERR(hlcdc->regmap);
+
+	dev_set_drvdata(dev, hlcdc);
+
+	return mfd_add_devices(dev, -1, atmel_hlcdc_cells,
+			       ARRAY_SIZE(atmel_hlcdc_cells),
+			       NULL, 0, NULL);
+}
+
+static int atmel_hlcdc_remove(struct platform_device *pdev)
+{
+	mfd_remove_devices(&pdev->dev);
+
+	return 0;
+}
+
+static const struct of_device_id atmel_hlcdc_match[] = {
+	{ .compatible = "atmel,sama5d3-hlcdc" },
+	{ /* sentinel */ },
+};
+
+static struct platform_driver atmel_hlcdc_driver = {
+	.probe = atmel_hlcdc_probe,
+	.remove = atmel_hlcdc_remove,
+	.driver = {
+		.name = "atmel-hlcdc",
+		.of_match_table = atmel_hlcdc_match,
+	},
+};
+module_platform_driver(atmel_hlcdc_driver);
+
+MODULE_ALIAS("platform:atmel-hlcdc");
+MODULE_AUTHOR("Boris Brezillon <boris.brezillon@free-electrons.com>");
+MODULE_DESCRIPTION("Atmel HLCDC driver");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/mfd/atmel-hlcdc.h b/include/linux/mfd/atmel-hlcdc.h
new file mode 100644
index 0000000..1279ab1
--- /dev/null
+++ b/include/linux/mfd/atmel-hlcdc.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2014 Free Electrons
+ * Copyright (C) 2014 Atmel
+ *
+ * Author: Boris BREZILLON <boris.brezillon@free-electrons.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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LINUX_MFD_HLCDC_H
+#define __LINUX_MFD_HLCDC_H
+
+#include <linux/clk.h>
+#include <linux/regmap.h>
+
+#define ATMEL_HLCDC_CFG(i)		((i) * 0x4)
+#define ATMEL_HLCDC_SIG_CFG		LCDCFG(5)
+#define ATMEL_HLCDC_HSPOL		BIT(0)
+#define ATMEL_HLCDC_VSPOL		BIT(1)
+#define ATMEL_HLCDC_VSPDLYS		BIT(2)
+#define ATMEL_HLCDC_VSPDLYE		BIT(3)
+#define ATMEL_HLCDC_DISPPOL		BIT(4)
+#define ATMEL_HLCDC_DITHER		BIT(6)
+#define ATMEL_HLCDC_DISPDLY		BIT(7)
+#define ATMEL_HLCDC_MODE_MASK		GENMASK(9, 8)
+#define ATMEL_HLCDC_PP			BIT(10)
+#define ATMEL_HLCDC_VSPSU		BIT(12)
+#define ATMEL_HLCDC_VSPHO		BIT(13)
+#define ATMEL_HLCDC_GUARDTIME_MASK	GENMASK(20, 16)
+
+#define ATMEL_HLCDC_EN			0x20
+#define ATMEL_HLCDC_DIS			0x24
+#define ATMEL_HLCDC_SR			0x28
+#define ATMEL_HLCDC_IER			0x2c
+#define ATMEL_HLCDC_IDR			0x30
+#define ATMEL_HLCDC_IMR			0x34
+#define ATMEL_HLCDC_ISR			0x38
+
+#define ATMEL_HLCDC_CLKPOL		BIT(0)
+#define ATMEL_HLCDC_CLKSEL		BIT(2)
+#define ATMEL_HLCDC_CLKPWMSEL		BIT(3)
+#define ATMEL_HLCDC_CGDIS(i)		BIT(8 + (i))
+#define ATMEL_HLCDC_CLKDIV_SHFT		16
+#define ATMEL_HLCDC_CLKDIV_MASK		GENMASK(23, 16)
+#define ATMEL_HLCDC_CLKDIV(div)		((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
+
+#define ATMEL_HLCDC_PIXEL_CLK		BIT(0)
+#define ATMEL_HLCDC_SYNC		BIT(1)
+#define ATMEL_HLCDC_DISP		BIT(2)
+#define ATMEL_HLCDC_PWM			BIT(3)
+#define ATMEL_HLCDC_SIP			BIT(4)
+
+#define ATMEL_HLCDC_SOF			BIT(0)
+#define ATMEL_HLCDC_SYNCDIS		BIT(1)
+#define ATMEL_HLCDC_FIFOERR		BIT(4)
+#define ATMEL_HLCDC_LAYER_STATUS(x)	BIT((x) + 8)
+
+/**
+ * Structure shared by the MFD device and its subdevices.
+ *
+ * @regmap: register map used to access HLCDC IP registers
+ * @periph_clk: the hlcdc peripheral clock
+ * @sys_clk: the hlcdc system clock
+ * @slow_clk: the system slow clk
+ * @irq: the hlcdc irq
+ */
+struct atmel_hlcdc {
+	struct regmap *regmap;
+	struct clk *periph_clk;
+	struct clk *sys_clk;
+	struct clk *slow_clk;
+	int irq;
+};
+
+#endif /* __LINUX_MFD_HLCDC_H */
-- 
1.9.1


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

* [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings
  2014-10-06 13:48 [PATCH v8 0/2] mfd: add atmel-hlcdc driver Boris Brezillon
  2014-10-06 13:48 ` [PATCH v8 1/2] " Boris Brezillon
@ 2014-10-06 13:48 ` Boris Brezillon
  2014-10-07  9:44   ` Lee Jones
  2014-10-06 16:23 ` [PATCH v8 0/2] mfd: add atmel-hlcdc driver Lee Jones
  2 siblings, 1 reply; 19+ messages in thread
From: Boris Brezillon @ 2014-10-06 13:48 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones
  Cc: Mark Rutland, linux-pwm, Pawel Moll, Ian Campbell, Rob Herring,
	devicetree, dri-devel, Kumar Gala

The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
family or sama5d3 family) exposes 2 subdevices:
- a display controller (controlled by a DRM driver)
- a PWM chip

This patch adds documentation for atmel-hlcdc DT bindings.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 .../devicetree/bindings/mfd/atmel-hlcdc.txt        | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt

diff --git a/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt b/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
new file mode 100644
index 0000000..f64de95a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
@@ -0,0 +1,51 @@
+Device-Tree bindings for Atmel's HLCDC (High LCD Controller) MFD driver
+
+Required properties:
+ - compatible: value should be one of the following:
+   "atmel,sama5d3-hlcdc"
+ - reg: base address and size of the HLCDC device registers.
+ - clock-names: the name of the 3 clocks requested by the HLCDC device.
+   Should contain "periph_clk", "sys_clk" and "slow_clk".
+ - clocks: should contain the 3 clocks requested by the HLCDC device.
+ - interrupts: should contain the description of the HLCDC interrupt line
+
+The HLCDC IP exposes two subdevices:
+ - a PWM chip: see ../pwm/atmel-hlcdc-pwm.txt
+ - a Display Controller: see ../drm/atmel-hlcdc-dc.txt
+
+Example:
+
+	hlcdc: hlcdc@f0030000 {
+		compatible = "atmel,sama5d3-hlcdc";
+		reg = <0xf0030000 0x2000>;
+		clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
+		clock-names = "periph_clk","sys_clk", "slow_clk";
+		interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
+		status = "disabled";
+
+		hlcdc-display-controller {
+			compatible = "atmel,hlcdc-display-controller";
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0>;
+
+				hlcdc_panel_output: endpoint@0 {
+					reg = <0>;
+					remote-endpoint = <&panel_input>;
+				};
+			};
+		};
+
+		hlcdc_pwm: hlcdc-pwm {
+			compatible = "atmel,hlcdc-pwm";
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_lcd_pwm>;
+			#pwm-cells = <3>;
+		};
+	};
-- 
1.9.1

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

* Re: [PATCH v8 0/2] mfd: add atmel-hlcdc driver
  2014-10-06 13:48 [PATCH v8 0/2] mfd: add atmel-hlcdc driver Boris Brezillon
  2014-10-06 13:48 ` [PATCH v8 1/2] " Boris Brezillon
  2014-10-06 13:48 ` [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings Boris Brezillon
@ 2014-10-06 16:23 ` Lee Jones
  2 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2014-10-06 16:23 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Samuel Ortiz, David Airlie, dri-devel, Thierry Reding, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Mon, 06 Oct 2014, Boris Brezillon wrote:
> As proposed in my last atmel-hlcdc series I have split the series in order
> to get the accepted parts merged.
> 
> This series is the one all others depend on.
> Could you take it in your tree so that other maintainers can rely on the
> fact this part will be merged before other parts.
> 
> Moreover, I know this is late, but can you include it in one of your 3.18
> pull request as suggested by Thierry.
> If you can't, can you provide Thierry and Dave with a stable branch
> including this driver ?

It's too late for v3.18.  I stopped taking patches a couple of weeks
ago.  Looks like you still need a DT Ack too.

> Best Regards,
> 
> Boris
> 
> Boris Brezillon (2):
>   mfd: add atmel-hlcdc driver
>   mfd: add documentation for atmel-hlcdc DT bindings
> 
>  .../devicetree/bindings/mfd/atmel-hlcdc.txt        |  51 +++++++++
>  drivers/mfd/Kconfig                                |   6 +
>  drivers/mfd/Makefile                               |   1 +
>  drivers/mfd/atmel-hlcdc.c                          | 122 +++++++++++++++++++++
>  include/linux/mfd/atmel-hlcdc.h                    |  85 ++++++++++++++
>  5 files changed, 265 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
>  create mode 100644 drivers/mfd/atmel-hlcdc.c
>  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-06 13:48 ` [PATCH v8 1/2] " Boris Brezillon
@ 2014-10-07  9:44   ` Lee Jones
  2014-10-07  9:47     ` Thierry Reding
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07  9:44 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Samuel Ortiz, David Airlie, dri-devel, Thierry Reding, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Mon, 06 Oct 2014, Boris Brezillon wrote:

> The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> family or sama5d3 family) exposes 2 subdevices:
> - a display controller (controlled by a DRM driver)
> - a PWM chip
> 
> The MFD device provides a regmap and several clocks (those connected
> to this hardware block) to its subdevices.
> 
> This way concurrent accesses to the iomem range are handled by the regmap
> framework, and each subdevice can safely access HLCDC registers.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>  drivers/mfd/Kconfig             |   6 ++
>  drivers/mfd/Makefile            |   1 +
>  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
>  4 files changed, 214 insertions(+)
>  create mode 100644 drivers/mfd/atmel-hlcdc.c
>  create mode 100644 include/linux/mfd/atmel-hlcdc.h

Applied for v3.19.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index de5abf2..1b925f7 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -59,6 +59,12 @@ config MFD_AAT2870_CORE
>  	  additional drivers must be enabled in order to use the
>  	  functionality of the device.
>  
> +config MFD_ATMEL_HLCDC
> +	tristate
> +	select MFD_CORE
> +	select REGMAP_MMIO
> +	depends on OF
> +
>  config MFD_BCM590XX
>  	tristate "Broadcom BCM590xx PMUs"
>  	select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index f001487..df36f68 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -156,6 +156,7 @@ obj-$(CONFIG_MFD_PM8921_CORE) 	+= pm8921-core.o ssbi.o
>  obj-$(CONFIG_TPS65911_COMPARATOR)	+= tps65911-comparator.o
>  obj-$(CONFIG_MFD_TPS65090)	+= tps65090.o
>  obj-$(CONFIG_MFD_AAT2870_CORE)	+= aat2870-core.o
> +obj-$(CONFIG_MFD_ATMEL_HLCDC)	+= atmel-hlcdc.o
>  obj-$(CONFIG_MFD_INTEL_MSIC)	+= intel_msic.o
>  obj-$(CONFIG_MFD_PALMAS)	+= palmas.o
>  obj-$(CONFIG_MFD_VIPERBOARD)    += viperboard.o
> diff --git a/drivers/mfd/atmel-hlcdc.c b/drivers/mfd/atmel-hlcdc.c
> new file mode 100644
> index 0000000..cfd58f4
> --- /dev/null
> +++ b/drivers/mfd/atmel-hlcdc.c
> @@ -0,0 +1,122 @@
> +/*
> + * Copyright (C) 2014 Free Electrons
> + * Copyright (C) 2014 Atmel
> + *
> + * Author: Boris BREZILLON <boris.brezillon@free-electrons.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.
> + *
> + * You should have received a copy of the GNU General Public License along with
> + * this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/mfd/atmel-hlcdc.h>
> +#include <linux/mfd/core.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +
> +#define ATMEL_HLCDC_REG_MAX		(0x4000 - 0x4)
> +
> +static const struct mfd_cell atmel_hlcdc_cells[] = {
> +	{
> +		.name = "atmel-hlcdc-pwm",
> +		.of_compatible = "atmel,hlcdc-pwm",
> +	},
> +	{
> +		.name = "atmel-hlcdc-dc",
> +		.of_compatible = "atmel,hlcdc-display-controller",
> +	},
> +};
> +
> +static const struct regmap_config atmel_hlcdc_regmap_config = {
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_stride = 4,
> +	.max_register = ATMEL_HLCDC_REG_MAX,
> +};
> +
> +static int atmel_hlcdc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct atmel_hlcdc *hlcdc;
> +	struct resource *res;
> +	void __iomem *regs;
> +
> +	hlcdc = devm_kzalloc(dev, sizeof(*hlcdc), GFP_KERNEL);
> +	if (!hlcdc)
> +		return -ENOMEM;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	regs = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +
> +	hlcdc->irq = platform_get_irq(pdev, 0);
> +	if (hlcdc->irq < 0)
> +		return hlcdc->irq;
> +
> +	hlcdc->periph_clk = devm_clk_get(dev, "periph_clk");
> +	if (IS_ERR(hlcdc->periph_clk)) {
> +		dev_err(dev, "failed to get peripheral clock\n");
> +		return PTR_ERR(hlcdc->periph_clk);
> +	}
> +
> +	hlcdc->sys_clk = devm_clk_get(dev, "sys_clk");
> +	if (IS_ERR(hlcdc->sys_clk)) {
> +		dev_err(dev, "failed to get system clock\n");
> +		return PTR_ERR(hlcdc->sys_clk);
> +	}
> +
> +	hlcdc->slow_clk = devm_clk_get(dev, "slow_clk");
> +	if (IS_ERR(hlcdc->slow_clk)) {
> +		dev_err(dev, "failed to get slow clock\n");
> +		return PTR_ERR(hlcdc->slow_clk);
> +	}
> +
> +	hlcdc->regmap = devm_regmap_init_mmio(dev, regs,
> +					      &atmel_hlcdc_regmap_config);
> +	if (IS_ERR(hlcdc->regmap))
> +		return PTR_ERR(hlcdc->regmap);
> +
> +	dev_set_drvdata(dev, hlcdc);
> +
> +	return mfd_add_devices(dev, -1, atmel_hlcdc_cells,
> +			       ARRAY_SIZE(atmel_hlcdc_cells),
> +			       NULL, 0, NULL);
> +}
> +
> +static int atmel_hlcdc_remove(struct platform_device *pdev)
> +{
> +	mfd_remove_devices(&pdev->dev);
> +
> +	return 0;
> +}
> +
> +static const struct of_device_id atmel_hlcdc_match[] = {
> +	{ .compatible = "atmel,sama5d3-hlcdc" },
> +	{ /* sentinel */ },
> +};
> +
> +static struct platform_driver atmel_hlcdc_driver = {
> +	.probe = atmel_hlcdc_probe,
> +	.remove = atmel_hlcdc_remove,
> +	.driver = {
> +		.name = "atmel-hlcdc",
> +		.of_match_table = atmel_hlcdc_match,
> +	},
> +};
> +module_platform_driver(atmel_hlcdc_driver);
> +
> +MODULE_ALIAS("platform:atmel-hlcdc");
> +MODULE_AUTHOR("Boris Brezillon <boris.brezillon@free-electrons.com>");
> +MODULE_DESCRIPTION("Atmel HLCDC driver");
> +MODULE_LICENSE("GPL v2");
> diff --git a/include/linux/mfd/atmel-hlcdc.h b/include/linux/mfd/atmel-hlcdc.h
> new file mode 100644
> index 0000000..1279ab1
> --- /dev/null
> +++ b/include/linux/mfd/atmel-hlcdc.h
> @@ -0,0 +1,85 @@
> +/*
> + * Copyright (C) 2014 Free Electrons
> + * Copyright (C) 2014 Atmel
> + *
> + * Author: Boris BREZILLON <boris.brezillon@free-electrons.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.
> + *
> + * You should have received a copy of the GNU General Public License along with
> + * this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef __LINUX_MFD_HLCDC_H
> +#define __LINUX_MFD_HLCDC_H
> +
> +#include <linux/clk.h>
> +#include <linux/regmap.h>
> +
> +#define ATMEL_HLCDC_CFG(i)		((i) * 0x4)
> +#define ATMEL_HLCDC_SIG_CFG		LCDCFG(5)
> +#define ATMEL_HLCDC_HSPOL		BIT(0)
> +#define ATMEL_HLCDC_VSPOL		BIT(1)
> +#define ATMEL_HLCDC_VSPDLYS		BIT(2)
> +#define ATMEL_HLCDC_VSPDLYE		BIT(3)
> +#define ATMEL_HLCDC_DISPPOL		BIT(4)
> +#define ATMEL_HLCDC_DITHER		BIT(6)
> +#define ATMEL_HLCDC_DISPDLY		BIT(7)
> +#define ATMEL_HLCDC_MODE_MASK		GENMASK(9, 8)
> +#define ATMEL_HLCDC_PP			BIT(10)
> +#define ATMEL_HLCDC_VSPSU		BIT(12)
> +#define ATMEL_HLCDC_VSPHO		BIT(13)
> +#define ATMEL_HLCDC_GUARDTIME_MASK	GENMASK(20, 16)
> +
> +#define ATMEL_HLCDC_EN			0x20
> +#define ATMEL_HLCDC_DIS			0x24
> +#define ATMEL_HLCDC_SR			0x28
> +#define ATMEL_HLCDC_IER			0x2c
> +#define ATMEL_HLCDC_IDR			0x30
> +#define ATMEL_HLCDC_IMR			0x34
> +#define ATMEL_HLCDC_ISR			0x38
> +
> +#define ATMEL_HLCDC_CLKPOL		BIT(0)
> +#define ATMEL_HLCDC_CLKSEL		BIT(2)
> +#define ATMEL_HLCDC_CLKPWMSEL		BIT(3)
> +#define ATMEL_HLCDC_CGDIS(i)		BIT(8 + (i))
> +#define ATMEL_HLCDC_CLKDIV_SHFT		16
> +#define ATMEL_HLCDC_CLKDIV_MASK		GENMASK(23, 16)
> +#define ATMEL_HLCDC_CLKDIV(div)		((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
> +
> +#define ATMEL_HLCDC_PIXEL_CLK		BIT(0)
> +#define ATMEL_HLCDC_SYNC		BIT(1)
> +#define ATMEL_HLCDC_DISP		BIT(2)
> +#define ATMEL_HLCDC_PWM			BIT(3)
> +#define ATMEL_HLCDC_SIP			BIT(4)
> +
> +#define ATMEL_HLCDC_SOF			BIT(0)
> +#define ATMEL_HLCDC_SYNCDIS		BIT(1)
> +#define ATMEL_HLCDC_FIFOERR		BIT(4)
> +#define ATMEL_HLCDC_LAYER_STATUS(x)	BIT((x) + 8)
> +
> +/**
> + * Structure shared by the MFD device and its subdevices.
> + *
> + * @regmap: register map used to access HLCDC IP registers
> + * @periph_clk: the hlcdc peripheral clock
> + * @sys_clk: the hlcdc system clock
> + * @slow_clk: the system slow clk
> + * @irq: the hlcdc irq
> + */
> +struct atmel_hlcdc {
> +	struct regmap *regmap;
> +	struct clk *periph_clk;
> +	struct clk *sys_clk;
> +	struct clk *slow_clk;
> +	int irq;
> +};
> +
> +#endif /* __LINUX_MFD_HLCDC_H */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings
  2014-10-06 13:48 ` [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings Boris Brezillon
@ 2014-10-07  9:44   ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2014-10-07  9:44 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Samuel Ortiz, David Airlie, dri-devel, Thierry Reding, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Mon, 06 Oct 2014, Boris Brezillon wrote:

> The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> family or sama5d3 family) exposes 2 subdevices:
> - a display controller (controlled by a DRM driver)
> - a PWM chip
> 
> This patch adds documentation for atmel-hlcdc DT bindings.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>  .../devicetree/bindings/mfd/atmel-hlcdc.txt        | 51 ++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt

Applied for v3.19.

> diff --git a/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt b/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
> new file mode 100644
> index 0000000..f64de95a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/atmel-hlcdc.txt
> @@ -0,0 +1,51 @@
> +Device-Tree bindings for Atmel's HLCDC (High LCD Controller) MFD driver
> +
> +Required properties:
> + - compatible: value should be one of the following:
> +   "atmel,sama5d3-hlcdc"
> + - reg: base address and size of the HLCDC device registers.
> + - clock-names: the name of the 3 clocks requested by the HLCDC device.
> +   Should contain "periph_clk", "sys_clk" and "slow_clk".
> + - clocks: should contain the 3 clocks requested by the HLCDC device.
> + - interrupts: should contain the description of the HLCDC interrupt line
> +
> +The HLCDC IP exposes two subdevices:
> + - a PWM chip: see ../pwm/atmel-hlcdc-pwm.txt
> + - a Display Controller: see ../drm/atmel-hlcdc-dc.txt
> +
> +Example:
> +
> +	hlcdc: hlcdc@f0030000 {
> +		compatible = "atmel,sama5d3-hlcdc";
> +		reg = <0xf0030000 0x2000>;
> +		clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
> +		clock-names = "periph_clk","sys_clk", "slow_clk";
> +		interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
> +		status = "disabled";
> +
> +		hlcdc-display-controller {
> +			compatible = "atmel,hlcdc-display-controller";
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb888>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0>;
> +
> +				hlcdc_panel_output: endpoint@0 {
> +					reg = <0>;
> +					remote-endpoint = <&panel_input>;
> +				};
> +			};
> +		};
> +
> +		hlcdc_pwm: hlcdc-pwm {
> +			compatible = "atmel,hlcdc-pwm";
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&pinctrl_lcd_pwm>;
> +			#pwm-cells = <3>;
> +		};
> +	};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07  9:44   ` Lee Jones
@ 2014-10-07  9:47     ` Thierry Reding
  2014-10-07  9:59       ` Lee Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Thierry Reding @ 2014-10-07  9:47 UTC (permalink / raw)
  To: Lee Jones
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree

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

On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> On Mon, 06 Oct 2014, Boris Brezillon wrote:
> 
> > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > family or sama5d3 family) exposes 2 subdevices:
> > - a display controller (controlled by a DRM driver)
> > - a PWM chip
> > 
> > The MFD device provides a regmap and several clocks (those connected
> > to this hardware block) to its subdevices.
> > 
> > This way concurrent accesses to the iomem range are handled by the regmap
> > framework, and each subdevice can safely access HLCDC registers.
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Acked-by: Lee Jones <lee.jones@linaro.org>
> > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > ---
> >  drivers/mfd/Kconfig             |   6 ++
> >  drivers/mfd/Makefile            |   1 +
> >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> >  4 files changed, 214 insertions(+)
> >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> 
> Applied for v3.19.

Will you provide a stable branch that I can pull into the PWM tree?

Thierry

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

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07  9:47     ` Thierry Reding
@ 2014-10-07  9:59       ` Lee Jones
  2014-10-07 10:06         ` Thierry Reding
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07  9:59 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree

On Tue, 07 Oct 2014, Thierry Reding wrote:

> On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > 
> > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > family or sama5d3 family) exposes 2 subdevices:
> > > - a display controller (controlled by a DRM driver)
> > > - a PWM chip
> > > 
> > > The MFD device provides a regmap and several clocks (those connected
> > > to this hardware block) to its subdevices.
> > > 
> > > This way concurrent accesses to the iomem range are handled by the regmap
> > > framework, and each subdevice can safely access HLCDC registers.
> > > 
> > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > ---
> > >  drivers/mfd/Kconfig             |   6 ++
> > >  drivers/mfd/Makefile            |   1 +
> > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > >  4 files changed, 214 insertions(+)
> > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > 
> > Applied for v3.19.
> 
> Will you provide a stable branch that I can pull into the PWM tree?

I hadn't planned on it.  What do you need that for?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07  9:59       ` Lee Jones
@ 2014-10-07 10:06         ` Thierry Reding
  2014-10-07 10:17           ` Lee Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Thierry Reding @ 2014-10-07 10:06 UTC (permalink / raw)
  To: Lee Jones
  Cc: Mark Rutland, Samuel Ortiz, Pawel Moll, linux-pwm, Ian Campbell,
	dri-devel, devicetree, Rob Herring, Kumar Gala


[-- Attachment #1.1: Type: text/plain, Size: 1780 bytes --]

On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> On Tue, 07 Oct 2014, Thierry Reding wrote:
> 
> > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > 
> > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > family or sama5d3 family) exposes 2 subdevices:
> > > > - a display controller (controlled by a DRM driver)
> > > > - a PWM chip
> > > > 
> > > > The MFD device provides a regmap and several clocks (those connected
> > > > to this hardware block) to its subdevices.
> > > > 
> > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > framework, and each subdevice can safely access HLCDC registers.
> > > > 
> > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > ---
> > > >  drivers/mfd/Kconfig             |   6 ++
> > > >  drivers/mfd/Makefile            |   1 +
> > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > >  4 files changed, 214 insertions(+)
> > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > 
> > > Applied for v3.19.
> > 
> > Will you provide a stable branch that I can pull into the PWM tree?
> 
> I hadn't planned on it.  What do you need that for?

Because the PWM driver depends on this series. But if you prefer you
could also take the PWM driver through your tree.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 10:06         ` Thierry Reding
@ 2014-10-07 10:17           ` Lee Jones
  2014-10-07 11:13             ` Thierry Reding
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07 10:17 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree

On Tue, 07 Oct 2014, Thierry Reding wrote:

> On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > 
> > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > 
> > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > - a display controller (controlled by a DRM driver)
> > > > > - a PWM chip
> > > > > 
> > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > to this hardware block) to its subdevices.
> > > > > 
> > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > 
> > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > ---
> > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > >  drivers/mfd/Makefile            |   1 +
> > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > >  4 files changed, 214 insertions(+)
> > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > 
> > > > Applied for v3.19.
> > > 
> > > Will you provide a stable branch that I can pull into the PWM tree?
> > 
> > I hadn't planned on it.  What do you need that for?
> 
> Because the PWM driver depends on this series. But if you prefer you
> could also take the PWM driver through your tree.

Probably better to deal with that via Kconfig.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 10:17           ` Lee Jones
@ 2014-10-07 11:13             ` Thierry Reding
  2014-10-07 11:38               ` Lee Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Thierry Reding @ 2014-10-07 11:13 UTC (permalink / raw)
  To: Lee Jones
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree

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

On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> On Tue, 07 Oct 2014, Thierry Reding wrote:
> 
> > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > 
> > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > 
> > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > - a display controller (controlled by a DRM driver)
> > > > > > - a PWM chip
> > > > > > 
> > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > to this hardware block) to its subdevices.
> > > > > > 
> > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > 
> > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > ---
> > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > >  4 files changed, 214 insertions(+)
> > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > 
> > > > > Applied for v3.19.
> > > > 
> > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > 
> > > I hadn't planned on it.  What do you need that for?
> > 
> > Because the PWM driver depends on this series. But if you prefer you
> > could also take the PWM driver through your tree.
> 
> Probably better to deal with that via Kconfig.

Do you have any suggestions? The PWM driver currently selects the
MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
if the latter isn't defined.

Thierry

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

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:13             ` Thierry Reding
@ 2014-10-07 11:38               ` Lee Jones
  2014-10-07 11:41                 ` Boris Brezillon
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07 11:38 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree

On Tue, 07 Oct 2014, Thierry Reding wrote:

> On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > 
> > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > 
> > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > 
> > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > - a PWM chip
> > > > > > > 
> > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > to this hardware block) to its subdevices.
> > > > > > > 
> > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > 
> > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > ---
> > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > >  4 files changed, 214 insertions(+)
> > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > 
> > > > > > Applied for v3.19.
> > > > > 
> > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > 
> > > > I hadn't planned on it.  What do you need that for?
> > > 
> > > Because the PWM driver depends on this series. But if you prefer you
> > > could also take the PWM driver through your tree.
> > 
> > Probably better to deal with that via Kconfig.
> 
> Do you have any suggestions? The PWM driver currently selects the
> MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> if the latter isn't defined.

s/select/depends on/ for the desired effect.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:38               ` Lee Jones
@ 2014-10-07 11:41                 ` Boris Brezillon
  2014-10-07 11:55                   ` Thierry Reding
  2014-10-07 11:59                   ` Lee Jones
  0 siblings, 2 replies; 19+ messages in thread
From: Boris Brezillon @ 2014-10-07 11:41 UTC (permalink / raw)
  To: Lee Jones
  Cc: Thierry Reding, Samuel Ortiz, David Airlie, dri-devel, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Tue, 7 Oct 2014 12:38:14 +0100
Lee Jones <lee.jones@linaro.org> wrote:

> On Tue, 07 Oct 2014, Thierry Reding wrote:
> 
> > On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > 
> > > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > 
> > > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > > 
> > > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > > - a PWM chip
> > > > > > > > 
> > > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > > to this hardware block) to its subdevices.
> > > > > > > > 
> > > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > > 
> > > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > > ---
> > > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > > >  4 files changed, 214 insertions(+)
> > > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > > 
> > > > > > > Applied for v3.19.
> > > > > > 
> > > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > > 
> > > > > I hadn't planned on it.  What do you need that for?
> > > > 
> > > > Because the PWM driver depends on this series. But if you prefer you
> > > > could also take the PWM driver through your tree.
> > > 
> > > Probably better to deal with that via Kconfig.
> > 
> > Do you have any suggestions? The PWM driver currently selects the
> > MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> > if the latter isn't defined.
> 
> s/select/depends on/ for the desired effect.
> 

Don't forget the atmel-hlcdc.h header file which is referenced by both
the DRM and the PWM drivers.


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:41                 ` Boris Brezillon
@ 2014-10-07 11:55                   ` Thierry Reding
  2014-10-07 12:22                     ` Lee Jones
  2014-10-07 11:59                   ` Lee Jones
  1 sibling, 1 reply; 19+ messages in thread
From: Thierry Reding @ 2014-10-07 11:55 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Mark Rutland, linux-pwm, Samuel Ortiz, Pawel Moll, Ian Campbell,
	Nicolas Ferre, dri-devel, devicetree, Rob Herring, Kumar Gala,
	Lee Jones


[-- Attachment #1.1: Type: text/plain, Size: 3656 bytes --]

On Tue, Oct 07, 2014 at 01:41:12PM +0200, Boris Brezillon wrote:
> On Tue, 7 Oct 2014 12:38:14 +0100
> Lee Jones <lee.jones@linaro.org> wrote:
> 
> > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > 
> > > On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > 
> > > > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > > 
> > > > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > > > 
> > > > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > > > - a PWM chip
> > > > > > > > > 
> > > > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > > > to this hardware block) to its subdevices.
> > > > > > > > > 
> > > > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > > > 
> > > > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > > > ---
> > > > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > > > >  4 files changed, 214 insertions(+)
> > > > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > > > 
> > > > > > > > Applied for v3.19.
> > > > > > > 
> > > > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > > > 
> > > > > > I hadn't planned on it.  What do you need that for?
> > > > > 
> > > > > Because the PWM driver depends on this series. But if you prefer you
> > > > > could also take the PWM driver through your tree.
> > > > 
> > > > Probably better to deal with that via Kconfig.
> > > 
> > > Do you have any suggestions? The PWM driver currently selects the
> > > MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> > > if the latter isn't defined.
> > 
> > s/select/depends on/ for the desired effect.
> > 
> 
> Don't forget the atmel-hlcdc.h header file which is referenced by both
> the DRM and the PWM drivers.

The depends on will prevent the PWM driver from being built until MFD
becomes available, so the missing header file shouldn't be a problem.

That said, Nicolas Ferre (Cc'ing) at some point requested this to become
a select (or at least for the DRM driver, but I guess the same applies
to PWM) on the grounds that a depends on will make it more difficult to
enable the driver.

So we have two options here: 1) turn the select into a depends on here
and allow the dependency to be resolved that way, or 2) solve the
dependency by making sure the MFD part is merged first (either by
pulling the MFD tree into the PWM and DRM trees or waiting for a full
cycle for the MFD changes to land).

I don't mind either way.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:41                 ` Boris Brezillon
  2014-10-07 11:55                   ` Thierry Reding
@ 2014-10-07 11:59                   ` Lee Jones
  2014-10-07 12:00                     ` Lee Jones
  1 sibling, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07 11:59 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Thierry Reding, Samuel Ortiz, David Airlie, dri-devel, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Tue, 07 Oct 2014, Boris Brezillon wrote:

> On Tue, 7 Oct 2014 12:38:14 +0100
> Lee Jones <lee.jones@linaro.org> wrote:
> 
> > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > 
> > > On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > 
> > > > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > > 
> > > > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > > > 
> > > > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > > > - a PWM chip
> > > > > > > > > 
> > > > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > > > to this hardware block) to its subdevices.
> > > > > > > > > 
> > > > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > > > 
> > > > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > > > ---
> > > > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > > > >  4 files changed, 214 insertions(+)
> > > > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > > > 
> > > > > > > > Applied for v3.19.
> > > > > > > 
> > > > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > > > 
> > > > > > I hadn't planned on it.  What do you need that for?
> > > > > 
> > > > > Because the PWM driver depends on this series. But if you prefer you
> > > > > could also take the PWM driver through your tree.
> > > > 
> > > > Probably better to deal with that via Kconfig.
> > > 
> > > Do you have any suggestions? The PWM driver currently selects the
> > > MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> > > if the latter isn't defined.
> > 
> > s/select/depends on/ for the desired effect.
> > 
> 
> Don't forget the atmel-hlcdc.h header file which is referenced by both
> the DRM and the PWM drivers.

If you use 'depends on' the DRM and PWM drivers won't even attempt to
compile.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:59                   ` Lee Jones
@ 2014-10-07 12:00                     ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2014-10-07 12:00 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Thierry Reding, Samuel Ortiz, David Airlie, dri-devel, linux-pwm,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree

On Tue, 07 Oct 2014, Lee Jones wrote:

> On Tue, 07 Oct 2014, Boris Brezillon wrote:
> 
> > On Tue, 7 Oct 2014 12:38:14 +0100
> > Lee Jones <lee.jones@linaro.org> wrote:
> > 
> > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > 
> > > > On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > 
> > > > > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > > > 
> > > > > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > > > > 
> > > > > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > > > > - a PWM chip
> > > > > > > > > > 
> > > > > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > > > > to this hardware block) to its subdevices.
> > > > > > > > > > 
> > > > > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > > > > 
> > > > > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > > > > ---
> > > > > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > > > > >  4 files changed, 214 insertions(+)
> > > > > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > > > > 
> > > > > > > > > Applied for v3.19.
> > > > > > > > 
> > > > > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > > > > 
> > > > > > > I hadn't planned on it.  What do you need that for?
> > > > > > 
> > > > > > Because the PWM driver depends on this series. But if you prefer you
> > > > > > could also take the PWM driver through your tree.
> > > > > 
> > > > > Probably better to deal with that via Kconfig.
> > > > 
> > > > Do you have any suggestions? The PWM driver currently selects the
> > > > MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> > > > if the latter isn't defined.
> > > 
> > > s/select/depends on/ for the desired effect.
> > > 
> > 
> > Don't forget the atmel-hlcdc.h header file which is referenced by both
> > the DRM and the PWM drivers.

I should probably attempt to finish this sentence.

> If you use 'depends on' the DRM and PWM drivers won't even attempt to
> compile...

... if the MFD driver (and thus the header file) is not present.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 11:55                   ` Thierry Reding
@ 2014-10-07 12:22                     ` Lee Jones
  2014-10-07 13:16                       ` Nicolas Ferre
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2014-10-07 12:22 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Boris Brezillon, Samuel Ortiz, David Airlie, dri-devel,
	linux-pwm, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, devicetree, Nicolas Ferre

On Tue, 07 Oct 2014, Thierry Reding wrote:
> On Tue, Oct 07, 2014 at 01:41:12PM +0200, Boris Brezillon wrote:
> > On Tue, 7 Oct 2014 12:38:14 +0100
> > Lee Jones <lee.jones@linaro.org> wrote:
> > 
> > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > 
> > > > On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
> > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > 
> > > > > > On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
> > > > > > > On Tue, 07 Oct 2014, Thierry Reding wrote:
> > > > > > > 
> > > > > > > > On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
> > > > > > > > > On Mon, 06 Oct 2014, Boris Brezillon wrote:
> > > > > > > > > 
> > > > > > > > > > The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
> > > > > > > > > > family or sama5d3 family) exposes 2 subdevices:
> > > > > > > > > > - a display controller (controlled by a DRM driver)
> > > > > > > > > > - a PWM chip
> > > > > > > > > > 
> > > > > > > > > > The MFD device provides a regmap and several clocks (those connected
> > > > > > > > > > to this hardware block) to its subdevices.
> > > > > > > > > > 
> > > > > > > > > > This way concurrent accesses to the iomem range are handled by the regmap
> > > > > > > > > > framework, and each subdevice can safely access HLCDC registers.
> > > > > > > > > > 
> > > > > > > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > > > > > > > > > Acked-by: Lee Jones <lee.jones@linaro.org>
> > > > > > > > > > Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
> > > > > > > > > > Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > > > > > > > > > ---
> > > > > > > > > >  drivers/mfd/Kconfig             |   6 ++
> > > > > > > > > >  drivers/mfd/Makefile            |   1 +
> > > > > > > > > >  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
> > > > > > > > > >  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
> > > > > > > > > >  4 files changed, 214 insertions(+)
> > > > > > > > > >  create mode 100644 drivers/mfd/atmel-hlcdc.c
> > > > > > > > > >  create mode 100644 include/linux/mfd/atmel-hlcdc.h
> > > > > > > > > 
> > > > > > > > > Applied for v3.19.
> > > > > > > > 
> > > > > > > > Will you provide a stable branch that I can pull into the PWM tree?
> > > > > > > 
> > > > > > > I hadn't planned on it.  What do you need that for?
> > > > > > 
> > > > > > Because the PWM driver depends on this series. But if you prefer you
> > > > > > could also take the PWM driver through your tree.
> > > > > 
> > > > > Probably better to deal with that via Kconfig.
> > > > 
> > > > Do you have any suggestions? The PWM driver currently selects the
> > > > MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
> > > > if the latter isn't defined.
> > > 
> > > s/select/depends on/ for the desired effect.
> > > 
> > 
> > Don't forget the atmel-hlcdc.h header file which is referenced by both
> > the DRM and the PWM drivers.
> 
> The depends on will prevent the PWM driver from being built until MFD
> becomes available, so the missing header file shouldn't be a problem.
> 
> That said, Nicolas Ferre (Cc'ing) at some point requested this to become
> a select (or at least for the DRM driver, but I guess the same applies
> to PWM) on the grounds that a depends on will make it more difficult to
> enable the driver.

It's not that much more difficult.  It just entails enabling 3 instead
of 2 config options.  Once all of the required components are merged,
feel free to drop back to 'select'.  This is easier than sharing round
immutable branches all over the place.

> So we have two options here: 1) turn the select into a depends on here
> and allow the dependency to be resolved that way, or 2) solve the
> dependency by making sure the MFD part is merged first (either by
> pulling the MFD tree into the PWM and DRM trees or waiting for a full
> cycle for the MFD changes to land).
> 
> I don't mind either way.

I'll go with either of the two suggestions above.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 12:22                     ` Lee Jones
@ 2014-10-07 13:16                       ` Nicolas Ferre
  2014-10-07 13:28                         ` Lee Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Ferre @ 2014-10-07 13:16 UTC (permalink / raw)
  To: Lee Jones, Thierry Reding, Boris Brezillon
  Cc: Samuel Ortiz, David Airlie, dri-devel, linux-pwm, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, devicetree

Hi Lee,

On 07/10/2014 14:22, Lee Jones :
> On Tue, 07 Oct 2014, Thierry Reding wrote:
>> On Tue, Oct 07, 2014 at 01:41:12PM +0200, Boris Brezillon wrote:
>>> On Tue, 7 Oct 2014 12:38:14 +0100
>>> Lee Jones <lee.jones@linaro.org> wrote:
>>>
>>>> On Tue, 07 Oct 2014, Thierry Reding wrote:
>>>>
>>>>> On Tue, Oct 07, 2014 at 11:17:43AM +0100, Lee Jones wrote:
>>>>>> On Tue, 07 Oct 2014, Thierry Reding wrote:
>>>>>>
>>>>>>> On Tue, Oct 07, 2014 at 10:59:32AM +0100, Lee Jones wrote:
>>>>>>>> On Tue, 07 Oct 2014, Thierry Reding wrote:
>>>>>>>>
>>>>>>>>> On Tue, Oct 07, 2014 at 10:44:27AM +0100, Lee Jones wrote:
>>>>>>>>>> On Mon, 06 Oct 2014, Boris Brezillon wrote:
>>>>>>>>>>
>>>>>>>>>>> The HLCDC IP available on some Atmel SoCs (i.e. at91sam9n12, at91sam9x5
>>>>>>>>>>> family or sama5d3 family) exposes 2 subdevices:
>>>>>>>>>>> - a display controller (controlled by a DRM driver)
>>>>>>>>>>> - a PWM chip
>>>>>>>>>>>
>>>>>>>>>>> The MFD device provides a regmap and several clocks (those connected
>>>>>>>>>>> to this hardware block) to its subdevices.
>>>>>>>>>>>
>>>>>>>>>>> This way concurrent accesses to the iomem range are handled by the regmap
>>>>>>>>>>> framework, and each subdevice can safely access HLCDC registers.
>>>>>>>>>>>
>>>>>>>>>>> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>>>>>>>>>>> Acked-by: Lee Jones <lee.jones@linaro.org>
>>>>>>>>>>> Tested-by: Anthony Harivel <anthony.harivel@emtrion.de>
>>>>>>>>>>> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
>>>>>>>>>>> ---
>>>>>>>>>>>  drivers/mfd/Kconfig             |   6 ++
>>>>>>>>>>>  drivers/mfd/Makefile            |   1 +
>>>>>>>>>>>  drivers/mfd/atmel-hlcdc.c       | 122 ++++++++++++++++++++++++++++++++++++++++
>>>>>>>>>>>  include/linux/mfd/atmel-hlcdc.h |  85 ++++++++++++++++++++++++++++
>>>>>>>>>>>  4 files changed, 214 insertions(+)
>>>>>>>>>>>  create mode 100644 drivers/mfd/atmel-hlcdc.c
>>>>>>>>>>>  create mode 100644 include/linux/mfd/atmel-hlcdc.h
>>>>>>>>>>
>>>>>>>>>> Applied for v3.19.
>>>>>>>>>
>>>>>>>>> Will you provide a stable branch that I can pull into the PWM tree?
>>>>>>>>
>>>>>>>> I hadn't planned on it.  What do you need that for?
>>>>>>>
>>>>>>> Because the PWM driver depends on this series. But if you prefer you
>>>>>>> could also take the PWM driver through your tree.
>>>>>>
>>>>>> Probably better to deal with that via Kconfig.
>>>>>
>>>>> Do you have any suggestions? The PWM driver currently selects the
>>>>> MFD_ATMEL_HLCDC symbol, which as I understand will cause a Kconfig error
>>>>> if the latter isn't defined.
>>>>
>>>> s/select/depends on/ for the desired effect.
>>>>
>>>
>>> Don't forget the atmel-hlcdc.h header file which is referenced by both
>>> the DRM and the PWM drivers.
>>
>> The depends on will prevent the PWM driver from being built until MFD
>> becomes available, so the missing header file shouldn't be a problem.
>>
>> That said, Nicolas Ferre (Cc'ing) at some point requested this to become
>> a select (or at least for the DRM driver, but I guess the same applies
>> to PWM) on the grounds that a depends on will make it more difficult to
>> enable the driver.
> 
> It's not that much more difficult.  It just entails enabling 3 instead
> of 2 config options.

Yes it is more difficult. Believe me, it's a mess, but...

> Once all of the required components are merged,
> feel free to drop back to 'select'.  This is easier than sharing round
> immutable branches all over the place.

.. I agree with this option of moving to an easier-to-merge solution and
then dealing with the ease of use.

>> So we have two options here: 1) turn the select into a depends on here
>> and allow the dependency to be resolved that way, or 2) solve the
>> dependency by making sure the MFD part is merged first (either by
>> pulling the MFD tree into the PWM and DRM trees or waiting for a full
>> cycle for the MFD changes to land).
>>
>> I don't mind either way.
> 
> I'll go with either of the two suggestions above.

So, Lee and Thierry, you can both take your part in your respective
trees with the change (1) described above and with my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

(if you feel it is needed).

Thanks, bye,
-- 
Nicolas Ferre

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

* Re: [PATCH v8 1/2] mfd: add atmel-hlcdc driver
  2014-10-07 13:16                       ` Nicolas Ferre
@ 2014-10-07 13:28                         ` Lee Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2014-10-07 13:28 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Thierry Reding, Boris Brezillon, Samuel Ortiz, David Airlie,
	dri-devel, linux-pwm, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, devicetree

> >> That said, Nicolas Ferre (Cc'ing) at some point requested this to become
> >> a select (or at least for the DRM driver, but I guess the same applies
> >> to PWM) on the grounds that a depends on will make it more difficult to
> >> enable the driver.
> > 
> > It's not that much more difficult.  It just entails enabling 3 instead
> > of 2 config options.
> 
> Yes it is more difficult. Believe me, it's a mess, but...
> 
> > Once all of the required components are merged,
> > feel free to drop back to 'select'.  This is easier than sharing round
> > immutable branches all over the place.
> 
> .. I agree with this option of moving to an easier-to-merge solution and
> then dealing with the ease of use.
> 
> >> So we have two options here: 1) turn the select into a depends on here
> >> and allow the dependency to be resolved that way, or 2) solve the
> >> dependency by making sure the MFD part is merged first (either by
> >> pulling the MFD tree into the PWM and DRM trees or waiting for a full
> >> cycle for the MFD changes to land).
> >>
> >> I don't mind either way.
> > 
> > I'll go with either of the two suggestions above.
> 
> So, Lee and Thierry, you can both take your part in your respective
> trees with the change (1) described above and with my:
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Works for me.  The MFD part has already been applied.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2014-10-07 13:28 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 13:48 [PATCH v8 0/2] mfd: add atmel-hlcdc driver Boris Brezillon
2014-10-06 13:48 ` [PATCH v8 1/2] " Boris Brezillon
2014-10-07  9:44   ` Lee Jones
2014-10-07  9:47     ` Thierry Reding
2014-10-07  9:59       ` Lee Jones
2014-10-07 10:06         ` Thierry Reding
2014-10-07 10:17           ` Lee Jones
2014-10-07 11:13             ` Thierry Reding
2014-10-07 11:38               ` Lee Jones
2014-10-07 11:41                 ` Boris Brezillon
2014-10-07 11:55                   ` Thierry Reding
2014-10-07 12:22                     ` Lee Jones
2014-10-07 13:16                       ` Nicolas Ferre
2014-10-07 13:28                         ` Lee Jones
2014-10-07 11:59                   ` Lee Jones
2014-10-07 12:00                     ` Lee Jones
2014-10-06 13:48 ` [PATCH v8 2/2] mfd: add documentation for atmel-hlcdc DT bindings Boris Brezillon
2014-10-07  9:44   ` Lee Jones
2014-10-06 16:23 ` [PATCH v8 0/2] mfd: add atmel-hlcdc driver Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.