From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcF2QKk (ORCPT ); Wed, 29 Jun 2016 12:10:40 -0400 Received: from mail2.asahi-net.or.jp ([202.224.39.198]:26895 "EHLO mail2.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbcF2QKj (ORCPT ); Wed, 29 Jun 2016 12:10:39 -0400 Date: Thu, 30 Jun 2016 01:09:03 +0900 Message-ID: <87bn2kht9c.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Lee Jones Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sm501: Add device property In-Reply-To: <20160629081633.GJ29166@dell> References: <20160628074908.GI6720@dell> <1467124401-14953-1-git-send-email-ysato@users.sourceforge.jp> <20160629081633.GJ29166@dell> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-2022-JP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Jun 2016 17:16:33 +0900, Lee Jones wrote: > > On Tue, 28 Jun 2016, Yoshinori Sato wrote: > > > Signed-off-by: Yoshinori Sato > > --- > > Documentation/devicetree/bindings/mfd/sm501.txt | 45 +++++++++++++++++++++++++ > > This needs a DT Ack, but you haven't sent it to the DT list. > > Did you run ./scripts/get_maintainer.pl? OK. I'll resent it. Thanks. > > drivers/mfd/sm501.c | 9 +++++ > > 2 files changed, 54 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/mfd/sm501.txt > > > > diff --git a/Documentation/devicetree/bindings/mfd/sm501.txt b/Documentation/devicetree/bindings/mfd/sm501.txt > > new file mode 100644 > > index 0000000..9290094 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/mfd/sm501.txt > > @@ -0,0 +1,45 @@ > > +* SM SM501 > > + > > +The SM SM501 is a LCD controller, with proper hardware, it can also > > +drive DVI monitors. > > + > > +Required properties: > > +- compatible : should be "smi,sm501". > > +- reg : contain two entries: > > + - First entry: System Configuration register > > + - Second entry: IO space (Display Controller register) > > +- interrupts : SMI interrupt to the cpu should be described here. > > +- interrupt-parent : the phandle for the interrupt controller that > > + services interrupts for this device. > > + > > +Optional properties: > > +- mode : select a video mode: > > + x[-][@] > > +- edid : verbatim EDID data block describing attached display. > > + Data from the detailed timing descriptor will be used to > > + program the display controller. > > +- little-endian: available on big endian systems, to > > + set different foreign endian. > > +- big-endian: available on little endian systems, to > > + set different foreign endian. > > +- smi,devices: function block enable bitmap. > > + bit0: USB host > > + bit1: USB slave > > + bit2: SSP Ch0 > > + bit3: SSP Ch1 > > + bit4: UART Ch0 > > + bit5: UART Ch1 > > + bit6: Accelerator > > + bit7: AC97 > > + bit8: I2S > > + bit9: GPIO > > + > > +Example for MPC5200: > > + display@1,0 { > > + compatible = "smi,sm501"; > > + reg = <1 0x00000000 0x00800000 > > + 1 0x03e00000 0x00200000>; > > + interrupts = <1 1 3>; > > + mode = "640x480-32@60"; > > + edid = [edid-data]; > > + }; > > diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c > > index 65cd0d2..e2e3f9b 100644 > > --- a/drivers/mfd/sm501.c > > +++ b/drivers/mfd/sm501.c > > @@ -21,6 +21,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -1377,6 +1378,8 @@ static int sm501_plat_probe(struct platform_device *dev) > > { > > struct sm501_devdata *sm; > > int ret; > > + struct sm501_platdata private_platdata; > > + struct sm501_initdata private_initdata; > > > > sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); > > if (sm == NULL) { > > @@ -1388,6 +1391,12 @@ static int sm501_plat_probe(struct platform_device *dev) > > sm->dev = &dev->dev; > > sm->pdev_id = dev->id; > > sm->platdata = dev_get_platdata(&dev->dev); > > + if (!sm->platdata) { > > + of_property_read_u32(dev->dev.of_node, "smi,devices", > > + (u32 *)&private_initdata.devices); > > + private_platdata.init = &private_initdata; > > + sm->platdata = &private_platdata; > > + } > > This is still really horrible. > > Where is this platform data consumed? > > > ret = platform_get_irq(dev, 0); > > if (ret < 0) { > > -- > Lee Jones > Linaro STMicroelectronics Landing Team Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog -- Yoshinori Sato