Re: [PATCH 2/2] i2c-mux-gpio: eliminate i2c channel order assumptions

2013-10-11 Thread Ionut Nicu
Hi, On 10.10.2013 12:34, Alexander Sverdlin wrote: Hi! On 10/10/2013 10:39 AM, Ionut Nicu wrote: The i2c-mux driver uses the chan_id parameter provided in i2c_add_mux_adapter as a parameter to the select and deselect callbacks while the i2c-mux-gpio driver uses the chan_id as an index

[PATCH 1/2] i2c-mux-gpio: use gpio_set_value_cansleep()

2013-10-11 Thread Ionut Nicu
Some gpio chips may have get/set operations that can sleep. gpio_set_value() only works for chips which do not sleep, for the others we will get a kernel warning. Using gpio_set_value_cansleep() will work for both chips that do sleep and those who don't. Signed-off-by: Ionut Nicu ioan.nicu

[PATCH 2/2] i2c-mux-gpio: use reg value for i2c_add_mux_adapter

2013-10-11 Thread Ionut Nicu
-gpio will use it as an index into mux-data.values and it will actually select the bus with reg = 1. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b

[PATCH 1/2] i2c-mux-gpio: use gpio_set_value_cansleep()

2013-10-11 Thread Ionut Nicu
Some gpio chips may have get/set operations that can sleep. gpio_set_value() only works for chips which do not sleep, for the others we will get a kernel warning. Using gpio_set_value_cansleep() will work for both chips that do sleep and those who don't. Signed-off-by: Ionut Nicu ioan.nicu

[PATCH 1/2] i2c-mux-gpio: test if the gpio can sleep

2013-10-10 Thread Ionut Nicu
Some gpio chips may have get/set operations that can sleep. For this type of chips we must use the _cansleep() version of gpio_set_value. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions

[PATCH 2/2] i2c-mux-gpio: eliminate i2c channel order assumptions

2013-10-10 Thread Ionut Nicu
will actually use values[0], hence 1 as the gpio selection value. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index

Re: [PATCH 1/2] i2c-mux-gpio: test if the gpio can sleep

2013-10-10 Thread Ionut Nicu
On 10.10.2013 10:46, ext Lars-Peter Clausen wrote: On 10/10/2013 10:39 AM, Ionut Nicu wrote: Some gpio chips may have get/set operations that can sleep. For this type of chips we must use the _cansleep() version of gpio_set_value. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com

Re: [PATCH 1/2] i2c-mux-gpio: use deferred probing with the device tree

2013-10-09 Thread Ionut Nicu
On 09.10.2013 08:14, ext Peter Korsgaard wrote: WS == Wolfram Sang w...@the-dreams.de writes: WS On Tue, Oct 08, 2013 at 03:51:50PM +0200, Ionut Nicu wrote: If the i2c-parent bus driver is not loaded, returning -EINVAL will force people to unload and then reload the module again to get

[PATCH 1/2] i2c-mux-gpio: use deferred probing

2013-10-09 Thread Ionut Nicu
If the i2c-parent bus driver is not loaded, returning -ENODEV will force people to unload and then reload the module again to get it working. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] i2c-mux-gpio: use deferred probing with the device tree

2013-10-08 Thread Ionut Nicu
-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5d4a99b..6370b47 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b

Re: [PATCH] i2c-mux-gpio: use deferred probing with the device tree

2013-10-08 Thread Ionut Nicu
On 08.10.2013 15:30, ext Peter Korsgaard wrote: IN == Ionut Nicu ioan.nicu@nsn.com writes: IN If the i2c-parent bus driver is not loaded, returning IN -EINVAL will force people to unload and then reload the IN module again to get it working. IN Also of_get_named_gpio could return

[PATCH 1/2] i2c-mux-gpio: use deferred probing with the device tree

2013-10-08 Thread Ionut Nicu
If the i2c-parent bus driver is not loaded, returning -EINVAL will force people to unload and then reload the module again to get it working. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH 2/2] i2c-mux-gpio: don't ignore of_get_named_gpio errors

2013-10-08 Thread Ionut Nicu
of_get_named_gpio could return -E_PROBE_DEFER or another error code. This error should be passed further instead of being ignored. Signed-off-by: Ionut Nicu ioan.nicu@nsn.com --- drivers/i2c/muxes/i2c-mux-gpio.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git