* Re: [PATCH] gpio: tegra: fix debugfs compile error
From: Arnd Bergmann @ 2019-07-08 13:19 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: Linus Walleij, Bartosz Golaszewski, Thierry Reding,
Jonathan Hunter, open list:GPIO SUBSYSTEM,
open list:TEGRA ARCHITECTURE SUPPORT, Linux Kernel Mailing List
In-Reply-To: <d30c122c-297e-3370-86d6-039388b48cea@gmail.com>
On Mon, Jul 8, 2019 at 3:06 PM Dmitry Osipenko <digetx@gmail.com> wrote:
> 08.07.2019 15:38, Arnd Bergmann пишет:
>
> The offending patch should be reverted already, please see [1].
>
> [1] https://patchwork.ozlabs.org/patch/1128007/#2210871
Ok, sounds good. With my patch on top, the other version is a little
nicer, but the revert is correct as well, and probably the safe choice
during the merge window.
Arnd
^ permalink raw reply
* Re: [RFC] SW connection between DVB Transport Stream demuxer and I2C-based frontend
From: Enrico Weigelt, metux IT consult @ 2019-07-08 14:44 UTC (permalink / raw)
To: Marc Gonzalez, I2C, linux-media, GPIO
Cc: Mauro Carvalho Chehab, Jonathan Neuschäfer, Brad Love,
Antti Palosaari, Olli Salonen, Bjorn Andersson, Linus Walleij,
Jeffrey Hugo, Wolfram Sang, Simon Horman, Peter Korsgaard,
Linux ARM
In-Reply-To: <5e35b4fb-646d-6428-f372-ee47d7352cd6@free.fr>
On 08.07.19 13:08, Marc Gonzalez wrote:
> The tuner (si2157) is not on the i2c5 bus, instead it is on a private
> i2c bus *behind* si2168, which routes requests to the proper client.
Should the si2168 make up it's own i2c controller ?
--mtx
--
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
^ permalink raw reply
* Re: [RFC] SW connection between DVB Transport Stream demuxer and I2C-based frontend
From: Marc Gonzalez @ 2019-07-08 15:03 UTC (permalink / raw)
To: Enrico Weigelt, I2C, linux-media, GPIO
Cc: Mauro Carvalho Chehab, Jonathan Neuschäfer, Brad Love,
Antti Palosaari, Olli Salonen, Bjorn Andersson, Linus Walleij,
Jeffrey Hugo, Wolfram Sang, Simon Horman, Peter Korsgaard,
Linux ARM
In-Reply-To: <b6abf5a2-3151-29e5-8eb7-c960580fd4ea@metux.net>
On 08/07/2019 16:44, Enrico Weigelt wrote:
> On 08.07.19 13:08, Marc Gonzalez wrote:
>
>> The tuner (si2157) is not on the i2c5 bus, instead it is on a private
>> i2c bus *behind* si2168, which routes requests to the proper client.
>
> Should the si2168 make up its own i2c controller ?
It does AFAIU ;-)
https://elixir.bootlin.com/linux/latest/source/drivers/media/dvb-frontends/si2168.c#L780
/* create mux i2c adapter for tuner */
dev->muxc = i2c_mux_alloc(client->adapter, &client->dev, 1, 0, I2C_MUX_LOCKED, si2168_select, si2168_deselect);
ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0);
/* this is the new internal i2c bus */
struct i2c_adapter *si2168_bus = dev->muxc->adapter[0];
One problem is that since the internal bus is "created" (declared?) at run-time,
it doesn't seem possible to define it (or its client) in DT.
Regards.
^ permalink raw reply
* Re: [PATCH RFC 1/7] pinctrl: sh-pfc: add new flags into struct sh_pfc_pin_config
From: Sergei Shtylyov @ 2019-07-08 15:51 UTC (permalink / raw)
To: Yoshihiro Shimoda, linus.walleij, geert+renesas, thierry.reding,
robh+dt, mark.rutland
Cc: linux-gpio, linux-pwm, devicetree, linux-renesas-soc
In-Reply-To: <1562576868-8124-2-git-send-email-yoshihiro.shimoda.uh@renesas.com>
On 08.07.2019 12:07, Yoshihiro Shimoda wrote:
> To clean/modify the code up later, this patch just adds new flags
> "mux_set" and "gpio_enabled" into the struct sh_pfc_pin_config.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> drivers/pinctrl/sh-pfc/pinctrl.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
> index 2824be4..157b257 100644
> --- a/drivers/pinctrl/sh-pfc/pinctrl.c
> +++ b/drivers/pinctrl/sh-pfc/pinctrl.c
> @@ -27,6 +27,8 @@
>
> struct sh_pfc_pin_config {
> u32 type;
> + bool mux_set;
> + bool gpio_enabled;
> };
>
> struct sh_pfc_pinctrl {
> @@ -364,7 +366,15 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
> for (i = 0; i < grp->nr_pins; ++i) {
> ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
> if (ret < 0)
> - break;
> + goto done;
> + }
> +
> + /* All group pins are configurated, mark the pins as mux_set */
Configured.
> + for (i = 0; i < grp->nr_pins; ++i) {
> + int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
> + struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
> +
> + cfg->mux_set = true;
> }
>
> done:
[...]
MBR, Sergei
^ permalink raw reply
* Re: [RFC] SW connection between DVB Transport Stream demuxer and I2C-based frontend
From: Marc Gonzalez @ 2019-07-08 16:42 UTC (permalink / raw)
To: I2C, linux-media, GPIO
Cc: Mauro Carvalho Chehab, Jonathan Neuschäfer, Brad Love,
Antti Palosaari, Olli Salonen, Bjorn Andersson, Linus Walleij,
Jeffrey Hugo, Wolfram Sang, Simon Horman, Peter Korsgaard,
Linux ARM
In-Reply-To: <5e35b4fb-646d-6428-f372-ee47d7352cd6@free.fr>
On 08/07/2019 13:08, Marc Gonzalez wrote:
> PROBLEM #1
>
> The media framework requires that the TSIF and demod be "tied" together,
> by calling dvb_register_frontend(). If I do that in tsif.c, then I need to
> get the frontend pointer from the demod at some point. There is no such
> callback presently. Since si2168 lives on an I2C bus, I can get a
> struct i2c_client pointer, through the DT phandle. But some kind of
> abstraction is missing to query the i2c_client object to make sure it
> is a demodulator and request its frontend pointer.
>
> For the time being, I have added a very generic pointer to struct i2c_client
> but I feel this is not quite right... (though it gets the job done)
As far as PROBLEM #1 is concerned, I think I have a better solution;
one that doesn't involve messing with struct i2c_client.
Basically, we embed a common struct in every demod driver, at the
beginning of their private control struct. That way, demod consumers
have a generic/common data type to inspect, and don't need to know
the specific demod they are working with. (I left the removals in
the diff below, to show the two proposed solutions so far.)
@linux-media maintainers, I think this solution is acceptable for
mainline, right?
Regards.
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 726bb6759315..692f3207cd9d 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -666,12 +666,6 @@ struct si2168_config si2168_config;
struct si2157_config si2157_config;
struct i2c_client *tuner;
-static void *get_fe(struct i2c_client *client)
-{
- struct si2168_dev *dev = i2c_get_clientdata(client);
- return &dev->fe;
-}
-
static int si2168_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -700,7 +694,7 @@ static int si2168_probe(struct i2c_client *client,
goto err;
}
- client->get_something = get_fe;
+ dev->common.fe = &dev->fe;
i2c_set_clientdata(client, dev);
mutex_init(&dev->i2c_mutex);
diff --git a/drivers/media/dvb-frontends/si2168_priv.h b/drivers/media/dvb-frontends/si2168_priv.h
index 804d5b30c697..2e69080f8a1c 100644
--- a/drivers/media/dvb-frontends/si2168_priv.h
+++ b/drivers/media/dvb-frontends/si2168_priv.h
@@ -22,6 +22,7 @@
/* state struct */
struct si2168_dev {
+ struct dvb_demod_common common;
struct mutex i2c_mutex;
struct i2c_mux_core *muxc;
struct dvb_frontend fe;
diff --git a/drivers/media/platform/tsif.c b/drivers/media/platform/tsif.c
index a0118c2ee870..c13fa19c9779 100644
--- a/drivers/media/platform/tsif.c
+++ b/drivers/media/platform/tsif.c
@@ -237,6 +237,7 @@ static int msm_tspp_probe(struct platform_device *pdev)
{
struct device_node *tsif_node, *demod_node;
struct i2c_client *demod;
+ struct dvb_demod_common *demod_data;
tsif_node = pdev->dev.of_node;
demod_node = of_parse_phandle(tsif_node, "demod", 0);
@@ -244,10 +245,8 @@ static int msm_tspp_probe(struct platform_device *pdev)
demod = of_find_i2c_device_by_node(demod_node);
if (!demod) panic("of_find_i2c_device_by_node");
- /*** TODO: Improve callback naming & handling ***/
- if (!demod->get_something)
- panic("Wrong i2c_client");
- my_dvb_frontend = demod->get_something(demod);
+ demod_data = i2c_get_clientdata(demod);
+ my_dvb_frontend = demod_data->fe;
of_node_put(demod_node);
}
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5fca596e0dd0..e982b8913b73 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -295,8 +295,6 @@ struct i2c_driver {
};
#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
-typedef void *generic_func(struct i2c_client *this);
-
/**
* struct i2c_client - represent an I2C slave device
* @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
@@ -330,7 +328,6 @@ struct i2c_client {
#if IS_ENABLED(CONFIG_I2C_SLAVE)
i2c_slave_cb_t slave_cb; /* callback for slave mode */
#endif
- generic_func *get_something;
};
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
diff --git a/include/media/dvb_frontend.h b/include/media/dvb_frontend.h
index f05cd7b94a2c..087486bc027e 100644
--- a/include/media/dvb_frontend.h
+++ b/include/media/dvb_frontend.h
@@ -73,6 +73,10 @@ struct dvb_frontend_tune_settings {
struct dvb_frontend;
+struct dvb_demod_common {
+ struct dvb_frontend *fe;
+};
+
/**
* struct dvb_tuner_info - Frontend name and min/max ranges/bandwidths
*
^ permalink raw reply related
* Re: [RFC] SW connection between DVB Transport Stream demuxer and I2C-based frontend
From: Enrico Weigelt, metux IT consult @ 2019-07-08 19:10 UTC (permalink / raw)
To: Marc Gonzalez, I2C, linux-media, GPIO
Cc: Mauro Carvalho Chehab, Jonathan Neuschäfer, Brad Love,
Antti Palosaari, Olli Salonen, Bjorn Andersson, Linus Walleij,
Jeffrey Hugo, Wolfram Sang, Simon Horman, Peter Korsgaard,
Linux ARM
In-Reply-To: <79b9bd5e-be05-daa8-0d16-d84a383138a7@free.fr>
On 08.07.19 17:03, Marc Gonzalez wrote:
> One problem is that since the internal bus is "created" (declared?) at run-time,
> it doesn't seem possible to define it (or its client) in DT.
Maybe declare it nested inside the si2168 device ?
The driver then needs a piece of glue code for triggering device probing
on that bus. (so, it really needs to provide a full blown i2c driver ?)
--mtx
--
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
^ permalink raw reply
* Re: [RFC] SW connection between DVB Transport Stream demuxer and I2C-based frontend
From: Peter Rosin @ 2019-07-08 19:58 UTC (permalink / raw)
To: Marc Gonzalez, I2C, linux-media, GPIO
Cc: Mauro Carvalho Chehab, Jonathan Neuschäfer, Brad Love,
Antti Palosaari, Olli Salonen, Bjorn Andersson, Linus Walleij,
Jeffrey Hugo, Wolfram Sang, Simon Horman, Peter Korsgaard,
Linux ARM
In-Reply-To: <5e35b4fb-646d-6428-f372-ee47d7352cd6@free.fr>
On 2019-07-08 13:08, Marc Gonzalez wrote:
> Hello everyone,
*snip*
Focusing on #2...
> PROBLEM #2
>
> The tuner (si2157) is not on the i2c5 bus, instead it is on a private
> i2c bus *behind* si2168, which routes requests to the proper client.
> For the time being, I don't know how to model this relationship in DT.
> (TODO: check i2c_slave_cb_t slave_cb in struct i2c_client)
> I have initialized si2157 in the si2168 driver, but this doesn't feel
> right. (Though it seems all(?) users pair 2168 with 2157.)
>
>
> It would really help if I could get some guidance from media and i2c
> people for these two issues. (I'd like to upstream the driver in time
> for 5.3)
>
> Regards.
>
>
>
> diff --git a/arch/arm64/boot/dts/qcom/apq8098-batfish.dts b/arch/arm64/boot/dts/qcom/apq8098-batfish.dts
> index 29d59ecad138..9353e62375a7 100644
> --- a/arch/arm64/boot/dts/qcom/apq8098-batfish.dts
> +++ b/arch/arm64/boot/dts/qcom/apq8098-batfish.dts
> @@ -30,6 +30,28 @@
> status = "ok";
> };
>
> +&blsp1_i2c5 {
> + status = "ok";
> + clock-frequency = <100000>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2c5_default>;
> +
> + dvb_demod: si2168@64 {
> + compatible = "silabs,si2168";
> + reg = <0x64>;
> + reset-gpios = <&tlmm 84 GPIO_ACTIVE_LOW>;
In principle, I think you should be able to add something like this here:
i2c-gate {
#address-cells = <1>;
#size-cells = <0>;
tuner@60 {
compatible = "silabs,si2157";
reg = <0x60>;
/* whatever else is needed */
};
};
But in practice, I don't know if the si2157 driver understands that or
if there is anything else that gets in the way. Totally untested...
The i2c-gate child node is examined when you call i2c_mux_add_adapter
if you have provided the correct struct device in the second argument
when you called i2c_mux_alloc (I think that is already the case). You
also need to set the I2C_MUX_GATE flag in the i2c_mux_alloc call, but
I do not see a problem with that since I think only one child adapter
is added. If it is a problem to add the I2C_MUX_GATE flag, then you
can just adjust the above i2c-gate node according to the bindings in
Documentation/devicetree/bindings/i2c/i2c-mux.txt. I.e. add this
instead of the above i2c-gate node:
i2c-mux {
#address-cells = <1>;
#size-cells = <0>;
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
tuner@60 {
compatible = "silabs,si2157";
reg = <0x60>;
/* whatever else is needed */
};
};
};
But it feels *right* to add the I2C_MUX_GATE flag, because a gate is
what you have. I think?
Cheers,
Peter
> + };
> +};
> +
> +&tsif {
> + demod = <&dvb_demod>;
> +};
> +
> +&i2c5_default {
> + drive-strength = <2>;
> + bias-disable;
> +};
> +
> &qusb2phy {
> status = "ok";
> vdda-pll-supply = <&vreg_l12a_1p8>;
^ permalink raw reply
* [PATCH] Documentation: gpio: fix function links in the HTML docs
From: Jeremy Cline @ 2019-07-08 21:11 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Jonathan Corbet
Cc: linux-gpio, linux-doc, linux-kernel, Jeremy Cline
The shorthand [_data] and [devm_] cause the HTML documentation to not
link to the function documentation properly. This expands the references
to the complete function names with the exception of
devm_gpiochip_remove() which was dropped by commit 48207d7595d2 ("gpio:
drop devm_gpiochip_remove()").
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
Documentation/driver-api/gpio/driver.rst | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst
index 1ce7fcd0f989..d4197ea3dafb 100644
--- a/Documentation/driver-api/gpio/driver.rst
+++ b/Documentation/driver-api/gpio/driver.rst
@@ -69,9 +69,9 @@ driver code:
The code implementing a gpio_chip should support multiple instances of the
controller, preferably using the driver model. That code will configure each
-gpio_chip and issue ``gpiochip_add[_data]()`` or ``devm_gpiochip_add_data()``.
-Removing a GPIO controller should be rare; use ``[devm_]gpiochip_remove()``
-when it is unavoidable.
+gpio_chip and issue gpiochip_add(), gpiochip_add_data(), or
+devm_gpiochip_add_data(). Removing a GPIO controller should be rare; use
+gpiochip_remove() when it is unavoidable.
Often a gpio_chip is part of an instance-specific structure with states not
exposed by the GPIO interfaces, such as addressing, power management, and more.
@@ -418,11 +418,11 @@ symbol:
If there is a need to exclude certain GPIO lines from the IRQ domain handled by
these helpers, we can set .irq.need_valid_mask of the gpiochip before
-[devm_]gpiochip_add_data() is called. This allocates an .irq.valid_mask with as
-many bits set as there are GPIO lines in the chip, each bit representing line
-0..n-1. Drivers can exclude GPIO lines by clearing bits from this mask. The mask
-must be filled in before gpiochip_irqchip_add() or gpiochip_irqchip_add_nested()
-is called.
+devm_gpiochip_add_data() or gpiochip_add_data() is called. This allocates an
+.irq.valid_mask with as many bits set as there are GPIO lines in the chip, each
+bit representing line 0..n-1. Drivers can exclude GPIO lines by clearing bits
+from this mask. The mask must be filled in before gpiochip_irqchip_add() or
+gpiochip_irqchip_add_nested() is called.
To use the helpers please keep the following in mind:
--
2.21.0
^ permalink raw reply related
* Re: [PATCH V4 2/2] gpio: inverter: document the inverter bindings
From: Rob Herring @ 2019-07-08 22:36 UTC (permalink / raw)
To: Harish Jenny K N
Cc: Linus Walleij, Bartosz Golaszewski, Mark Rutland, devicetree,
open list:GPIO SUBSYSTEM, Balasubramani Vivekanandan
In-Reply-To: <1561714250-19613-1-git-send-email-harish_kandiga@mentor.com>
On Fri, Jun 28, 2019 at 3:31 AM Harish Jenny K N
<harish_kandiga@mentor.com> wrote:
>
> Document the device tree binding for the inverter gpio
> controller to configure the polarity of the gpio pins
> used by the consumers.
>
> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
> ---
> .../devicetree/bindings/gpio/gpio-inverter.txt | 29 ++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/gpio/gpio-inverter.txt
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-inverter.txt b/Documentation/devicetree/bindings/gpio/gpio-inverter.txt
> new file mode 100644
> index 0000000..8bb6b2e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-inverter.txt
> @@ -0,0 +1,29 @@
> +GPIO-INVERTER
> +======
> +This binding defines the gpio-inverter. The gpio-inverter is a driver that
> +allows to properly describe the gpio polarities on the hardware.
I don't understand. Please explain this in terms of the hardware, not a driver.
Rob
^ permalink raw reply
* Re: [PATCH 1/6] pinctrl: qcom: Add ipq6018 pinctrl driver
From: Rob Herring @ 2019-07-09 1:44 UTC (permalink / raw)
To: Sricharan R
Cc: sboyd, linus.walleij, agross, devicetree, linux-kernel, linux-clk,
linux-gpio, linux-arm-msm, linux-soc, linux-arm-kernel
In-Reply-To: <1559755738-28643-2-git-send-email-sricharan@codeaurora.org>
On Wed, Jun 05, 2019 at 10:58:53PM +0530, Sricharan R wrote:
> Add initial pinctrl driver to support pin configuration with
> pinctrl framework for ipq6018.
>
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> Signed-off-by: Rajkumar Ayyasamy <arajkuma@codeaurora.org>
> Signed-off-by: speriaka <speriaka@codeaurora.org>
> ---
> .../bindings/pinctrl/qcom,ipq6018-pinctrl.txt | 186 +++
Please split bindings to separate patch. Using DT schema would be nice.
> drivers/pinctrl/qcom/Kconfig | 10 +
> drivers/pinctrl/qcom/Makefile | 1 +
> drivers/pinctrl/qcom/pinctrl-ipq6018.c | 1183 ++++++++++++++++++++
> 4 files changed, 1380 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,ipq6018-pinctrl.txt
> create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq6018.c
^ permalink raw reply
* Re: [PATCH 3/6] clk: qcom: Add DT bindings for ipq6018 gcc clock controller
From: Rob Herring @ 2019-07-09 1:45 UTC (permalink / raw)
To: Sricharan R
Cc: robh+dt, sboyd, linus.walleij, agross, devicetree, linux-kernel,
linux-clk, linux-gpio, linux-arm-msm, linux-soc, linux-arm-kernel
In-Reply-To: <1559755738-28643-4-git-send-email-sricharan@codeaurora.org>
On Wed, 5 Jun 2019 22:58:55 +0530, Sricharan R wrote:
> Add the compatible strings and the include file for ipq6018
> gcc clock controller.
>
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> Signed-off-by: anusha <anusharao@codeaurora.org>
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
> .../devicetree/bindings/clock/qcom,gcc.txt | 1 +
> include/dt-bindings/clock/qcom,gcc-ipq6018.h | 405 +++++++++++++++++++++
> 2 files changed, 406 insertions(+)
> create mode 100644 include/dt-bindings/clock/qcom,gcc-ipq6018.h
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH v2 2/3] scsi: ufs: Allow resetting the UFS device
From: Rob Herring @ 2019-07-09 1:48 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Mark Rutland, Alim Akhtar, Avri Altman, Pedro Sousa,
James E.J. Bottomley, Martin K. Petersen, Andy Gross,
Linus Walleij, Evan Green, linux-arm-msm, linux-gpio, devicetree,
linux-kernel, linux-scsi
In-Reply-To: <20190606010249.3538-3-bjorn.andersson@linaro.org>
On Wed, Jun 05, 2019 at 06:02:48PM -0700, Bjorn Andersson wrote:
> Acquire the device-reset GPIO and toggle this to reset the UFS device
> during initialization and host reset.
>
> Based on downstream support implemented by Subhash Jadavani
> <subhashj@codeaurora.org>.
>
> Tested-by: John Stultz <john.stultz@linaro.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>
> Changes since v1:
> - Added gpio to DT binding document
> - Fixed spelling of UFS
>
> .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 2 +
> drivers/scsi/ufs/ufshcd.c | 44 +++++++++++++++++++
> drivers/scsi/ufs/ufshcd.h | 4 ++
> 3 files changed, 50 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
> index a74720486ee2..d562d8b4919c 100644
> --- a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
> +++ b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt
> @@ -54,6 +54,8 @@ Optional properties:
> PHY reset from the UFS controller.
> - resets : reset node register
> - reset-names : describe reset node register, the "rst" corresponds to reset the whole UFS IP.
> +- device-reset-gpios : A phandle and gpio specifier denoting the GPIO connected
> + to the RESET pin of the UFS memory device.
A sign we should have a child node for the device...
Doesn't using 'reset-gpios' work as I doubt one would have a GPIO reset
for the host controller.
Rob
^ permalink raw reply
* Re: [PATCH 1/4 v1] gpio: Add support for hierarchical IRQ domains
From: Brian Masney @ 2019-07-09 2:37 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-gpio, Bartosz Golaszewski, Thomas Gleixner, Marc Zyngier,
Lina Iyer, Jon Hunter, Sowjanya Komatineni, Bitan Biswas,
linux-tegra, David Daney, Masahiro Yamada, Thierry Reding
In-Reply-To: <20190624132531.6184-1-linus.walleij@linaro.org>
Hi Linus,
On Mon, Jun 24, 2019 at 03:25:28PM +0200, Linus Walleij wrote:
> +associated irqdomain and resource allocation callbacks. These are activated
> +by selecting the Kconfig symbol GPIOLIB_IRQCHIP. If the symbol
> +IRQ_DOMAIN_HIERARCHY is also selected, hierarchical helpers will also be
> +provided. A big portion of overhead code will be managed by gpiolib,
> +under the assumption that your interrupts are 1-to-1-mapped to the
> +GPIO line index:
> +
> + GPIO line offset Hardware IRQ
> + 0 0
> + 1 1
> + 2 2
> + ... ...
> + ngpio-1 ngpio-1
> +
> +If some GPIO lines do not have corresponding IRQs, the bitmask valid_mask
> +and the flag need_valid_mask in gpio_irq_chip can be used to mask off some
> +lines as invalid for associating with IRQs.
I forgot to call out in my patch series that the GPIOs are numbered
1..ngpio on Qualcomm and the existing to_irq and translate callbacks
in mainline take care of adding and subtracting one to / from the
offset.
I was under the (false?) assumption that GPIO numbering on all platforms
start at one. Is that not the case?
Brian
^ permalink raw reply
* Re: [PATCH V4 2/2] gpio: inverter: document the inverter bindings
From: Harish Jenny K N @ 2019-07-09 5:25 UTC (permalink / raw)
To: Rob Herring
Cc: Linus Walleij, Bartosz Golaszewski, Mark Rutland, devicetree,
open list:GPIO SUBSYSTEM, Balasubramani Vivekanandan
In-Reply-To: <CAL_Jsq+-xWLkvku-nLmJnFvbuS=dSD=9dG=GS4uBUqL50tdcDg@mail.gmail.com>
Hi Rob,
On 09/07/19 4:06 AM, Rob Herring wrote:
> On Fri, Jun 28, 2019 at 3:31 AM Harish Jenny K N
> <harish_kandiga@mentor.com> wrote:
>> Document the device tree binding for the inverter gpio
>> controller to configure the polarity of the gpio pins
>> used by the consumers.
>>
>> Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
>> ---
>> .../devicetree/bindings/gpio/gpio-inverter.txt | 29 ++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/gpio/gpio-inverter.txt
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-inverter.txt b/Documentation/devicetree/bindings/gpio/gpio-inverter.txt
>> new file mode 100644
>> index 0000000..8bb6b2e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-inverter.txt
>> @@ -0,0 +1,29 @@
>> +GPIO-INVERTER
>> +======
>> +This binding defines the gpio-inverter. The gpio-inverter is a driver that
>> +allows to properly describe the gpio polarities on the hardware.
> I don't understand. Please explain this in terms of the hardware, not a driver.
gpio inverters can be used on different hardware to alter the polarity of gpio chips.
The polarity of pins can change from hardware to hardware with the use of inverters.
This device tree binding models gpio inverters in the device tree to properly describe the hardware.
Please let me know if this is enough and needs to be updated in the documentation patch.
I am sorry I did not include device tree list in the original discussion ( i.e first version of the patch
https://www.spinics.net/lists/linux-gpio/msg39681.html).
Thanks.
Best Regards,
Harish Jenny K N
^ permalink raw reply
* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
From: Jon Hunter @ 2019-07-09 10:10 UTC (permalink / raw)
To: Linus Walleij
Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
linux-tegra, Greg KH
In-Reply-To: <CACRpkdaFOs24DJbXg4eKVOAzdGOx__X9rbHPcPUzpTJpZ-jbVw@mail.gmail.com>
On 08/07/2019 08:04, Linus Walleij wrote:
> On Wed, Jun 26, 2019 at 3:43 PM Jon Hunter <jonathanh@nvidia.com> wrote:
>
>> The function tegra_gpio_debuginit() just calls debugfs_create_file()
>> and given that there is already a stub function implemented for
>> debugfs_create_file() when CONFIG_DEBUG_FS is not enabled, there is
>> no need for the function tegra_gpio_debuginit() and so remove it.
>>
>> Finally, use a space and not a tab between the #ifdef and
>> CONFIG_DEBUG_FS.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>
> Sadly I've had to revert this commit because of build errors, but
> let's see if we can figure it out after the merge window.
Sorry about that. I will be more thorough in future.
Jon
--
nvpublic
^ permalink raw reply
* [PATCH 0/5] pinctrl: uniphier: Add some improvements and new settings
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
This series adds some improvements and new settings for pin-mux.
Kunihiko Hayashi (5):
pinctrl: uniphier: Separate modem group from UART ctsrts group
pinctrl: uniphier: Add another audio I/O pin-mux settings for LD20
pinctrl: uniphier: Add 4th LD20 MPEG2-TS input pin-mux setting
pinctrl: uniphier: Add Pro5 PCIe pin-mux settings
pinctrl: uniphier: Fix Pro5 SD pin-mux setting
drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c | 20 +++++++++++++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 17 +++++++++++++----
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c | 10 +++++++---
9 files changed, 79 insertions(+), 28 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH 3/5] pinctrl: uniphier: Add 4th LD20 MPEG2-TS input pin-mux setting
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
In-Reply-To: <1562668156-12927-1-git-send-email-hayashi.kunihiko@socionext.com>
The 4th serial TS interface uses the following pins:
hscin4_s: PCA[11-14]
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
index 2c66e70..2de601c 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
@@ -576,6 +576,8 @@ static const unsigned hscin2_s_pins[] = {124, 125, 126, 127};
static const int hscin2_s_muxvals[] = {3, 3, 3, 3};
static const unsigned hscin3_s_pins[] = {129, 130, 131, 132};
static const int hscin3_s_muxvals[] = {3, 3, 3, 3};
+static const unsigned hscin4_s_pins[] = {80, 81, 82, 83};
+static const int hscin4_s_muxvals[] = {3, 3, 3, 3};
static const unsigned hscout0_ci_pins[] = {113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123};
static const int hscout0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
@@ -679,6 +681,7 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
UNIPHIER_PINCTRL_GROUP(hscin1_s),
UNIPHIER_PINCTRL_GROUP(hscin2_s),
UNIPHIER_PINCTRL_GROUP(hscin3_s),
+ UNIPHIER_PINCTRL_GROUP(hscin4_s),
UNIPHIER_PINCTRL_GROUP(hscout0_ci),
UNIPHIER_PINCTRL_GROUP(hscout0_p),
UNIPHIER_PINCTRL_GROUP(hscout0_s),
@@ -722,6 +725,7 @@ static const char * const hscin0_groups[] = {"hscin0_ci",
static const char * const hscin1_groups[] = {"hscin1_p", "hscin1_s"};
static const char * const hscin2_groups[] = {"hscin2_s"};
static const char * const hscin3_groups[] = {"hscin3_s"};
+static const char * const hscin4_groups[] = {"hscin4_s"};
static const char * const hscout0_groups[] = {"hscout0_ci",
"hscout0_p",
"hscout0_s"};
@@ -759,6 +763,7 @@ static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
UNIPHIER_PINMUX_FUNCTION(hscin1),
UNIPHIER_PINMUX_FUNCTION(hscin2),
UNIPHIER_PINMUX_FUNCTION(hscin3),
+ UNIPHIER_PINMUX_FUNCTION(hscin4),
UNIPHIER_PINMUX_FUNCTION(hscout0),
UNIPHIER_PINMUX_FUNCTION(hscout1),
UNIPHIER_PINMUX_FUNCTION(i2c0),
--
2.7.4
^ permalink raw reply related
* [PATCH 4/5] pinctrl: uniphier: Add Pro5 PCIe pin-mux settings
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
In-Reply-To: <1562668156-12927-1-git-send-email-hayashi.kunihiko@socionext.com>
Pro5 PCIe interface uses the following pins:
XPERST, XPEWAKE, XPECLKRQ
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 1d418e3..577f12e 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -855,6 +855,8 @@ static const unsigned usb1_pins[] = {126, 127};
static const int usb1_muxvals[] = {0, 0};
static const unsigned usb2_pins[] = {128, 129};
static const int usb2_muxvals[] = {0, 0};
+static const unsigned pcie_pins[] = {109, 110, 111};
+static const int pcie_muxvals[] = {0, 0, 0};
static const unsigned int gpio_range_pins[] = {
89, 90, 91, 92, 93, 94, 95, 96, /* PORT0x */
97, 98, 99, 100, 101, 102, 103, 104, /* PORT1x */
@@ -925,6 +927,7 @@ static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2),
+ UNIPHIER_PINCTRL_GROUP(pcie),
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range),
};
@@ -957,6 +960,7 @@ static const char * const uart3_groups[] = {"uart3"};
static const char * const usb0_groups[] = {"usb0"};
static const char * const usb1_groups[] = {"usb1"};
static const char * const usb2_groups[] = {"usb2"};
+static const char * const pcie_groups[] = {"pcie"};
static const struct uniphier_pinmux_function uniphier_pro5_functions[] = {
UNIPHIER_PINMUX_FUNCTION(emmc),
@@ -979,6 +983,7 @@ static const struct uniphier_pinmux_function uniphier_pro5_functions[] = {
UNIPHIER_PINMUX_FUNCTION(usb0),
UNIPHIER_PINMUX_FUNCTION(usb1),
UNIPHIER_PINMUX_FUNCTION(usb2),
+ UNIPHIER_PINMUX_FUNCTION(pcie),
};
static int uniphier_pro5_get_gpio_muxval(unsigned int pin,
--
2.7.4
^ permalink raw reply related
* [PATCH 5/5] pinctrl: uniphier: Fix Pro5 SD pin-mux setting
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
In-Reply-To: <1562668156-12927-1-git-send-email-hayashi.kunihiko@socionext.com>
SD uses the following pins starting from 247:
SDCD, SDWP, SDVOLC, SDCLK, SDCMD, SDDAT{0,1,2,3}
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 577f12e..22ce0a5 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -807,7 +807,7 @@ static const unsigned nand_pins[] = {19, 20, 21, 22, 23, 24, 25, 28, 29, 30,
static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const unsigned nand_cs1_pins[] = {26, 27};
static const int nand_cs1_muxvals[] = {0, 0};
-static const unsigned sd_pins[] = {250, 251, 252, 253, 254, 255, 256, 257, 258};
+static const unsigned sd_pins[] = {247, 248, 249, 250, 251, 252, 253, 254, 255};
static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
static const unsigned spi0_pins[] = {120, 121, 122, 123};
static const int spi0_muxvals[] = {0, 0, 0, 0};
--
2.7.4
^ permalink raw reply related
* [PATCH 1/5] pinctrl: uniphier: Separate modem group from UART ctsrts group
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
In-Reply-To: <1562668156-12927-1-git-send-email-hayashi.kunihiko@socionext.com>
It depends on the board implementation whether to have each pins of
CTS/RTS, and others for modem. So it is necessary to divide current
uart_ctsrts group into uart_ctsrts and uart_modem groups.
Since the number of implemented pins for modem differs depending
on SoC, each uart_modem group also has a different number of pins.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c | 10 +++++++---
drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c | 10 +++++++---
9 files changed, 63 insertions(+), 27 deletions(-)
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
index 92fef3a..c390a55 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
@@ -526,8 +526,10 @@ static const unsigned uart2_pins[] = {90, 91};
static const int uart2_muxvals[] = {1, 1};
static const unsigned uart3_pins[] = {94, 95};
static const int uart3_muxvals[] = {1, 1};
-static const unsigned uart3_ctsrts_pins[] = {96, 97, 98, 99, 100, 101};
-static const int uart3_ctsrts_muxvals[] = {1, 1, 1, 1, 1, 1};
+static const unsigned uart3_ctsrts_pins[] = {96, 98};
+static const int uart3_ctsrts_muxvals[] = {1, 1};
+static const unsigned uart3_modem_pins[] = {97, 99, 100, 101};
+static const int uart3_modem_muxvals[] = {1, 1, 1, 1};
static const unsigned usb0_pins[] = {46, 47};
static const int usb0_muxvals[] = {0, 0};
static const unsigned usb1_pins[] = {48, 49};
@@ -600,6 +602,7 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
UNIPHIER_PINCTRL_GROUP(uart3_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart3_modem),
UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2),
@@ -636,7 +639,8 @@ static const char * const system_bus_groups[] = {"system_bus",
static const char * const uart0_groups[] = {"uart0"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
-static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts"};
+static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts",
+ "uart3_modem"};
static const char * const usb0_groups[] = {"usb0"};
static const char * const usb1_groups[] = {"usb1"};
static const char * const usb2_groups[] = {"usb2"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
index 7fbc965..28e54b3 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
@@ -619,8 +619,10 @@ static const unsigned uart2_pins[] = {90, 91};
static const int uart2_muxvals[] = {1, 1};
static const unsigned uart3_pins[] = {94, 95};
static const int uart3_muxvals[] = {1, 1};
-static const unsigned uart3_ctsrts_pins[] = {96, 97, 98, 99, 100, 101};
-static const int uart3_ctsrts_muxvals[] = {1, 1, 1, 1, 1, 1};
+static const unsigned uart3_ctsrts_pins[] = {96, 98};
+static const int uart3_ctsrts_muxvals[] = {1, 1};
+static const unsigned uart3_modem_pins[] = {97, 99, 100, 101};
+static const int uart3_modem_muxvals[] = {1, 1, 1, 1};
static const unsigned usb0_pins[] = {46, 47};
static const int usb0_muxvals[] = {0, 0};
static const unsigned usb1_pins[] = {48, 49};
@@ -695,6 +697,7 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
UNIPHIER_PINCTRL_GROUP(uart3_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart3_modem),
UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2),
@@ -734,7 +737,8 @@ static const char * const system_bus_groups[] = {"system_bus",
static const char * const uart0_groups[] = {"uart0"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
-static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts"};
+static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts",
+ "uart3_modem"};
static const char * const usb0_groups[] = {"usb0"};
static const char * const usb1_groups[] = {"usb1"};
static const char * const usb2_groups[] = {"usb2"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
index d09019b..88fd68f 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
@@ -583,8 +583,10 @@ static const unsigned system_bus_cs3_pins[] = {156};
static const int system_bus_cs3_muxvals[] = {1};
static const unsigned uart0_pins[] = {85, 88};
static const int uart0_muxvals[] = {1, 1};
-static const unsigned uart0_ctsrts_pins[] = {86, 87, 89};
-static const int uart0_ctsrts_muxvals[] = {1, 1, 1};
+static const unsigned uart0_ctsrts_pins[] = {86, 89};
+static const int uart0_ctsrts_muxvals[] = {1, 1};
+static const unsigned uart0_modem_pins[] = {87};
+static const int uart0_modem_muxvals[] = {1};
static const unsigned uart1_pins[] = {155, 156};
static const int uart1_muxvals[] = {13, 13};
static const unsigned uart1b_pins[] = {69, 70};
@@ -641,6 +643,7 @@ static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
UNIPHIER_PINCTRL_GROUP(system_bus_cs3),
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0_modem),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart1b),
UNIPHIER_PINCTRL_GROUP(uart2),
@@ -667,7 +670,8 @@ static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs1",
"system_bus_cs2",
"system_bus_cs3"};
-static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts"};
+static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts",
+ "uart0_modem"};
static const char * const uart1_groups[] = {"uart1", "uart1b"};
static const char * const uart2_groups[] = {"uart2"};
static const char * const uart3_groups[] = {"uart3"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
index 414ff3a..d1ed5b7 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
@@ -780,8 +780,10 @@ static const unsigned system_bus_cs5_pins[] = {55};
static const int system_bus_cs5_muxvals[] = {6};
static const unsigned uart0_pins[] = {135, 136};
static const int uart0_muxvals[] = {3, 3};
-static const unsigned uart0_ctsrts_pins[] = {137, 138, 139, 140, 141, 124};
-static const int uart0_ctsrts_muxvals[] = {3, 3, 3, 3, 3, 3};
+static const unsigned uart0_ctsrts_pins[] = {137, 139};
+static const int uart0_ctsrts_muxvals[] = {3, 3};
+static const unsigned uart0_modem_pins[] = {138, 140, 141, 124};
+static const int uart0_modem_muxvals[] = {3, 3, 3, 3};
static const unsigned uart0b_pins[] = {11, 12};
static const int uart0b_muxvals[] = {2, 2};
static const unsigned uart1_pins[] = {115, 116};
@@ -856,6 +858,7 @@ static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
UNIPHIER_PINCTRL_GROUP(system_bus_cs5),
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0_modem),
UNIPHIER_PINCTRL_GROUP(uart0b),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart1b),
@@ -887,7 +890,8 @@ static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs3",
"system_bus_cs4",
"system_bus_cs5"};
-static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts", "uart0b"};
+static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts",
+ "uart0_modem", "uart0b"};
static const char * const uart1_groups[] = {"uart1", "uart1b"};
static const char * const uart2_groups[] = {"uart2", "uart2b"};
static const char * const usb0_groups[] = {"usb0"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
index 919b9be..4f63d7b 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
@@ -1072,8 +1072,10 @@ static const unsigned uart2_pins[] = {131, 132};
static const int uart2_muxvals[] = {0, 0};
static const unsigned uart3_pins[] = {88, 89};
static const int uart3_muxvals[] = {2, 2};
-static const unsigned uart3_ctsrts_pins[] = {80, 81, 82, 83, 90, 91};
-static const int uart3_ctsrts_muxvals[] = {2, 2, 2, 2, 2, 2};
+static const unsigned uart3_ctsrts_pins[] = {90, 91};
+static const int uart3_ctsrts_muxvals[] = {2, 2};
+static const unsigned uart3_modem_pins[] = {80, 81, 82, 83};
+static const int uart3_modem_muxvals[] = {2, 2, 2, 2};
static const unsigned usb0_pins[] = {180, 181};
static const int usb0_muxvals[] = {0, 0};
static const unsigned usb1_pins[] = {182, 183};
@@ -1148,6 +1150,7 @@ static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
UNIPHIER_PINCTRL_GROUP(uart3_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart3_modem),
UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2),
@@ -1181,7 +1184,8 @@ static const char * const system_bus_groups[] = {"system_bus",
static const char * const uart0_groups[] = {"uart0"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
-static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts"};
+static const char * const uart3_groups[] = {"uart3", "uart3_ctsrts",
+ "uart3_modem"};
static const char * const usb0_groups[] = {"usb0"};
static const char * const usb1_groups[] = {"usb1"};
static const char * const usb2_groups[] = {"usb2"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 4a6580d..1d418e3 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -839,8 +839,10 @@ static const unsigned uart0_pins[] = {47, 48};
static const int uart0_muxvals[] = {0, 0};
static const unsigned uart0b_pins[] = {227, 228};
static const int uart0b_muxvals[] = {3, 3};
-static const unsigned uart0b_ctsrts_pins[] = {229, 230, 231, 232, 233, 234};
-static const int uart0b_ctsrts_muxvals[] = {3, 3, 3, 3, 3, 3};
+static const unsigned uart0b_ctsrts_pins[] = {232, 233};
+static const int uart0b_ctsrts_muxvals[] = {3, 3};
+static const unsigned uart0b_modem_pins[] = {229, 230, 231, 234};
+static const int uart0b_modem_muxvals[] = {3, 3, 3, 3};
static const unsigned uart1_pins[] = {49, 50};
static const int uart1_muxvals[] = {0, 0};
static const unsigned uart2_pins[] = {51, 52};
@@ -916,6 +918,7 @@ static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0b),
UNIPHIER_PINCTRL_GROUP(uart0b_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0b_modem),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
@@ -946,7 +949,8 @@ static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs5",
"system_bus_cs6",
"system_bus_cs7"};
-static const char * const uart0_groups[] = {"uart0", "uart0b", "uart0b_ctsrts"};
+static const char * const uart0_groups[] = {"uart0", "uart0b",
+ "uart0b_ctsrts", "uart0b_modem"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
static const char * const uart3_groups[] = {"uart3"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
index 169bb44..e52e65a 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
@@ -783,8 +783,10 @@ static const unsigned uart0_pins[] = {217, 218};
static const int uart0_muxvals[] = {8, 8};
static const unsigned uart0b_pins[] = {179, 180};
static const int uart0b_muxvals[] = {10, 10};
-static const unsigned uart0b_ctsrts_pins[] = {176, 177, 178, 183, 184, 185};
-static const int uart0b_ctsrts_muxvals[] = {10, 10, 10, 10, 10, 10};
+static const unsigned uart0b_ctsrts_pins[] = {183, 185};
+static const int uart0b_ctsrts_muxvals[] = {10, 10};
+static const unsigned uart0b_modem_pins[] = {176, 177, 178, 184};
+static const int uart0b_modem_muxvals[] = {10, 10, 10, 10};
static const unsigned uart1_pins[] = {115, 116};
static const int uart1_muxvals[] = {8, 8};
static const unsigned uart2_pins[] = {113, 114};
@@ -863,6 +865,7 @@ static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0b),
UNIPHIER_PINCTRL_GROUP(uart0b_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0b_modem),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
@@ -898,7 +901,8 @@ static const char * const spi0_groups[] = {"spi0"};
static const char * const spi1_groups[] = {"spi1"};
static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs1"};
-static const char * const uart0_groups[] = {"uart0", "uart0b", "uart0b_ctsrts"};
+static const char * const uart0_groups[] = {"uart0", "uart0b",
+ "uart0b_ctsrts", "uart0b_modem"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
static const char * const uart3_groups[] = {"uart3", "uart3b"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
index 3dc3e5b..2b388fd 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
@@ -811,8 +811,10 @@ static const unsigned int system_bus_cs1_pins[] = {15};
static const int system_bus_cs1_muxvals[] = {0};
static const unsigned int uart0_pins[] = {92, 93};
static const int uart0_muxvals[] = {0, 0};
-static const unsigned int uart0_ctsrts_pins[] = {243, 244, 245, 246, 247, 248};
-static const int uart0_ctsrts_muxvals[] = {3, 3, 3, 3, 3, 3};
+static const unsigned int uart0_ctsrts_pins[] = {243, 247};
+static const int uart0_ctsrts_muxvals[] = {3, 3};
+static const unsigned int uart0_modem_pins[] = {244, 245, 246, 248};
+static const int uart0_modem_muxvals[] = {3, 3, 3, 3};
static const unsigned int uart1_pins[] = {94, 95};
static const int uart1_muxvals[] = {0, 0};
static const unsigned int uart2_pins[] = {96, 97};
@@ -887,6 +889,7 @@ static const struct uniphier_pinctrl_group uniphier_pxs3_groups[] = {
UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0_modem),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
@@ -914,7 +917,8 @@ static const char * const spi0_groups[] = {"spi0"};
static const char * const spi1_groups[] = {"spi1"};
static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs1"};
-static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts"};
+static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts",
+ "uart0_modem"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
static const char * const uart3_groups[] = {"uart3"};
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
index 463e932..087e8db 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
@@ -513,8 +513,10 @@ static const unsigned system_bus_cs5_pins[] = {13};
static const int system_bus_cs5_muxvals[] = {1};
static const unsigned uart0_pins[] = {70, 71};
static const int uart0_muxvals[] = {3, 3};
-static const unsigned uart0_ctsrts_pins[] = {72, 73, 74};
-static const int uart0_ctsrts_muxvals[] = {3, 3, 3};
+static const unsigned uart0_ctsrts_pins[] = {72, 74};
+static const int uart0_ctsrts_muxvals[] = {3, 3};
+static const unsigned uart0_modem_pins[] = {73};
+static const int uart0_modem_muxvals[] = {3};
static const unsigned uart1_pins[] = {114, 115};
static const int uart1_muxvals[] = {0, 0};
static const unsigned uart2_pins[] = {112, 113};
@@ -572,6 +574,7 @@ static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
UNIPHIER_PINCTRL_GROUP(system_bus_cs5),
UNIPHIER_PINCTRL_GROUP(uart0),
UNIPHIER_PINCTRL_GROUP(uart0_ctsrts),
+ UNIPHIER_PINCTRL_GROUP(uart0_modem),
UNIPHIER_PINCTRL_GROUP(uart1),
UNIPHIER_PINCTRL_GROUP(uart2),
UNIPHIER_PINCTRL_GROUP(uart3),
@@ -599,7 +602,8 @@ static const char * const system_bus_groups[] = {"system_bus",
"system_bus_cs3",
"system_bus_cs4",
"system_bus_cs5"};
-static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts"};
+static const char * const uart0_groups[] = {"uart0", "uart0_ctsrts",
+ "uart0_modem"};
static const char * const uart1_groups[] = {"uart1"};
static const char * const uart2_groups[] = {"uart2"};
static const char * const uart3_groups[] = {"uart3"};
--
2.7.4
^ permalink raw reply related
* [PATCH 2/5] pinctrl: uniphier: Add another audio I/O pin-mux settings for LD20
From: Kunihiko Hayashi @ 2019-07-09 10:29 UTC (permalink / raw)
To: Linus Walleij, Masahiro Yamada, linux-gpio
Cc: linux-arm-kernel, linux-kernel, Masami Hiramatsu, Jassi Brar,
Kunihiko Hayashi
In-Reply-To: <1562668156-12927-1-git-send-email-hayashi.kunihiko@socionext.com>
This adds support for pinmux settings of aout1b groups. This group includes
aout1 signals derived from xirq pins.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
index 28e54b3..2c66e70 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
@@ -544,6 +544,8 @@ static const struct pinctrl_pin_desc uniphier_ld20_pins[] = {
static const unsigned aout1_pins[] = {137, 138, 139, 140, 141, 142};
static const int aout1_muxvals[] = {0, 0, 0, 0, 0, 0};
+static const unsigned aout1b_pins[] = {150, 151, 152, 153, 154, 155, 156};
+static const int aout1b_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
static const unsigned aoutiec1_pins[] = {135, 136};
static const int aoutiec1_muxvals[] = {0, 0};
static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25};
@@ -664,6 +666,7 @@ static const unsigned int gpio_range2_pins[] = {
static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
UNIPHIER_PINCTRL_GROUP(aout1),
+ UNIPHIER_PINCTRL_GROUP(aout1b),
UNIPHIER_PINCTRL_GROUP(aoutiec1),
UNIPHIER_PINCTRL_GROUP(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8),
@@ -708,6 +711,7 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
};
static const char * const aout1_groups[] = {"aout1"};
+static const char * const aout1b_groups[] = {"aout1b"};
static const char * const aoutiec1_groups[] = {"aoutiec1"};
static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
@@ -746,6 +750,7 @@ static const char * const usb3_groups[] = {"usb3"};
static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
UNIPHIER_PINMUX_FUNCTION(aout1),
+ UNIPHIER_PINMUX_FUNCTION(aout1b),
UNIPHIER_PINMUX_FUNCTION(aoutiec1),
UNIPHIER_PINMUX_FUNCTION(emmc),
UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] gpio: tegra: Clean-up debugfs initialisation
From: Linus Walleij @ 2019-07-09 11:44 UTC (permalink / raw)
To: Jon Hunter
Cc: Bartosz Golaszewski, Thierry Reding, open list:GPIO SUBSYSTEM,
linux-tegra, Greg KH
In-Reply-To: <f5e711a6-4472-8dcb-56b2-b789733231c2@nvidia.com>
On Tue, Jul 9, 2019 at 12:11 PM Jon Hunter <jonathanh@nvidia.com> wrote:
> On 08/07/2019 08:04, Linus Walleij wrote:
> > Sadly I've had to revert this commit because of build errors, but
> > let's see if we can figure it out after the merge window.
>
> Sorry about that. I will be more thorough in future.
Don't beat yourself up about it, happens all the time. I saw Arnd
sent some suggested fixups BTW!
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH] gpio: don't WARN() on NULL descs if gpiolib is disabled
From: Linus Walleij @ 2019-07-09 13:30 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: open list:GPIO SUBSYSTEM, linux-kernel@vger.kernel.org,
Bartosz Golaszewski, Claus H . Stovgaard
In-Reply-To: <20190708082343.30726-1-brgl@bgdev.pl>
Hi Bartosz,
On Mon, Jul 8, 2019 at 10:25 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> If gpiolib is disabled, we use the inline stubs from gpio/consumer.h
> instead of regular definitions of GPIO API. The stubs for 'optional'
> variants of gpiod_get routines return NULL in this case as if the
> relevant GPIO wasn't found. This is correct so far.
>
> Calling other (non-gpio_get) stubs from this header triggers a warning
> because the GPIO descriptor couldn't have been requested. The warning
> however is unconditional (WARN_ON(1)) and is emitted even if the passed
> descriptor pointer is NULL.
>
> We don't want to force the users of 'optional' gpio_get to check the
> returned pointer before calling e.g. gpiod_set_value() so let's only
> WARN on non-NULL descriptors.
>
> Reported-by: Claus H. Stovgaard <cst@phaseone.com>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
I remember I had this discussion in the past, and I made a large
refactoring to make it possible for drivers that need gpiod_*
calls to simply do:
select GPIOLIB
in Kconfig.
This should solve also this problem I think.
However I do realize that there may be situations where people
simply want to make GPIO support entirely optional without
having to e.g. create custom stubs and encapsulate things
inside if IS_ENABLED(CONFIG_GPIOLIB).
I was thinking something like this in the stubs:
gpiod_get[_index]() {
return POISON;
}
gpiod_get[_index]_optional() {
return NULL;
}
This way all gpiod_get() and optional calls are properly
handled and the semantic that only _optional calls
can return NULL is preserved. (Your patch would
violate this.)
Then other stubs can do:
gpiod_set_value() {
WARN_ON(desc);
}
As in your patch, and all will be smooth provided the
_optional calls have been used to obtain the desc.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH] pinctrl: aspeed: Fix missed include
From: Linus Walleij @ 2019-07-09 13:31 UTC (permalink / raw)
To: linux-gpio; +Cc: Linus Walleij, Andrew Jeffery
Some SPDX churn made my fixes drop an important include
from the Aspeed pinctrl header. Fix it up.
Cc: Andrew Jeffery <andrew@aj.id.au>
Reported-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/aspeed/pinctrl-aspeed.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.h b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
index 9b20b1c03802..b7790395aead 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.h
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
@@ -16,6 +16,8 @@
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/regmap.h>
+#include "pinmux-aspeed.h"
+
/*
* The ASPEED SoCs provide typically more than 200 pins for GPIO and other
* functions. The SoC function enabled on a pin is determined on a priority
--
2.21.0
^ permalink raw reply related
* Re: [PATCH] gpio: don't WARN() on NULL descs if gpiolib is disabled
From: Bartosz Golaszewski @ 2019-07-09 14:20 UTC (permalink / raw)
To: Linus Walleij
Cc: open list:GPIO SUBSYSTEM, linux-kernel@vger.kernel.org,
Bartosz Golaszewski, Claus H . Stovgaard
In-Reply-To: <CACRpkdb5xKHZja0mkd-wZJ+YHZpGJaDrkA0dv60MNYKXFcPK4w@mail.gmail.com>
wt., 9 lip 2019 o 15:30 Linus Walleij <linus.walleij@linaro.org> napisał(a):
>
> Hi Bartosz,
>
> On Mon, Jul 8, 2019 at 10:25 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > If gpiolib is disabled, we use the inline stubs from gpio/consumer.h
> > instead of regular definitions of GPIO API. The stubs for 'optional'
> > variants of gpiod_get routines return NULL in this case as if the
> > relevant GPIO wasn't found. This is correct so far.
> >
> > Calling other (non-gpio_get) stubs from this header triggers a warning
> > because the GPIO descriptor couldn't have been requested. The warning
> > however is unconditional (WARN_ON(1)) and is emitted even if the passed
> > descriptor pointer is NULL.
> >
> > We don't want to force the users of 'optional' gpio_get to check the
> > returned pointer before calling e.g. gpiod_set_value() so let's only
> > WARN on non-NULL descriptors.
> >
> > Reported-by: Claus H. Stovgaard <cst@phaseone.com>
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> I remember I had this discussion in the past, and I made a large
> refactoring to make it possible for drivers that need gpiod_*
> calls to simply do:
>
> select GPIOLIB
>
> in Kconfig.
>
> This should solve also this problem I think.
>
> However I do realize that there may be situations where people
> simply want to make GPIO support entirely optional without
> having to e.g. create custom stubs and encapsulate things
> inside if IS_ENABLED(CONFIG_GPIOLIB).
>
In this case the board doesn't provide any GPIO controller at all so
there's simply no need to select GPIOLIB - it would only add bloat.
> I was thinking something like this in the stubs:
>
> gpiod_get[_index]() {
> return POISON;
> }
>
> gpiod_get[_index]_optional() {
> return NULL;
> }
This is already being done.
>
> This way all gpiod_get() and optional calls are properly
> handled and the semantic that only _optional calls
> can return NULL is preserved. (Your patch would
> violate this.)
>
Maybe I'm missing something, but I don't quite see how my patch
violates this behavior. :(
> Then other stubs can do:
>
> gpiod_set_value() {
> WARN_ON(desc);
> }
>
> As in your patch, and all will be smooth provided the
> _optional calls have been used to obtain the desc.
>
> Yours,
> Linus Walleij
Bart
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox