* [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity
@ 2011-10-11 9:45 Hartmut Knaack
2011-10-13 19:35 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Hartmut Knaack @ 2011-10-11 9:45 UTC (permalink / raw)
To: Grant Likely; +Cc: linux-kernel
Sorry, I messed up the porting from my work files to clean git repo.
This should be right now.
Inspired by the gpio-pcf857x driver, this patch will output information
about the instantiated gpio-chip, including gpio start and end, chip
type and if irq is used.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
-------------------------------------------------------------
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 0721d85..f1a4fad 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -687,6 +687,12 @@ static int __devinit pca953x_probe(struct
i2c_client *client,
if (ret)
goto out_failed_irq;
+ dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
+ chip->gpio_chip.base,
+ chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
+ client->name,
+ client->irq ? " (irq ignored)" : "");
+
if (pdata && pdata->setup) {
ret = pdata->setup(client, chip->gpio_chip.base,
chip->gpio_chip.ngpio, pdata->context);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity
2011-10-11 9:45 [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity Hartmut Knaack
@ 2011-10-13 19:35 ` Grant Likely
2011-10-13 21:46 ` Hartmut Knaack
0 siblings, 1 reply; 4+ messages in thread
From: Grant Likely @ 2011-10-13 19:35 UTC (permalink / raw)
To: Hartmut Knaack; +Cc: linux-kernel
On Tue, Oct 11, 2011 at 11:45:56AM +0200, Hartmut Knaack wrote:
> Sorry, I messed up the porting from my work files to clean git repo.
> This should be right now.
> Inspired by the gpio-pcf857x driver, this patch will output information
> about the instantiated gpio-chip, including gpio start and end, chip
> type and if irq is used.
>
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
> -------------------------------------------------------------
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 0721d85..f1a4fad 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -687,6 +687,12 @@ static int __devinit pca953x_probe(struct
> i2c_client *client,
> if (ret)
> goto out_failed_irq;
>
> + dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
> + chip->gpio_chip.base,
> + chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
> + client->name,
> + client->irq ? " (irq ignored)" : "");
> +
dev_dbg() for this I think.
> if (pdata && pdata->setup) {
> ret = pdata->setup(client, chip->gpio_chip.base,
> chip->gpio_chip.ngpio, pdata->context);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity
2011-10-13 19:35 ` Grant Likely
@ 2011-10-13 21:46 ` Hartmut Knaack
2011-10-13 22:36 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Hartmut Knaack @ 2011-10-13 21:46 UTC (permalink / raw)
To: Grant Likely; +Cc: linux-kernel
Grant Likely schrieb:
> On Tue, Oct 11, 2011 at 11:45:56AM +0200, Hartmut Knaack wrote:
>> Sorry, I messed up the porting from my work files to clean git repo.
>> This should be right now.
>> Inspired by the gpio-pcf857x driver, this patch will output information
>> about the instantiated gpio-chip, including gpio start and end, chip
>> type and if irq is used.
>>
>> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
>> -------------------------------------------------------------
>> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
>> index 0721d85..f1a4fad 100644
>> --- a/drivers/gpio/gpio-pca953x.c
>> +++ b/drivers/gpio/gpio-pca953x.c
>> @@ -687,6 +687,12 @@ static int __devinit pca953x_probe(struct
>> i2c_client *client,
>> if (ret)
>> goto out_failed_irq;
>>
>> + dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
>> + chip->gpio_chip.base,
>> + chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
>> + client->name,
>> + client->irq ? " (irq ignored)" : "");
>> +
> dev_dbg() for this I think.
A short look into all other gpio drivers revealed which functions are normally used for that purpose:
pr_info: gpio-xilinx
dev_info: gpio-pcf857x, gpio-nomadik, gpio-janz-ttl, gpio-cs5535, gpio-adp5588
printk: gpio-bt8xx
I took that one from the pcf857x driver, but personally I also think that info is an appropriate verbosity level.
Empowered by Ryan Mallon's comment I thought about removing those functions from gpio driver code and move it to gpiochip_add function. This way reducing redundancy and improving uniformity. It's just 7 drivers + gpiolib, which need to be changed. What do you think?
>> if (pdata && pdata->setup) {
>> ret = pdata->setup(client, chip->gpio_chip.base,
>> chip->gpio_chip.ngpio, pdata->context);
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity
2011-10-13 21:46 ` Hartmut Knaack
@ 2011-10-13 22:36 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-10-13 22:36 UTC (permalink / raw)
To: Hartmut Knaack; +Cc: linux-kernel
On Thu, Oct 13, 2011 at 11:46:24PM +0200, Hartmut Knaack wrote:
> Grant Likely schrieb:
> > On Tue, Oct 11, 2011 at 11:45:56AM +0200, Hartmut Knaack wrote:
> >> Sorry, I messed up the porting from my work files to clean git repo.
> >> This should be right now.
> >> Inspired by the gpio-pcf857x driver, this patch will output information
> >> about the instantiated gpio-chip, including gpio start and end, chip
> >> type and if irq is used.
> >>
> >> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
> >> -------------------------------------------------------------
> >> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> >> index 0721d85..f1a4fad 100644
> >> --- a/drivers/gpio/gpio-pca953x.c
> >> +++ b/drivers/gpio/gpio-pca953x.c
> >> @@ -687,6 +687,12 @@ static int __devinit pca953x_probe(struct
> >> i2c_client *client,
> >> if (ret)
> >> goto out_failed_irq;
> >>
> >> + dev_info(&client->dev, "gpios %d..%d added on a %s%s\n",
> >> + chip->gpio_chip.base,
> >> + chip->gpio_chip.base + chip->gpio_chip.ngpio - 1,
> >> + client->name,
> >> + client->irq ? " (irq ignored)" : "");
> >> +
> > dev_dbg() for this I think.
> A short look into all other gpio drivers revealed which functions are normally used for that purpose:
> pr_info: gpio-xilinx
> dev_info: gpio-pcf857x, gpio-nomadik, gpio-janz-ttl, gpio-cs5535, gpio-adp5588
> printk: gpio-bt8xx
> I took that one from the pcf857x driver, but personally I also think that info is an appropriate verbosity level.
> Empowered by Ryan Mallon's comment I thought about removing those functions from gpio driver code and move it to gpiochip_add function. This way reducing redundancy and improving uniformity. It's just 7 drivers + gpiolib, which need to be changed. What do you think?
> >> if (pdata && pdata->setup) {
> >> ret = pdata->setup(client, chip->gpio_chip.base,
> >> chip->gpio_chip.ngpio, pdata->context);
> >>
Draft a patch and we'll see what it looks like.
g.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-13 22:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11 9:45 [Patch V2 2/2] gpio-pca953x: fix gpio_base and add verbosity Hartmut Knaack
2011-10-13 19:35 ` Grant Likely
2011-10-13 21:46 ` Hartmut Knaack
2011-10-13 22:36 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox