From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932213AbcKHGTA (ORCPT ); Tue, 8 Nov 2016 01:19:00 -0500 Received: from mail1.bemta5.messagelabs.com ([195.245.231.145]:31209 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752158AbcKHGSz (ORCPT ); Tue, 8 Nov 2016 01:18:55 -0500 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAKsWRWlGSWpSXmKPExsUS3ulwWNcsTzH C4E+DkcXUh0/YLOYfOcdqce7VIxaL+1+PMlp8u9LBZDHlz3Imi83z/zBaXN41h81i6fWLTBat e4+wO3B5rJm3htFj56y77B6bVnWyedy5tofN4/MmuQDWKNbMvKT8igTWjNYHR5gKOoQrnk5dw 97A+EKoi5GTQ0hgMaPEhgmsIDabgIPE3vntYLaIQKbE7r73jF2MXBzMApOYJb7Pe80EkhAWsJ LYc2QGVJG1RPOUnWwQtpXE37WvmUFsFgEViQkrd4PFeQUCJF793cgCMkhI4CKjxIEX89hBEpw CgRJ39v8Bsjk4GIEavmziBwkzC4hL3HoyH2yXhICAxJI955khbFGJl4//sULYChLvX36DittL vL73jgXC1pc4N/0EO4RtKLFq2gGouLnE2tZlULa1xK2HO1hA1jILaEqs36UPsVZRYkr3Q3aIk wUlTs58wjKBUWIWkotmIXTMQtIxC0nHAkaWVYwaxalFZalFukZGeklFmekZJbmJmTm6hgamer mpxcWJ6ak5iUnFesn5uZsYgTFfz8DAuINxT7vfIUZJDiYlUd6UTQoRQnxJ+SmVGYnFGfFFpTm pxYcYZTg4lCR4JXMVI4QEi1LTUyvSMnOAyQcmLcHBoyTC+zMHKM1bXJCYW5yZDpE6xagoJc4b CdInAJLIKM2Da4MlvEuMslLCvIwMDAxCPAWpRbmZJajyrxjFORiVhHnZQKbwZOaVwE1/BbSYC WhxVYwCyOKSRISUVAMj2xUP5YelFpKhXv5Xq70tTu7iOX/snlLX9C0SrruVn83NZta2Mag5sW xR4BXZbSkSz4NMRarDjQunP16w+s5Dm0URTRz3P6Yk1Nz1T5p+dIrsqa93mRw6aope1/zwms+ y2l55U/F+jnJBm90NUy6USps2nAo6u9Si/p9pO5eL4LOpFpaPTSSVWIozEg21mIuKEwFBmyEZ cwMAAA== X-Env-Sender: eric.jeong.opensource@diasemi.com X-Msg-Ref: server-14.tower-178.messagelabs.com!1478585910!68821204!1 X-Originating-IP: [87.137.64.195] X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked From: Eric Hyeung Dong Jeong To: Linus Walleij , Eric Hyeung Dong Jeong CC: LINUX-KERNEL , Lee Jones , Alexandre Courbot , DEVICETREE , LINUX-GPIO , "Liam Girdwood" , Mark Brown , Mark Rutland , Rob Herring , Support Opensource Subject: RE: [PATCH V2 2/4] mfd: pv88080: MFD core support Thread-Topic: [PATCH V2 2/4] mfd: pv88080: MFD core support Thread-Index: AQHSL+7kf9Ty/KiYNkCrEuegZ6043KC9uhOAgBD1X3A= Date: Tue, 8 Nov 2016 06:18:28 +0000 Message-ID: <8FA4409277D6E54680546B8811D85410029DFAA33C@NB-EX-MBX01.diasemi.com> References: <6dcaf788e4ebffd5c753e5fc5ae67668f74f7c32.1477530195.git.eric.jeong@diasemi.com> In-Reply-To: Accept-Language: ko-KR, de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.95.25.239] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: NB-EX-CASHUB01.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 08.11.2016 03:52:00 x-exclaimer-md-config: 8d172408-bd6a-42b1-8e53-daaedf35a5af Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uA86J4aN005142 On Friday, October 28, 2016 9:18 PM, Linus Walleij wrote: > On Thu, Oct 27, 2016 at 3:03 AM, Eric Jeong > wrote: > > > +++ b/drivers/mfd/pv88080-i2c.c > > + > > +static const struct of_device_id pv88080_of_match_table[] = { > > + { .compatible = "pvs,pv88080", .data = (void *)TYPE_PV88080_AA }, > > + { .compatible = "pvs,pv88080-aa", .data = (void *)TYPE_PV88080_AA }, > > + { .compatible = "pvs,pv88080-ba", .data = (void *)TYPE_PV88080_BA }, > > + { }, > > +}; > > +MODULE_DEVICE_TABLE(of, pv88080_of_match_table); > > Actually you are doing something weird. > > The only thing you put in your device tree is this I guess. > > That means that the GPIO chip does *not* have a device tree entry, so you > cannot reference the GPIOs there with &phandle notation. > > Please look around a bit to see how other OF-MFDs do it: they register and > populate by struct mfd_cell using the .of_compatible member so that > subdevices get their own DT nodes, which is necessary for nodes providing > resources such as GPIOs, regulators and clocks, lest you cannot reference them > in your device tree! > > Therefore I think all your subdevices should instantiate from device tree with > compatible matching as well, not as platform devices. > > > +struct pv88080_pdata { > > + int (*init)(struct pv88080 *pv88080); > > + int irq_base; > > + int gpio_base; > > NAK. > > Get irq from the device tree, assign gpio base dynamically. > > > + struct regulator_init_data > > + *regulators[PV88080_MAX_REGULATORS]; > > I suspect also this should come from the device tree. > > Yours, > Linus Walleij Thank you for the comments. I will send patch again. Regards Eric