* [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver
@ 2013-03-05 15:26 Christophe Leroy
2013-03-22 8:38 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2013-03-05 15:26 UTC (permalink / raw)
To: Grant Likely, Linus Walleij; +Cc: linux-kernel, Patrick Vasseur
This patch allows the use of the MAX730x Driver on systems using
the Open Firmware platform format.
The bit_per_word can be set in the OF Device tree, so no need to force it as with
the platform_data.
Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
diff -ur linux-3.7.9/drivers/gpio/gpio-max7301.c linux/drivers/gpio/gpio-max7301.c
--- linux-3.7.9/drivers/gpio/gpio-max7301.c 2013-02-17 19:53:32.000000000 +0100
+++ linux/drivers/gpio/gpio-max7301.c 2013-02-17 12:57:40.000000000 +0100
@@ -56,7 +56,8 @@
int ret;
/* bits_per_word cannot be configured in platform data */
- spi->bits_per_word = 16;
+ if (spi->dev.platform_data)
+ spi->bits_per_word = 16;
ret = spi_setup(spi);
if (ret < 0)
return ret;
diff -ur linux-3.7.9/drivers/gpio/gpio-max730x.c linux/drivers/gpio/gpio-max730x.c
--- linux-3.7.9/drivers/gpio/gpio-max730x.c 2013-02-17 19:53:32.000000000 +0100
+++ linux/drivers/gpio/gpio-max730x.c 2013-02-22 10:15:46.000000000 +0100
@@ -163,12 +163,13 @@
int __devinit __max730x_probe(struct max7301 *ts)
{
struct device *dev = ts->dev;
+ struct device_node *np = dev->of_node;
struct max7301_platform_data *pdata;
int i, ret;
pdata = dev->platform_data;
- if (!pdata || !pdata->base) {
- dev_err(dev, "incorrect or missing platform data\n");
+ if ((!pdata || !pdata->base) && !np) {
+ dev_err(dev, "No platform data nor Device Tree found\n");
return -EINVAL;
}
@@ -178,7 +179,6 @@
/* Power up the chip and disable IRQ output */
ts->write(dev, 0x04, 0x01);
- ts->input_pullup_active = pdata->input_pullup_active;
ts->chip.label = dev->driver->name;
ts->chip.direction_input = max7301_direction_input;
@@ -186,7 +186,12 @@
ts->chip.direction_output = max7301_direction_output;
ts->chip.set = max7301_set;
- ts->chip.base = pdata->base;
+ if (pdata) {
+ ts->input_pullup_active = pdata->input_pullup_active;
+ ts->chip.base = pdata->base;
+ } else {
+ ts->chip.base = -1;
+ }
ts->chip.ngpio = PIN_NUMBER;
ts->chip.can_sleep = 1;
ts->chip.dev = dev;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver
2013-03-05 15:26 [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver Christophe Leroy
@ 2013-03-22 8:38 ` Linus Walleij
2013-03-22 12:12 ` christophe leroy
2013-03-22 12:14 ` christophe leroy
0 siblings, 2 replies; 4+ messages in thread
From: Linus Walleij @ 2013-03-22 8:38 UTC (permalink / raw)
To: Christophe Leroy; +Cc: Grant Likely, linux-kernel, Patrick Vasseur
On Tue, Mar 5, 2013 at 4:26 PM, Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> This patch allows the use of the MAX730x Driver on systems using
> the Open Firmware platform format.
> The bit_per_word can be set in the OF Device tree, so no need to force it as with
> the platform_data.
>
> Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
I tried applying this but it fails. Can you send based on e.g.
v3.9-rc3 or so?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver
2013-03-22 8:38 ` Linus Walleij
@ 2013-03-22 12:12 ` christophe leroy
2013-03-22 12:14 ` christophe leroy
1 sibling, 0 replies; 4+ messages in thread
From: christophe leroy @ 2013-03-22 12:12 UTC (permalink / raw)
To: Linus Walleij; +Cc: Grant Likely, linux-kernel, Patrick Vasseur
Le 22/03/2013 09:38, Linus Walleij a écrit :
> On Tue, Mar 5, 2013 at 4:26 PM, Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>
>> This patch allows the use of the MAX730x Driver on systems using
>> the Open Firmware platform format.
>> The bit_per_word can be set in the OF Device tree, so no need to force it as with
>> the platform_data.
>>
>> Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> I tried applying this but it fails. Can you send based on e.g.
> v3.9-rc3 or so?
Ok, part of it was already in 3.8
Made a new one based on 3.8.4
I checked it against 3.9-rc3, it is OK
NB: I changed the patch subject name
Regards
Christophe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver
2013-03-22 8:38 ` Linus Walleij
2013-03-22 12:12 ` christophe leroy
@ 2013-03-22 12:14 ` christophe leroy
1 sibling, 0 replies; 4+ messages in thread
From: christophe leroy @ 2013-03-22 12:14 UTC (permalink / raw)
To: Linus Walleij; +Cc: Grant Likely, linux-kernel, Patrick Vasseur
Le 22/03/2013 09:38, Linus Walleij a écrit :
> On Tue, Mar 5, 2013 at 4:26 PM, Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>
>> This patch allows the use of the MAX730x Driver on systems using
>> the Open Firmware platform format.
>> The bit_per_word can be set in the OF Device tree, so no need to force it as with
>> the platform_data.
>>
>> Signed-off-by: Patrick Vasseur <patrick.vasseur@c-s.fr>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> I tried applying this but it fails. Can you send based on e.g.
> v3.9-rc3 or so?
Ok, part of it was already in 3.8
Made a new one based on 3.8.4
I checked it against 3.9-rc3, it is OK
NB: I changed the patch subject name
Regards
Christophe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-22 12:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 15:26 [PATCH v2] Adds support for Open Firmware in MAX730x GPIO Driver Christophe Leroy
2013-03-22 8:38 ` Linus Walleij
2013-03-22 12:12 ` christophe leroy
2013-03-22 12:14 ` christophe leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox