Re: [PATCH 10/10] i2c: pca954x: get rid of the i2c deadlock workaround

2016-01-04 Thread Lars-Peter Clausen
On 01/04/2016 04:10 PM, Peter Rosin wrote: > From: Peter Rosin > > Signed-off-by: Peter Rosin It would be quite good if the commit messaged said why it is now safe to remove the workaround. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 1/3] i2c: Revert "i2c: xiic: Do not reset controller before every transfer"

2015-11-18 Thread Lars-Peter Clausen
On 11/17/2015 03:28 PM, Shubhrajyoti Datta wrote: > On Tue, Nov 17, 2015 at 1:04 PM, Lars-Peter Clausen <l...@metafoo.de> wrote: >> On 11/17/2015 06:17 AM, Shubhrajyoti Datta wrote: >>> On Mon, Nov 16, 2015 at 7:12 PM, Lars-Peter Clausen <l...@metafoo.de> wrote:

[PATCH 2/3] i2c: xiic: Prevent concurrent running of the IRQ handler and __xiic_start_xfer()

2015-11-16 Thread Lars-Peter Clausen
e the disabling of interrupts") Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- drivers/i2c/busses/i2c-xiic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 705cf69..0b20449 100644 --- a/drivers/i

[PATCH 1/3] i2c: Revert "i2c: xiic: Do not reset controller before every transfer"

2015-11-16 Thread Lars-Peter Clausen
t;i2c: xiic: Do not reset controller before every transfer") Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- drivers/i2c/busses/i2c-xiic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index e23a7b0..705cf69 10064

[PATCH 3/3] i2c: xiic: Replace spinlock with mutex

2015-11-16 Thread Lars-Peter Clausen
All protected sections are only called from sleep-able context, so there is no need to use a spinlock. Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- drivers/i2c/busses/i2c-xiic.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/buss

Re: [PATCH 1/3] i2c: Revert "i2c: xiic: Do not reset controller before every transfer"

2015-11-16 Thread Lars-Peter Clausen
On 11/17/2015 06:17 AM, Shubhrajyoti Datta wrote: > On Mon, Nov 16, 2015 at 7:12 PM, Lars-Peter Clausen <l...@metafoo.de> wrote: >> Commit d701667bb331 ("i2c: xiic: Do not reset controller before every >> transfer") removed the reinitialization of the control

Re: [PATCH v4 4/4] iio: humidity: si7020: added No Hold read mode

2015-10-29 Thread Lars-Peter Clausen
>> So maybe more like this: >> >> static inline bool i2c_check_quirks(struct i2c_adapter *adap, u64 quirks) >> { >> if (!adap->quirks) >> return false; >> return (adap->quirks->flags & quirks) == quirks; >> } > > Should I use bool (like in your snippet) or int (like > i2c_check_functionality) as

Re: [PATCH v4 4/4] iio: humidity: si7020: added No Hold read mode

2015-10-28 Thread Lars-Peter Clausen
On 10/28/2015 07:58 AM, Nicola Corna wrote: [...] > + holdmode = !((*client)->adapter->quirks && > + (*client)->adapter->quirks->flags & [...] > +client->adapter->quirks && > +client->adapter->quirks->flags &

Re: [PATCH v4 4/4] iio: humidity: si7020: added No Hold read mode

2015-10-28 Thread Lars-Peter Clausen
On 10/28/2015 07:35 PM, Nicola Corna wrote: > October 28 2015 10:38 AM, "Lars-Peter Clausen" <l...@metafoo.de> wrote: > >> On 10/28/2015 07:58 AM, Nicola Corna wrote: >> [...] >> >>> + holdmode = !((*client)->adapter->quirks && >&g

Re: [PATCH] i2c: s3c2410: Don't enable PM runtime on the adapter device

2015-04-16 Thread Lars-Peter Clausen
On 04/16/2015 12:33 PM, Sylwester Nawrocki wrote: On 16/04/15 12:10, Charles Keepax wrote: Commit 523c5b89640e (i2c: Remove support for legacy PM) removed the PM ops from the bus type, which causes the pm operations on the s3c2410 adapter device to fail (-ENOSUPP in rpm_callback). The adapter

Re: [PATCH 21/66] rtl2830: implement own I2C locking

2015-02-02 Thread Lars-Peter Clausen
On 02/02/2015 09:33 PM, Wolfram Sang wrote: Ok, this may eventually work ok for now, but a further change at the I2C core could easily break it. So, we need to double check about such patch with the I2C maintainer. Jean, Are you ok with such patch? If so, please ack. Jean handed over I2C

Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI

2014-12-18 Thread Lars-Peter Clausen
Added I2C to Cc. On 12/15/2014 10:19 PM, Srinivas Pandruvada wrote: Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking their presence. This is needed because when this device sits behind an i2c mux, there is no way to define i2c mux in ACPI.

Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI

2014-12-18 Thread Lars-Peter Clausen
On 12/18/2014 05:52 PM, Srinivas Pandruvada wrote: On Thu, 2014-12-18 at 17:28 +0100, Lars-Peter Clausen wrote: Added I2C to Cc. On 12/15/2014 10:19 PM, Srinivas Pandruvada wrote: Using i2c auto detect feature and auto device creation feature, enumerate ak8975 device, by checking

Re: [PATCH 3/3] iio: ak8975: Added autodetect feature for ACPI

2014-12-18 Thread Lars-Peter Clausen
On 12/18/2014 06:30 PM, Srinivas Pandruvada wrote: On Thu, 2014-12-18 at 18:05 +0100, Lars-Peter Clausen wrote: On 12/18/2014 05:52 PM, Srinivas Pandruvada wrote: On Thu, 2014-12-18 at 17:28 +0100, Lars-Peter Clausen wrote: Added I2C to Cc. On 12/15/2014 10:19 PM, Srinivas Pandruvada wrote

Re: [PATCH 2/2] i2c: Remove support for legacy PM

2014-12-04 Thread Lars-Peter Clausen
On 12/04/2014 07:11 PM, Wolfram Sang wrote: On Sun, Nov 30, 2014 at 05:52:32PM +0100, Lars-Peter Clausen wrote: There haven't been any I2C driver that use the legacy suspend/resume callbacks for a while now and new drivers are supposed to use PM ops. So remove support for legacy suspend/resume

Re: [PATCH 3/4] devicetree: bindings: Add defeature-repeated-start property for Cadence I2C

2014-12-02 Thread Lars-Peter Clausen
On 12/02/2014 03:15 PM, Wolfram Sang wrote: What do you do when disable repeated start? Sending STOP and START? If so, this is really something different than repeated start. By using I2C_FUNC_I2C a user expects repeated start, so if the HW does not support it, we should say so and don't try to

[PATCH 1/2] Documentation: i2c: Use PM ops instead of legacy suspend/resume

2014-11-30 Thread Lars-Peter Clausen
New drivers should use PM ops instead of the legacy suspend/resume callbacks. Update the I2C device driver guides to reflect this. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- Documentation/i2c/upgrading-clients | 6 ++ Documentation/i2c/writing-clients | 8 2 files

[PATCH 2/2] i2c: Remove support for legacy PM

2014-11-30 Thread Lars-Peter Clausen
core will automatically fallback directly to using the device's PM ops if no bus PM ops are specified there is no need to have any I2C bus PM ops. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 118 - include/linux

Re: [PATCH] i2c: Add generic support passing secondary devices addresses

2014-09-22 Thread Lars-Peter Clausen
On 09/22/2014 12:45 PM, Mika Westerberg wrote: On Fri, Sep 05, 2014 at 04:02:19PM +0200, Jean-Michel Hautbois wrote: Some I2C devices have multiple addresses assigned, for example each address corresponding to a different internal register map page of the device. So far drivers which need

Re: [PATCH] i2c: Add generic support passing secondary devices addresses

2014-09-22 Thread Lars-Peter Clausen
On 09/22/2014 03:45 PM, Mika Westerberg wrote: On Mon, Sep 22, 2014 at 03:27:36PM +0200, Lars-Peter Clausen wrote: On 09/22/2014 12:45 PM, Mika Westerberg wrote: On Fri, Sep 05, 2014 at 04:02:19PM +0200, Jean-Michel Hautbois wrote: Some I2C devices have multiple addresses assigned

Re: [PATCH] i2c: Add generic support passing secondary devices addresses

2014-09-21 Thread Lars-Peter Clausen
On 09/21/2014 07:49 PM, Wolfram Sang wrote: This raises the first question for me: Are the additional addresses configurable? Sadly, I can't find good documentation for the adv7604. Otherwise, if I know I have a adv7604 and know its addresses, this information should go into the driver and not

Re: [PATCH] i2c: Add generic support passing secondary devices addresses

2014-09-20 Thread Lars-Peter Clausen
On 09/20/2014 06:49 PM, Wolfram Sang wrote: On Fri, Sep 05, 2014 at 04:02:19PM +0200, Jean-Michel Hautbois wrote: Some I2C devices have multiple addresses assigned, for example each address corresponding to a different internal register map page of the device. So far drivers which need support

Re: [PATCH v2 1/2] Allow DT parsing of secondary devices

2014-08-29 Thread Lars-Peter Clausen
On 08/29/2014 05:15 PM, Jean-Michel Hautbois wrote: This is based on reg and reg-names in DT. Example: reg = 0x10 0x20 0x30; reg-names = main, io, test; This function will create dummy devices io and test with addresses 0x20 and 0x30 respectively. Signed-off-by: Jean-Michel Hautbois

Re: [PATCH v2 2/2] adv7604: Use DT parsing in dummy creation

2014-08-29 Thread Lars-Peter Clausen
On 08/29/2014 05:15 PM, Jean-Michel Hautbois wrote: This patch uses DT in order to parse addresses for dummy devices of adv7604. The ADV7604 has thirteen 256-byte maps that can be accessed via the main I²C ports. Each map has it own I²C address and acts as a standard slave device on the I²C bus.

Re: [PATCH v2 1/2] Allow DT parsing of secondary devices

2014-08-29 Thread Lars-Peter Clausen
On 08/29/2014 05:15 PM, Jean-Michel Hautbois wrote: This is based on reg and reg-names in DT. Example: reg = 0x10 0x20 0x30; reg-names = main, io, test; This function will create dummy devices io and test with addresses 0x20 and 0x30 respectively. Signed-off-by: Jean-Michel Hautbois

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

2013-10-10 Thread Lars-Peter Clausen
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 --- drivers/i2c/muxes/i2c-mux-gpio.c | 11 --- 1

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

2013-10-10 Thread Lars-Peter Clausen
On 10/10/2013 09:43 PM, Wolfram Sang wrote: On Thu, Oct 10, 2013 at 10:46:41AM +0200, Lars-Peter Clausen wrote: + if (gpio_cansleep(gpio)) + gpio_set_value_cansleep(gpio, val (1 i)); + else + gpio_set_value(gpio, val (1

Re: [PATCH v2 2/3] i2c: xilinx: Set tx direction in write operation

2013-10-04 Thread Lars-Peter Clausen
On 10/04/2013 01:55 PM, Wolfram Sang wrote: On Fri, Oct 04, 2013 at 11:53:49AM +0200, Michal Simek wrote: On 10/04/2013 07:46 AM, Wolfram Sang wrote: + cr = xiic_getreg32(i2c, XIIC_CR_REG_OFFSET); + cr |= XIIC_CR_DIR_IS_TX_MASK; + xiic_setreg32(i2c, XIIC_CR_REG_OFFSET, cr); + Is there

[PATCH 1/8] [media] s5c73m3: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. The results of the expressions 'client-driver.driver-field' and 'client-dev.driver-field' are identical, so replace all occurrences of the former with the later. Signed-off-by: Lars-Peter Clausen l...@metafoo.de

[PATCH 8/8] i2c: Remove redundant 'driver' field from the i2c_client struct

2013-09-29 Thread Lars-Peter Clausen
struct. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 21 - drivers/i2c/i2c-smbus.c | 10 ++ include/linux/i2c.h | 2 -- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c

[PATCH 6/8] ALSA: ppc: keywest: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. Use 'to_i2c_driver(client-dev.driver)' instead to get direct access to the i2c_driver struct. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- sound/ppc/keywest.c | 4 ++-- 1 file changed, 2 insertions

[PATCH 4/8] drm: encoder_slave: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
'to_i2c_driver(client-dev.driver)'. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/gpu/drm/drm_encoder_slave.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index 0cfb60f..d18b88b

[PATCH 0/8] i2c: Remove redundant driver field from the i2c_client struct

2013-09-29 Thread Lars-Peter Clausen
. - Lars Lars-Peter Clausen (8): [media] s5c73m3: Don't use i2c_client-driver [media] exynos4-is: Don't use i2c_client-driver [media] core: Don't use i2c_client-driver drm: encoder_slave: Don't use i2c_client-driver drm: nouveau: Don't use i2c_client-driver ALSA: ppc: keywest: Don't use

[PATCH 5/8] drm: nouveau: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. Use 'to_i2c_driver(client-dev.driver)' instead to get direct access to the i2c_driver struct. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Cc: Martin Peres martin.pe...@labri.fr --- drivers/gpu/drm/nouveau

[PATCH 7/8] ASoC: imx-wm8962: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. Check i2c_client-dev.driver instead to see if a driver is bound to the device. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- sound/soc/fsl/imx-wm8962.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 3/8] [media] core: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. The results of the expressions 'client-driver.driver-field' and 'client-dev.driver-field' are identical, so replace all occurrences of the former with the later. Signed-off-by: Lars-Peter Clausen l...@metafoo.de

[PATCH 2/8] [media] exynos4-is: Don't use i2c_client-driver

2013-09-29 Thread Lars-Peter Clausen
The 'driver' field of the i2c_client struct is redundant and is going to be removed. The results of the expressions 'client-driver.driver-field' and 'client-dev.driver-field' are identical, so replace all occurrences of the former with the later. Signed-off-by: Lars-Peter Clausen l...@metafoo.de

Re: [PATCH 3/6] i2c: Ignore return value of i2c_del_adapter()

2013-03-30 Thread Lars-Peter Clausen
Hi Jean, On 03/30/2013 08:55 AM, Jean Delvare wrote: Hi Lars-Peter, On Sat, 9 Mar 2013 19:16:46 +0100, Lars-Peter Clausen wrote: i2c_del_adapter() always returns 0. I beg you pardon? i2c_del_adapter() starts with: int i2c_del_adapter(struct i2c_adapter *adap) { int res = 0

Re: [PATCH 0/6] Make return type of i2c_del_adapter() (and i2c_del_mux_adapter()) void

2013-03-30 Thread Lars-Peter Clausen
On 03/30/2013 09:13 PM, Jean Delvare wrote: Hi Lars, On Sat, 9 Mar 2013 19:16:43 +0100, Lars-Peter Clausen wrote: Currently i2c_del_adapter() returns 0 on success and potentially an error code on failure. Unfortunately this doesn't mix too well with the Linux device driver model

[PATCH 1/6] i2c: Remove detach_adapter

2013-03-09 Thread Lars-Peter Clausen
The detach_adapter callback has been deprecated for quite some time and has no user left. Keeping it alive blocks other cleanups, so remove it. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 33 ++--- include/linux/i2c.h| 7

[PATCH 0/6] Make return type of i2c_del_adapter() (and i2c_del_mux_adapter()) void

2013-03-09 Thread Lars-Peter Clausen
. - Lars Lars-Peter Clausen (6): i2c: Remove detach_adapter i2c: i2c_del_adapter: Don't treat removing a non-registered adapter as error i2c: Ignore return value of i2c_del_adapter() i2c: Make return type of i2c_del_adapter() void i2c: Ignore the return value of i2c_del_mux_adapter

[PATCH 2/6] i2c: i2c_del_adapter: Don't treat removing a non-registered adapter as error

2013-03-09 Thread Lars-Peter Clausen
an I2C adapter from the system. If the adapter is not registered in the first place this becomes a no-op. So we can return success without having to do anything. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 3/6] i2c: Ignore return value of i2c_del_adapter()

2013-03-09 Thread Lars-Peter Clausen
-by: Lars-Peter Clausen l...@metafoo.de --- drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 3 +-- drivers/i2c/busses/i2c-amd756-s4882.c| 6 +- drivers/i2c/busses/i2c-at91.c| 5 ++--- drivers/i2c/busses/i2c-cbus-gpio.c | 4 +++- drivers/i2c/busses/i2c-intel-mid.c

[PATCH 4/6] i2c: Make return type of i2c_del_adapter() void

2013-03-09 Thread Lars-Peter Clausen
-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/i2c-core.c | 6 ++ include/linux/i2c.h| 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 7727d33..838d030 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c

[PATCH 5/6] i2c: Ignore the return value of i2c_del_mux_adapter()

2013-03-09 Thread Lars-Peter Clausen
it will). A subsequent patch will make the return type of i2c_del_mux_adapter() void. Cc: Guenter Roeck guenter.ro...@ericsson.com Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c

[PATCH] I2C: xiic: Add OF binding support

2012-04-25 Thread Lars-Peter Clausen
Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- Documentation/devicetree/bindings/i2c/xiic.txt | 22 ++ drivers/i2c/busses/i2c-xiic.c | 23 ++- 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 Documentation

Re: [PATCH v3 0/2] i2c/of: Populate multiplexed i2c busses from the device tree.

2012-04-13 Thread Lars-Peter Clausen
On 04/12/2012 11:14 PM, David Daney wrote: From: David Daney david.da...@cavium.com v3: Integrate changes from Lars-Peter Clausen to make better use of the of_*() infrastructure. Get rid of ugly #ifdefs. v2: Update bindings to use reg insutead of cell-index v1: Unchanged from

Re: [PATCH 3/5] SPI: Add helper macro for spi_driver boilerplate

2011-11-23 Thread Lars-Peter Clausen
On 11/24/2011 01:13 AM, Ben Dooks wrote: On Wed, Nov 16, 2011 at 10:12:54AM -0700, Grant Likely wrote: On Wed, Nov 16, 2011 at 2:13 AM, Lars-Peter Clausen l...@metafoo.de wrote: This patch introduces the module_spi_driver macro which is a convenience macro for SPI driver modules similar

[PATCH 0/5] Generalize module_platform_driver

2011-11-16 Thread Lars-Peter Clausen
candidates. It probably makes sense to merge the first three patches together. The last two can probably, since this is not urgent, wait until the first three have reached mainline. - Lars Lars-Peter Clausen (5): drivercore: Generalize module_platform_driver I2C: Add helper macro for i2c_driver

[PATCH 3/5] SPI: Add helper macro for spi_driver boilerplate

2011-11-16 Thread Lars-Peter Clausen
a few lines of boilerplate code per SPI driver. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- include/linux/spi/spi.h | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index bb4f5fb..176fce9 100644

[PATCH 2/5] I2C: Add helper macro for i2c_driver boilerplate

2011-11-16 Thread Lars-Peter Clausen
a few lines of boilerplate code per I2C driver. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- include/linux/i2c.h | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a81bf6d..7e92854 100644 --- a/include