All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [patch 1/6] gpiolib: introduce chip addition/removal notifier
       [not found]           ` <n2yfa686aa41004302350i32d385e7gc00b49f39de417cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-05-02 16:59             ` Anton Vorontsov
       [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2010-05-02 16:59 UTC (permalink / raw)
  To: Grant Likely
  Cc: bgat-uPd5UNENI//N9NzbbXoYwQ, dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	khali-PUYAD+kWke1g9hUCZPvPmw,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

(Cc'ing devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org)

On Sat, May 01, 2010 at 12:50:15AM -0600, Grant Likely wrote:
> Not till now.  Here's what I've been working on.  It's based on my
> test-devicetree branch.
[...]
> As you can see, I've pretty much come full circle on the adding
> 'automatic' OF support to gpio chips.  Originally (as you well know) I
> was strongly opposed to any addition of OF code to the core gpiolib.
> All of the notifier work was a response to that.
> 
> However, now that I actually have played with the code and looked and
> the issues deeply, I've got an entirely different opinion.

ROFL :-D

> (The fact
> that OF support is being ported to more architectures is also a
> factor.)

Yeah, I guess without multi-arch OF effort such an OF+gpiolib
integration would be very dubious. But as OF spreads to other
architectures, and we already have of_node in the 'struct
device'... I guess that makes sense now.

> Anyway, please take a look.

It works here with some small fixes (patches on the way).

Tested with MCU (I2C), and QE GPIO (memory mapped) GPIO controllers.

Thanks!

-- 
Anton Vorontsov
email: cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
irc://irc.freenode.net/bd2

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

* [PATCH 1/3] powerpc/83xx/mcu: Add OF match table
       [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
@ 2010-05-02 17:00                 ` Anton Vorontsov
  2010-05-02 17:00                 ` [PATCH 2/3] serial/ucc_uart: Use .dev.of_node instead of .node in struct of_device Anton Vorontsov
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2010-05-02 17:00 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

of_modalias_node() matches on the first (most specific) entries,
which isn't quite practical but it was discussed that this won't
change.

The bindings specifies verbose information for the devices, but
it doesn't fit in the I2C ID's 20 characters limit. The limit won't
change, and the bindings won't change either as they're correct.

So we have to put an explicit OF matching table for the
MPC8349E-mITX-compatible MCUs.

(Previously this was in the OF exception table, see commit
4c3ed7d61bd474380e0d3e1eb0da164942f7c84e.)

Signed-off-by: Anton Vorontsov <avorontsov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 59b0ed1..70798ac 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -160,10 +160,16 @@ static const struct i2c_device_id mcu_ids[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mcu_ids);
 
+static struct of_device_id mcu_of_match_table[] __devinitdata = {
+	{ .compatible = "fsl,mcu-mpc8349emitx", },
+	{ },
+};
+
 static struct i2c_driver mcu_driver = {
 	.driver = {
 		.name = "mcu-mpc8349emitx",
 		.owner = THIS_MODULE,
+		.of_match_table = mcu_of_match_table,
 	},
 	.probe = mcu_probe,
 	.remove	= __devexit_p(mcu_remove),
-- 
1.7.0.5

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

* [PATCH 2/3] serial/ucc_uart: Use .dev.of_node instead of .node in struct of_device
       [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
  2010-05-02 17:00                 ` [PATCH 1/3] powerpc/83xx/mcu: Add OF match table Anton Vorontsov
@ 2010-05-02 17:00                 ` Anton Vorontsov
  2010-05-02 17:00                 ` [PATCH 3/3] USB: FHCI: " Anton Vorontsov
  2010-05-02 19:34                 ` [patch 1/6] gpiolib: introduce chip addition/removal notifier Grant Likely
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2010-05-02 17:00 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Fixes following build failure:

drivers/serial/ucc_uart.c: In function 'ucc_uart_probe':
drivers/serial/ucc_uart.c:1200: error: 'struct platform_device' has no member named 'node'

Signed-off-by: Anton Vorontsov <avorontsov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
---
 drivers/serial/ucc_uart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index fce07be..907b06f 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -1197,7 +1197,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
 static int ucc_uart_probe(struct of_device *ofdev,
 	const struct of_device_id *match)
 {
-	struct device_node *np = ofdev->node;
+	struct device_node *np = ofdev->dev.of_node;
 	const unsigned int *iprop;      /* Integer OF properties */
 	const char *sprop;      /* String OF properties */
 	struct uart_qe_port *qe_port = NULL;
-- 
1.7.0.5

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

* [PATCH 3/3] USB: FHCI: Use .dev.of_node instead of .node in struct of_device
       [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
  2010-05-02 17:00                 ` [PATCH 1/3] powerpc/83xx/mcu: Add OF match table Anton Vorontsov
  2010-05-02 17:00                 ` [PATCH 2/3] serial/ucc_uart: Use .dev.of_node instead of .node in struct of_device Anton Vorontsov
@ 2010-05-02 17:00                 ` Anton Vorontsov
  2010-05-02 19:34                 ` [patch 1/6] gpiolib: introduce chip addition/removal notifier Grant Likely
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Vorontsov @ 2010-05-02 17:00 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Fixes following build failure:

drivers/usb/host/fhci-hcd.c: In function 'of_fhci_probe':
drivers/usb/host/fhci-hcd.c:568: error: 'struct platform_device' has no member named 'node'
drivers/usb/host/fhci-hcd.c:673: error: 'struct platform_device' has no member named 'node'

Signed-off-by: Anton Vorontsov <avorontsov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
---
 drivers/usb/host/fhci-hcd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 84adca4..7b5c626 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -565,7 +565,7 @@ static int __devinit of_fhci_probe(struct of_device *ofdev,
 				   const struct of_device_id *ofid)
 {
 	struct device *dev = &ofdev->dev;
-	struct device_node *node = ofdev->node;
+	struct device_node *node = dev->of_node;
 	struct usb_hcd *hcd;
 	struct fhci_hcd *fhci;
 	struct resource usb_regs;
@@ -670,7 +670,7 @@ static int __devinit of_fhci_probe(struct of_device *ofdev,
 	}
 
 	for (j = 0; j < NUM_PINS; j++) {
-		fhci->pins[j] = qe_pin_request(ofdev->node, j);
+		fhci->pins[j] = qe_pin_request(node, j);
 		if (IS_ERR(fhci->pins[j])) {
 			ret = PTR_ERR(fhci->pins[j]);
 			dev_err(dev, "can't get pin %d: %d\n", j, ret);
-- 
1.7.0.5

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

* Re: [patch 1/6] gpiolib: introduce chip addition/removal notifier
       [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
                                   ` (2 preceding siblings ...)
  2010-05-02 17:00                 ` [PATCH 3/3] USB: FHCI: " Anton Vorontsov
@ 2010-05-02 19:34                 ` Grant Likely
  3 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2010-05-02 19:34 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: bgat-uPd5UNENI//N9NzbbXoYwQ, dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	khali-PUYAD+kWke1g9hUCZPvPmw,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

On Sun, May 2, 2010 at 10:59 AM, Anton Vorontsov <cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> (Cc'ing devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org)
>
> On Sat, May 01, 2010 at 12:50:15AM -0600, Grant Likely wrote:
>> Not till now.  Here's what I've been working on.  It's based on my
>> test-devicetree branch.
> [...]
>> As you can see, I've pretty much come full circle on the adding
>> 'automatic' OF support to gpio chips.  Originally (as you well know) I
>> was strongly opposed to any addition of OF code to the core gpiolib.
>> All of the notifier work was a response to that.
>>
>> However, now that I actually have played with the code and looked and
>> the issues deeply, I've got an entirely different opinion.
>
> ROFL :-D
>
>> (The fact
>> that OF support is being ported to more architectures is also a
>> factor.)
>
> Yeah, I guess without multi-arch OF effort such an OF+gpiolib
> integration would be very dubious. But as OF spreads to other
> architectures, and we already have of_node in the 'struct
> device'... I guess that makes sense now.
>
>> Anyway, please take a look.
>
> It works here with some small fixes (patches on the way).

Thanks Anton.  I'll look for them and pick them up.

g.

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

end of thread, other threads:[~2010-05-02 19:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201004272111.o3RLBw1f020037@imap1.linux-foundation.org>
     [not found] ` <1272428830.24542.72.camel@pasglop>
     [not found]   ` <20100430174240.GA29769@oksana.dev.rtsoft.ru>
     [not found]     ` <s2ifa686aa41004301043uca9bfbafz6db2402bfa233de4@mail.gmail.com>
     [not found]       ` <20100430174609.GA31455@oksana.dev.rtsoft.ru>
     [not found]         ` <n2yfa686aa41004302350i32d385e7gc00b49f39de417cb@mail.gmail.com>
     [not found]           ` <n2yfa686aa41004302350i32d385e7gc00b49f39de417cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-02 16:59             ` [patch 1/6] gpiolib: introduce chip addition/removal notifier Anton Vorontsov
     [not found]               ` <20100502165912.GA11300-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2010-05-02 17:00                 ` [PATCH 1/3] powerpc/83xx/mcu: Add OF match table Anton Vorontsov
2010-05-02 17:00                 ` [PATCH 2/3] serial/ucc_uart: Use .dev.of_node instead of .node in struct of_device Anton Vorontsov
2010-05-02 17:00                 ` [PATCH 3/3] USB: FHCI: " Anton Vorontsov
2010-05-02 19:34                 ` [patch 1/6] gpiolib: introduce chip addition/removal notifier Grant Likely

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.