From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:10:05
Scope of the change is limited to GPIO pins used by board specific
device drivers which will be updated by follow-up patches of the
series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta
latch2 GPIO bank pins. Remaining pins of those banks, as well as
Amstrad Delta latch1 pins, will be addressed later.
Assign a label ("latch2") to the bank, enumerate its pins and put that
information, together with OMAP GPIO bank pins, in GPIO lookup tables.
Assign lookup tables to devices as soon as those devices are registered
and their names can be obtained.
A step froward in:
- removal of hard-coded GPIO numbers from drivers,
- removal of board mach includes from drivers,
- switching to dynamically assigned GPIO numbers.
Created and compile tested agains linux-4.17-rc3
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
arch/arm/mach-omap1/board-ams-delta.c | 102 ++++++++++++++++++++++++++++++++++
1 file changed, 102 insertions(+)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:10:13
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ functions with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/input/serio/ams_delta_serio.c | 98 +++++++++++++++++++----------------
1 file changed, 53 insertions(+), 45 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:10:17
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
The card uses two pins, one for jack and the other for voice modem
codec DAI control.
For jack pin, remove hardcoded GPIO number and use GPIO descriptor
based variant of jack GPIO initialization.
For modem_codec pin, declare static variable for storing its GPIO
descriptor, obtain it on card initialization and replace obsolete
ams_delta_latch2_write() with gpiod_set_value(). For that to work,
don't request the modem_codec pin from the board init code anymore.
If the modem_codec GPIO lookup fails, skip initialization of
functionality of the card which depends on its availability.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
arch/arm/mach-omap1/board-ams-delta.c | 5 -----
sound/soc/omap/ams-delta.c | 38 +++++++++++++++++++----------------
2 files changed, 21 insertions(+), 22 deletions(-)
@@ -272,7 +271,7 @@ static void cx81801_timeout(struct timer_list *unused)/* Reconnect the codec DAI back from the modem to the CPU DAI*onlyifdigitalmutestilloff*/if(!muted)-ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,0);+gpiod_set_value(gpiod_modem_codec,0);}/* Line discipline .open() */
@@ -381,8 +380,7 @@ static void cx81801_receive(struct tty_struct *tty,/* Apply config pulse by connecting the codec to the modem*ifnotalreadydone*/if(apply)-ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,-AMS_DELTA_LATCH2_MODEM_CODEC);+gpiod_set_value(gpiod_modem_codec,1);break;}}
@@ -432,8 +430,7 @@ static int ams_delta_digital_mute(struct snd_soc_dai *dai, int mute)spin_unlock_bh(&ams_delta_lock);if(apply)-ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,-mute?AMS_DELTA_LATCH2_MODEM_CODEC:0);+gpiod_set_value(gpiod_modem_codec,!!mute);return0;}
@@ -469,14 +466,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)/* Store a pointer to the codec structure for tty ldisc use */cx20442_codec=rtd->codec_dai->component;-/* Set up digital mute if not provided by the codec */-if(!codec_dai->driver->ops){-codec_dai->driver->ops=&ams_delta_dai_ops;-}else{-ams_delta_ops.startup=ams_delta_startup;-ams_delta_ops.shutdown=ams_delta_shutdown;-}-/* Add hook switch - can be used to control the codec from userspace*eveniflinedisciplinefails*/ret=snd_soc_card_jack_new(card,"hook_switch",SND_JACK_HEADSET,
@@ -486,7 +475,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)"Failed to allocate resources for hook switch, ""will continue without one.\n");else{-ret=snd_soc_jack_add_gpios(&ams_delta_hook_switch,+ret=snd_soc_jack_add_gpiods(card->dev,&ams_delta_hook_switch,ARRAY_SIZE(ams_delta_hook_switch_gpios),ams_delta_hook_switch_gpios);if(ret)
@@ -495,6 +484,21 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)"will continue with hook switch inactive.\n");}+gpiod_modem_codec=devm_gpiod_get(card->dev,"modem_codec",+GPIOD_OUT_HIGH);+if(IS_ERR(gpiod_modem_codec)){+dev_warn(card->dev,"Failed to obtain modem_codec GPIO\n");+return0;+}++/* Set up digital mute if not provided by the codec */+if(!codec_dai->driver->ops){+codec_dai->driver->ops=&ams_delta_dai_ops;+}else{+ams_delta_ops.startup=ams_delta_startup;+ams_delta_ops.shutdown=ams_delta_shutdown;+}+/* Register optional line discipline for over the modem control */ret=tty_register_ldisc(N_V253,&cx81801_ops);if(ret){
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:10:24
Now as the AMS Delta board header file is no longer included by
drivers, move it to the root directory of mach-omap1.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2 +-
arch/arm/mach-omap1/ams-delta-fiq.c | 3 +--
arch/arm/mach-omap1/board-ams-delta.c | 2 +-
arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h | 0
4 files changed, 3 insertions(+), 4 deletions(-)
rename arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h (100%)
diff --git a/arch/arm/mach-omap1/include/mach/board-ams-delta.h b/arch/arm/mach-omap1/board-ams-delta.hsimilarity index 100%rename from arch/arm/mach-omap1/include/mach/board-ams-delta.hrename to arch/arm/mach-omap1/board-ams-delta.h
--
2.16.1
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:10:41
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ functions with their gpiod_ equivalents. Return -EPROBE_DEFER
if the GPIO pins are not yet available so device initialization is
postponed instead of aborted.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/mtd/nand/raw/ams-delta.c | 110 +++++++++++++++++++++------------------
1 file changed, 58 insertions(+), 52 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 21:11:13
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ functions with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be postponed
instead of aborted if the GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/video/fbdev/omap/lcd_ams_delta.c | 59 ++++++++++++++------------------
1 file changed, 26 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-18 23:15:29
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is optional.
That's why I decided to use the _optional variant of devm_gpiod_get(). In case
of ams-delta, the dev_ready() callback depends on availability of the 'rdy'
GPIO pin. As a consequence, I'm checking for both NULL and ERR in order to
decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for ERR only if
the purpose of the _optional form is different.
Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not
availble before device init phase, unlike other crucial GPIO drivers which are
initialized earlier, e.g. during the postcore or at latetst the subsys phase.
Hence, devices which depend on GPIO pins provided by gpio-mmio must either be
declared late or fail softly so they get another chance of being probed
succesfully.
I thought of replacing the gpio-mmio platform driver with bgpio functions it
exports but for now I haven't implemented it, not even shared the idea.
Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be obtained?
Thanks,
Janusz
From: Andy Shevchenko <hidden> Date: 2018-05-19 18:00:43
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref] wrote:
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is optional.
That's why I decided to use the _optional variant of devm_gpiod_get(). In case
of ams-delta, the dev_ready() callback depends on availability of the 'rdy'
GPIO pin. As a consequence, I'm checking for both NULL and ERR in order to
decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for ERR only if
the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not
availble before device init phase, unlike other crucial GPIO drivers which are
initialized earlier, e.g. during the postcore or at latetst the subsys phase.
Hence, devices which depend on GPIO pins provided by gpio-mmio must either be
declared late or fail softly so they get another chance of being probed
succesfully.
I thought of replacing the gpio-mmio platform driver with bgpio functions it
exports but for now I haven't implemented it, not even shared the idea.
Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be obtained?
I'm only concerned if it would be an infinite defer in the case when
driver will never appear.
But I don't remember the details.
--
With Best Regards,
Andy Shevchenko
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-19 21:55:49
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref]
wrote:
quoted
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is optional.
That's why I decided to use the _optional variant of devm_gpiod_get(). In
case of ams-delta, the dev_ready() callback depends on availability of
the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and ERR
in order to decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for ERR only
if the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
+ dev_warn(&pdev->dev, "RDY GPIO request failed (%d)\n", err);
+ goto err_gpiod;
}
+ if (priv->gpiod_rdy)
+ this->dev_ready = ams_delta_nand_ready;
Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not
availble before device init phase, unlike other crucial GPIO drivers which
are initialized earlier, e.g. during the postcore or at latetst the
subsys phase. Hence, devices which depend on GPIO pins provided by
gpio-mmio must either be declared late or fail softly so they get another
chance of being probed succesfully.
I thought of replacing the gpio-mmio platform driver with bgpio functions
it exports but for now I haven't implemented it, not even shared the
idea.
Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be
obtained?
I'm only concerned if it would be an infinite defer in the case when
driver will never appear.
But I don't remember the details.
Deferred probes are handled effectively during late_initcall, no risk of
infinite defer, see drivers/base/dd.c for details.
Thanks,
Janusz
From: Andy Shevchenko <hidden> Date: 2018-05-20 14:44:36
On Sun, May 20, 2018 at 12:55 AM, Janusz Krzysztofik
[off-list ref] wrote:
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref]
wrote:
quoted
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
+ dev_warn(&pdev->dev, "RDY GPIO request failed (%d)\n", err);
+ goto err_gpiod;
}
+ if (priv->gpiod_rdy)
+ this->dev_ready = ams_delta_nand_ready;
This makes sense.
Though, I completely dislike "rdy" name of GPIO. Where is it documented?
Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not
availble before device init phase, unlike other crucial GPIO drivers which
are initialized earlier, e.g. during the postcore or at latetst the
subsys phase. Hence, devices which depend on GPIO pins provided by
gpio-mmio must either be declared late or fail softly so they get another
chance of being probed succesfully.
I thought of replacing the gpio-mmio platform driver with bgpio functions
it exports but for now I haven't implemented it, not even shared the
idea.
Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be
obtained?
I'm only concerned if it would be an infinite defer in the case when
driver will never appear.
But I don't remember the details.
Deferred probes are handled effectively during late_initcall, no risk of
infinite defer, see drivers/base/dd.c for details.
Yes, but the code you provided in patch looks somehow suspicious. OK,
I let Linus decide whtat to do with that.
--
With Best Regards,
Andy Shevchenko
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-20 15:37:48
On Sunday, May 20, 2018 4:44:31 PM CEST Andy Shevchenko wrote:
On Sun, May 20, 2018 at 12:55 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref]
wrote:
quoted
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND
ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
+ dev_warn(&pdev->dev, "RDY GPIO request failed (%d)\n",
err); + goto err_gpiod;
}
+ if (priv->gpiod_rdy)
+ this->dev_ready = ams_delta_nand_ready;
This makes sense.
Though, I completely dislike "rdy" name of GPIO. Where is it documented?
No documentation files for Amstrad Delta nor for its NAND driver specifically
exist under Documentation/. However, there exist some for generic GPIO NAND
driver where the pin name "rdy" is used explicitly:
Documentation/driver-api/gpio/drivers-on-gpio.rst
Documentation/devicetree/bindings/mtd/gpio-control-nand.txt
You can find that mnemonic used across drivers/mtd/nand/, standalone or as a
suffix, including the Amstrad Delta NAND driver before the change discussed.
To be honest, I don't like it much either, but I'm just using it instead of
inventing something new.
Thanks,
Janusz
From: Andy Shevchenko <hidden> Date: 2018-05-20 16:17:09
On Sun, May 20, 2018 at 6:37 PM, Janusz Krzysztofik [off-list ref] wrote:
On Sunday, May 20, 2018 4:44:31 PM CEST Andy Shevchenko wrote:
quoted
Though, I completely dislike "rdy" name of GPIO. Where is it documented?
No documentation files for Amstrad Delta nor for its NAND driver specifically
exist under Documentation/. However, there exist some for generic GPIO NAND
driver where the pin name "rdy" is used explicitly:
Documentation/driver-api/gpio/drivers-on-gpio.rst
Documentation/devicetree/bindings/mtd/gpio-control-nand.txt
You can find that mnemonic used across drivers/mtd/nand/, standalone or as a
suffix, including the Amstrad Delta NAND driver before the change discussed.
To be honest, I don't like it much either, but I'm just using it instead of
inventing something new.
OK, that's what I was looking for. Since it's already in use and
documented, then it's fine for me.
--
With Best Regards,
Andy Shevchenko
From: Ladislav Michl <hidden> Date: 2018-05-20 19:27:11
On Sat, May 19, 2018 at 11:55:51PM +0200, Janusz Krzysztofik wrote:
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref]
wrote:
quoted
quoted
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is optional.
That's why I decided to use the _optional variant of devm_gpiod_get(). In
case of ams-delta, the dev_ready() callback depends on availability of
the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and ERR
in order to decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for ERR only
if the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
Amstrad Delta uses gpio-mmio driver. Unfortunatelty that driver is not
availble before device init phase, unlike other crucial GPIO drivers which
are initialized earlier, e.g. during the postcore or at latetst the
subsys phase. Hence, devices which depend on GPIO pins provided by
gpio-mmio must either be declared late or fail softly so they get another
chance of being probed succesfully.
I thought of replacing the gpio-mmio platform driver with bgpio functions
it exports but for now I haven't implemented it, not even shared the
idea.
Does it really hurt to return -EPROBE_DEFER if a GPIO pin can't be
obtained?
I'm only concerned if it would be an infinite defer in the case when
driver will never appear.
But I don't remember the details.
Deferred probes are handled effectively during late_initcall, no risk of
infinite defer, see drivers/base/dd.c for details.
Thanks,
Janusz
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Sun, May 20, 2018 at 09:27:05PM +0200, Ladislav Michl wrote:
On Sat, May 19, 2018 at 11:55:51PM +0200, Janusz Krzysztofik wrote:
quoted
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik [off-list ref]
wrote:
quoted
quoted
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is optional.
That's why I decided to use the _optional variant of devm_gpiod_get(). In
case of ams-delta, the dev_ready() callback depends on availability of
the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and ERR
in order to decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for ERR only
if the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
Driver will just use worst case delay instead of RDY signal, so this
is perhaps too strict. I will work with degraded performance.
If RDY signal is not available then the board should not define it.
Degrading performance and having users wondering because RDY is
sometimes not available is not great. Especially if we get -EPROBE_DEFER
here.
Thanks.
--
Dmitry
Hi Janusz,
On Fri, May 18, 2018 at 11:09:50PM +0200, Janusz Krzysztofik wrote:
quoted hunk
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ functions with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/input/serio/ams_delta_serio.c | 98 +++++++++++++++++++----------------
1 file changed, 53 insertions(+), 45 deletions(-)
@@ -36,6 +35,10 @@ MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver");MODULE_LICENSE("GPL");staticstructserio*ams_delta_serio;+staticstructgpio_desc*gpiod_data;+staticstructgpio_desc*gpiod_clock;+staticstructgpio_desc*gpiod_power;+staticstructgpio_desc*gpiod_dataout;
Since you are doing the conversion: it does not appear that all these
are necessarily GPIOs; for example should not power be gpio-regulator
and data be simply expressed as IRQ resource? And the driver to be
converted into a platform driver?
I think this needs to be done first, because otherwise you are
committing to a certain binding and will have hard time changing it
later.
Thanks.
From: Mark Brown <broonie@kernel.org> Date: 2018-05-21 10:05:22
On Fri, May 18, 2018 at 11:09:51PM +0200, Janusz Krzysztofik wrote:
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
From: Tony Lindgren <tony@atomide.com> Date: 2018-05-21 17:35:28
Hi,
* Janusz Krzysztofik [off-list ref] [180518 14:12]:
Scope of the change is limited to GPIO pins used by board specific
device drivers which will be updated by follow-up patches of the
series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta
latch2 GPIO bank pins. Remaining pins of those banks, as well as
Amstrad Delta latch1 pins, will be addressed later.
Assign a label ("latch2") to the bank, enumerate its pins and put that
information, together with OMAP GPIO bank pins, in GPIO lookup tables.
Assign lookup tables to devices as soon as those devices are registered
and their names can be obtained.
A step froward in:
- removal of hard-coded GPIO numbers from drivers,
- removal of board mach includes from drivers,
- switching to dynamically assigned GPIO numbers.
Is this first patch safe for me to apply separately?
Regards,
Tony
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-21 18:10:37
On Monday, May 21, 2018 7:35:19 PM CEST Tony Lindgren wrote:
Hi,
* Janusz Krzysztofik [off-list ref] [180518 14:12]:
quoted
Scope of the change is limited to GPIO pins used by board specific
device drivers which will be updated by follow-up patches of the
series. Those are some OMAP GPIO (gpio-0-15) and most of Amstrad Delta
latch2 GPIO bank pins. Remaining pins of those banks, as well as
Amstrad Delta latch1 pins, will be addressed later.
Assign a label ("latch2") to the bank, enumerate its pins and put that
information, together with OMAP GPIO bank pins, in GPIO lookup tables.
Assign lookup tables to devices as soon as those devices are registered
and their names can be obtained.
A step froward in:
- removal of hard-coded GPIO numbers from drivers,
- removal of board mach includes from drivers,
- switching to dynamically assigned GPIO numbers.
Is this first patch safe for me to apply separately?
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-21 20:21:39
On Sunday, May 20, 2018 10:08:22 PM CEST Dmitry Torokhov wrote:
On Sun, May 20, 2018 at 09:27:05PM +0200, Ladislav Michl wrote:
quoted
On Sat, May 19, 2018 at 11:55:51PM +0200, Janusz Krzysztofik wrote:
quoted
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik
[off-list ref]
wrote:
quoted
quoted
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is
optional.
That's why I decided to use the _optional variant of
devm_gpiod_get(). In
case of ams-delta, the dev_ready() callback depends on availability
of
the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and
ERR
in order to decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for
ERR only
if the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
Driver will just use worst case delay instead of RDY signal, so this
is perhaps too strict. I will work with degraded performance.
If RDY signal is not available then the board should not define it.
Degrading performance and having users wondering because RDY is
sometimes not available is not great. Especially if we get -EPROBE_DEFER
here.
Hi,
I'm a bit lost after your comments.
As far as I can read the code of gpiod_get_optional and underlying functions,
if a board doesn't define the "rdy" pin in a respective lookup table, the
function returns NULL and the device gets a chance to work in degraded mode.
NULL may also happen if the driver probes the device before the lookup table
is added. In that case other non-optional pin requests fail with -ENOENT, the
probe is deferred and the device gets a chance to probe successfully in
late_init if the table is added but fails if not.
If the pin is defined but GPIO device providing that pin is not available
(-ENODEV), the probe is initially deferred and may succeed in late_init if the
GPIO device appears but fails otherwise.
Isn't that behavior acceptable, close enough to the expected even if not
strictly because of that -EPROBE_DEFER?
Thanks,
Janusz
On Mon, May 21, 2018 at 10:21:46PM +0200, Janusz Krzysztofik wrote:
On Sunday, May 20, 2018 10:08:22 PM CEST Dmitry Torokhov wrote:
quoted
On Sun, May 20, 2018 at 09:27:05PM +0200, Ladislav Michl wrote:
quoted
On Sat, May 19, 2018 at 11:55:51PM +0200, Janusz Krzysztofik wrote:
quoted
On Saturday, May 19, 2018 8:00:38 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 2:15 AM, Janusz Krzysztofik
[off-list ref]
wrote:
quoted
quoted
On Friday, May 18, 2018 11:21:14 PM CEST Andy Shevchenko wrote:
quoted
On Sat, May 19, 2018 at 12:09 AM, Janusz Krzysztofik
[off-list ref] wrote:
quoted
+ gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
GPIOD_IN);
+ if (!IS_ERR_OR_NULL(gpiod_rdy)) {
So, is it optional or not at the end?
If it is, why do we check for NULL?
As far as I can understand, nand_chip->dev_ready() callback is
optional.
That's why I decided to use the _optional variant of
devm_gpiod_get(). In
case of ams-delta, the dev_ready() callback depends on availability
of
the 'rdy' GPIO pin. As a consequence, I'm checking for both NULL and
ERR
in order to decide if dev_ready() will be supported.
I can pretty well replace it with the standard form and check for
ERR only
if the purpose of the _optional form is different.
NULL check in practice discards the _optional part of gpiod_get(). So,
either you use non-optional variant and decide how to handle an
errors, or user _optional w/o NULL check.
OK, I'm going to use something like the below while submitting v2:
- gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy", GPIOD_IN);
- if (!IS_ERR_OR_NULL(gpiod_rdy)) {
- this->dev_ready = ams_delta_nand_ready;
- } else {
- this->dev_ready = NULL;
- pr_notice("Couldn't request gpio for Delta NAND ready.\n");
+ priv->gpiod_rdy = devm_gpiod_get_optional(&pdev->dev, "rdy",
+ GPIOD_IN);
+ if (IS_ERR(priv->gpiod_rdy)) {
+ err = PTR_ERR(priv->gpiod_nwp);
Driver will just use worst case delay instead of RDY signal, so this
is perhaps too strict. I will work with degraded performance.
If RDY signal is not available then the board should not define it.
Degrading performance and having users wondering because RDY is
sometimes not available is not great. Especially if we get -EPROBE_DEFER
here.
Hi,
I'm a bit lost after your comments.
As far as I can read the code of gpiod_get_optional and underlying functions,
if a board doesn't define the "rdy" pin in a respective lookup table, the
function returns NULL and the device gets a chance to work in degraded mode.
NULL may also happen if the driver probes the device before the lookup table
is added. In that case other non-optional pin requests fail with -ENOENT, the
probe is deferred and the device gets a chance to probe successfully in
late_init if the table is added but fails if not.
If the pin is defined but GPIO device providing that pin is not available
(-ENODEV), the probe is initially deferred and may succeed in late_init if the
GPIO device appears but fails otherwise.
Isn't that behavior acceptable, close enough to the expected even if not
strictly because of that -EPROBE_DEFER?
Yes, this is correct. I was responding to the comment that erroring out
in "if (IS_ERR(priv->gpiod_rdy))" branch is too strict. My assertion
that it is not. If a board defines RDY pin we should use it and not try
to degrade to lower performance mode.
Thanks.
--
Dmitry
From: Tony Lindgren <tony@atomide.com> Date: 2018-05-23 18:52:51
* Mark Brown [off-list ref] [180521 10:07]:
On Fri, May 18, 2018 at 11:09:51PM +0200, Janusz Krzysztofik wrote:
quoted
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Acked-by: Mark Brown <broonie@kernel.org>
Thanks applying patches 1 and 3 of this series into omap-for-v4.18/soc.
It's kind of getting late for v4.18, but let's see if we can still make
it.
Seems the others can be applied to the driver trees after no more
comments, then once all that is done we can apply the last patch
in this series.
Regards,
Tony
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-24 20:35:06
On Wednesday, May 23, 2018 8:52:44 PM CEST Tony Lindgren wrote:
* Mark Brown [off-list ref] [180521 10:07]:
quoted
On Fri, May 18, 2018 at 11:09:51PM +0200, Janusz Krzysztofik wrote:
quoted
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Acked-by: Mark Brown <broonie@kernel.org>
Hi Tony,
Thanks applying patches 1 and 3 of this series into omap-for-v4.18/soc.
It's kind of getting late for v4.18, but let's see if we can still make
it.
Thank you.
Seems the others can be applied to the driver trees after no more
comments, then once all that is done we can apply the last patch
in this series.
I'll be submitting v2 of 5/6 (nand) very soon. 4/6 (lcd) is still waiting for
Tomi to respond. I hope there will be no issues with it. Howevver, regarding
2/6 - serio - I have to work more on that to satisfy Dmitry's comments. So
let's forget about 6/6 for now and I'll resubmit it again when we are ready
for that. Meanwhile, I'm going to submit a few more patches against the board
init file to complete migration to GPIO descriptors so dynamic allocation of
GPIO numbers to ams-delta latches will be possible.
Thanks,
Janusz
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-05-25 22:49:34
On Friday, May 18, 2018 11:09:52 PM CEST Janusz Krzysztofik wrote:
quoted hunk
Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ functions with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be postponed
instead of aborted if the GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/video/fbdev/omap/lcd_ams_delta.c | 59
++++++++++++++------------------ 1 file changed, 26 insertions(+), 33
deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-09 19:15:48
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
Changelog:
v2: Remove problematic error code conversion, no longer needed if used
on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late
devices back to init_machine") already in linux-next and commit
8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name()
failure") just applied to linux-gpio/devel.
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 +++++++++++++-------------------
1 file changed, 22 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 16:53:48
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
Changelog:
v2: Remove problematic error code conversion, no longer needed if used
on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late
devices back to init_machine") and commit 8853daf3b4ac ("gpiolib:
Defer on non-DT find_chip_by_name() failure") already in linux-next.
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 +++++++++++++-------------------
1 file changed, 22 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 21:39:57
Hi,
Please ignore this submission, I'm going to send this patch with two others in
a single series.
Thanks,
Janusz
On Tuesday, July 17, 2018 6:54:00 PM CEST Janusz Krzysztofik wrote:
quoted hunk
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
Changelog:
v2: Remove problematic error code conversion, no longer needed if used
on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late
devices back to init_machine") and commit 8853daf3b4ac ("gpiolib:
Defer on non-DT find_chip_by_name() failure") already in linux-next.
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 +++++++++++++-------------------
1 file changed, 22 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 23:14:57
This is a follow up of initial submission of a series consisted of
6 changes, 3 of which have been already applied or reworkeed.
V2 changelog:
[PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables
- already in mainline, commit 68e62a15a914
[PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table
- reworked and submitted as a series, already in linux-omap,
commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup
table for serio device") followed by 9 more
[PATCH 3/6] ASoC: ams_delta: use GPIO lookup table
- already in mainline, commit d65777d1a2cd
[PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
- resubmitting as [PATCH v2 1/3 v2]
v2: Remove problematic error code conversion no longer
needed if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine")
and commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next
[PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table
- resubmitting as [PATCH v2 2/3 v4]
v2: Fix handling of devm_gpiod_get_optional() return values -
thanks to Andy Shevchenko.
v3: Remove problematic error code conversion no longer needed
if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine") and
commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next - thanks
to Boris Brezillon
v4: fix style issue - thanks to Boris Brezillon
[PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to
mach-omap1
- resending as [PATCH v2 3/3]
Dependency on commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") is not critical - it is not needed for
clean build or run, it only prevents from potential future changes to
driver initializaton order during device_initcall.
I'm submitting the three patches in series because the last one depends
on the other two.
Thanks,
Janusz
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 23:15:11
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Cc: Bartlomiej Zolnierkiewicz <redacted>
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
Changelog:
v2: Remove problematic error code conversion no longer needed if used
on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late
devices back to init_machine") already in linux-omap and commit
8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name()
failure") already in linux-next
Dependency on commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") is not critical for clean build or run, it
only prevents from unexpected future changes to driver initialization
order durin device_initall.
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 +++++++++++++-------------------
1 file changed, 22 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 23:15:17
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Boris Brezillon <redacted>
---
Changelog:
v2: Fix handling of devm_gpiod_get_optional() return values - thanks to
Andy Shevchenko
v3: Remove problematic error code conversion, no longer needed if used
on top of commit d08605a64e67 ("ARM: OMAP1: ams-delta: move late
devices back to init_machine") already in linux-omap and commit
8853daf3b4ac ("gpiolib: Defer on non-DT find_chip_by_name()
failure") already in linux-next - thanks to Boris Brezillon
v4: Fix style issue - thanks to Boris Brezillon
Dependency on commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") is not critical for clean build or run, it
only prevents from unexpected future changes to driver initialization
order during device_initall.
drivers/mtd/nand/raw/ams-delta.c | 126 +++++++++++++++++++++------------------
1 file changed, 67 insertions(+), 59 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-07-17 23:15:21
Now as board header file is no longer included by drivers, move it to
the root directory of mach-omap1.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
Depends on patches 1/3 and 2/3 of the series.
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2 +-
arch/arm/mach-omap1/ams-delta-fiq.c | 3 +--
arch/arm/mach-omap1/board-ams-delta.c | 2 +-
arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
rename arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h (98%)
diff --git a/arch/arm/mach-omap1/include/mach/board-ams-delta.h b/arch/arm/mach-omap1/board-ams-delta.hsimilarity index 98%rename from arch/arm/mach-omap1/include/mach/board-ams-delta.hrename to arch/arm/mach-omap1/board-ams-delta.hindex ad6f865d1f16..1fbada29431a 100644--- a/arch/arm/mach-omap1/include/mach/board-ams-delta.h+++ b/arch/arm/mach-omap1/board-ams-delta.h
Hi Janusz, Tony
Janusz Krzysztofik [off-list ref] wrote on Wed, 18 Jul 2018
01:14:47 +0200:
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Boris Brezillon <redacted>
---
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
As suggested by Boris, we expect this series to go through the OMAP
tree so we'll need an immutable tag, there are more changes on this
driver coming in.
Thanks!
Miquèl
From: Tony Lindgren <tony@atomide.com> Date: 2018-07-19 06:39:51
* Miquel Raynal [off-list ref] [180718 07:24]:
Hi Janusz, Tony
Janusz Krzysztofik [off-list ref] wrote on Wed, 18 Jul 2018
01:14:47 +0200:
quoted
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Boris Brezillon <redacted>
---
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
As suggested by Boris, we expect this series to go through the OMAP
tree so we'll need an immutable tag, there are more changes on this
driver coming in.
Let's wait for v4.19-rc1 to clear the dependencies. I'm not applying
new patches at this point only dealing with the pending pull requests
I have.
Regards,
Tony
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-09-10 02:40:01
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Cc: Bartlomiej Zolnierkiewicz <redacted>
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 +++++++++++++-------------------
1 file changed, 22 insertions(+), 33 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-09-10 02:48:26
Now as board header file is no longer included by drivers, move it to
the root directory of mach-omap1.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2 +-
arch/arm/mach-omap1/ams-delta-fiq.c | 3 +--
arch/arm/mach-omap1/board-ams-delta.c | 2 +-
arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
rename arch/arm/mach-omap1/{include/mach => }/board-ams-delta.h (98%)
diff --git a/arch/arm/mach-omap1/include/mach/board-ams-delta.h b/arch/arm/mach-omap1/board-ams-delta.hsimilarity index 98%rename from arch/arm/mach-omap1/include/mach/board-ams-delta.hrename to arch/arm/mach-omap1/board-ams-delta.hindex ad6f865d1f16..1fbada29431a 100644--- a/arch/arm/mach-omap1/include/mach/board-ams-delta.h+++ b/arch/arm/mach-omap1/board-ams-delta.h
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-09-10 02:49:31
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Boris Brezillon <redacted>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/ams-delta.c | 126 +++++++++++++++++++++------------------
1 file changed, 67 insertions(+), 59 deletions(-)
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-09-10 03:08:39
This is a follow up of initial submission of a series consisted of
6 changes, 3 of which have been already applied or reworkeed.
Janusz Krzysztofik (3):
video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
mtd: rawnand: ams-delta: use GPIO lookup table
ARM: OMAP1: ams-delta: make board header file local to mach-omap1
I'm submitting the three patches in series because the last one depends
on the other two.
Tony, please set up an immutable tag for this series to be used by MTD
as there are more changes on Amstrad Delta NAND driver coming in.
Thanks,
Janusz
Changelog:
v3:
- rebased on top of v4.19-rc1
- added Acked-by: received from Miquel
v2:
[PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables
- already in mainline, commit 68e62a15a914
[PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table
- reworked and submitted as a series, already in linux-omap,
commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup
table for serio device") followed by 9 more
[PATCH 3/6] ASoC: ams_delta: use GPIO lookup table
- already in mainline, commit d65777d1a2cd
[PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
- resubmitting as [PATCH v2 1/3 v2]
v2: Remove problematic error code conversion no longer
needed if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine")
and commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next
[PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table
- resubmitting as [PATCH v2 2/3 v4]
v2: Fix handling of devm_gpiod_get_optional() return values -
thanks to Andy Shevchenko.
v3: Remove problematic error code conversion no longer needed
if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine") and
commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next - thanks
to Boris Brezillon
v4: fix style issue - thanks to Boris Brezillon
[PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to
mach-omap1
- resending as [PATCH v2 3/3]
All dependencies mentioned in v2 changelog are satisfied in v4.19-rc1.
diffstat:
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2
arch/arm/mach-omap1/ams-delta-fiq.c | 3
arch/arm/mach-omap1/board-ams-delta.c | 2
arch/arm/mach-omap1/board-ams-delta.h | 2
drivers/mtd/nand/raw/ams-delta.c | 126 ++++++++++++++--------------
drivers/video/fbdev/omap/lcd_ams_delta.c | 55 ++++--------
6 files changed, 93 insertions(+), 97 deletions(-)
On Mon, Sep 10, 2018 at 12:55 AM Janusz Krzysztofik [off-list ref] wrote:
Now as Amstrad Delta board - the only user of this driver - provides
GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
use the table to locate required GPIO pins.
Declare static variables for storing GPIO descriptors and replace
gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
to the driver probe function so device initialization can be deferred
instead of aborted if a GPIO pin is not yet available.
Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.
Cc: Bartlomiej Zolnierkiewicz <redacted>
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Good work as usual:
Reviewed-by: Linus Walleij <redacted>
FWIW I think the entire drivers/video/fbdev/omap/*
could be pretty easy to migrate to DRM if you compare
the simple drivers/gpu/drm/pl111 or drivers/gpu/drm/tve200
drivers. Just inspiration! :)
Yours,
Linus Walleij
From: Janusz Krzysztofik <jmkrzyszt@gmail.com> Date: 2018-09-19 18:09:34
On Monday, September 10, 2018 12:56:02 AM CEST Janusz Krzysztofik wrote:
This is a follow up of initial submission of a series consisted of
6 changes, 3 of which have been already applied or reworkeed.
Janusz Krzysztofik (3):
video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
mtd: rawnand: ams-delta: use GPIO lookup table
Hi Tony,
Please ignore this patch. It may no longer be possible to merged it cleanly
with nand/next tree. I'll exclude it from the series, rebase on top of nand/
next and submit via linux-mtd.
That shouldn't affect the two remaining patches of the series which should
still apply and merge cleanly, but I can resend them renumbered if you wish.
Thanks,
Janusz
ARM: OMAP1: ams-delta: make board header file local to mach-omap1
I'm submitting the three patches in series because the last one depends
on the other two.
Tony, please set up an immutable tag for this series to be used by MTD
as there are more changes on Amstrad Delta NAND driver coming in.
Thanks,
Janusz
Changelog:
v3:
- rebased on top of v4.19-rc1
- added Acked-by: received from Miquel
v2:
[PATCH 1/6] ARM: OMAP1: ams-delta: add GPIO lookup tables
- already in mainline, commit 68e62a15a914
[PATCH 2/6] Input: ams_delta_serio: use GPIO lookup table
- reworked and submitted as a series, already in linux-omap,
commit 68e62a15a914 ("ARM: OMAP1: ams-delta: drop GPIO lookup
table for serio device") followed by 9 more
[PATCH 3/6] ASoC: ams_delta: use GPIO lookup table
- already in mainline, commit d65777d1a2cd
[PATCH 4/6] fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
- resubmitting as [PATCH v2 1/3 v2]
v2: Remove problematic error code conversion no longer
needed if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine")
and commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next
[PATCH 5/6] mtd: rawnand: ams-delta: use GPIO lookup table
- resubmitting as [PATCH v2 2/3 v4]
v2: Fix handling of devm_gpiod_get_optional() return values -
thanks to Andy Shevchenko.
v3: Remove problematic error code conversion no longer needed
if used on top of commit d08605a64e67 ("ARM: OMAP1:
ams-delta: move late devices back to init_machine") and
commit 8853daf3b4ac ("gpiolib: Defer on non-DT
find_chip_by_name() failure") already in linux-next - thanks
to Boris Brezillon
v4: fix style issue - thanks to Boris Brezillon
[PATCH 6/6] ARM: OMAP1: ams-delta: make board header file local to
mach-omap1
- resending as [PATCH v2 3/3]
All dependencies mentioned in v2 changelog are satisfied in v4.19-rc1.
diffstat:
arch/arm/mach-omap1/ams-delta-fiq-handler.S | 2
arch/arm/mach-omap1/ams-delta-fiq.c | 3
arch/arm/mach-omap1/board-ams-delta.c | 2
arch/arm/mach-omap1/board-ams-delta.h | 2
drivers/mtd/nand/raw/ams-delta.c | 126 +++++++++++++
From: Tony Lindgren <tony@atomide.com> Date: 2018-09-20 20:58:11
* Janusz Krzysztofik [off-list ref] [180919 18:13]:
On Monday, September 10, 2018 12:56:02 AM CEST Janusz Krzysztofik wrote:
quoted
This is a follow up of initial submission of a series consisted of
6 changes, 3 of which have been already applied or reworkeed.
Janusz Krzysztofik (3):
video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table
mtd: rawnand: ams-delta: use GPIO lookup table
Hi Tony,
Please ignore this patch. It may no longer be possible to merged it cleanly
with nand/next tree. I'll exclude it from the series, rebase on top of nand/
next and submit via linux-mtd.
OK sounds good to me.
That shouldn't affect the two remaining patches of the series which should
still apply and merge cleanly, but I can resend them renumbered if you wish.
Up to the mtd and fb folks as far as I'm concerned :)
Regards,
Tony