[PATCH v2 2/5] i2c: add I2C_AQ_NO_CLK_STRETCH to i2c-algo-bit.c
Add I2C_AQ_NO_CLK_STRETCH to drivers/i2c/algos/i2c-algo-bit.c when getscl is not available. Signed-off-by: Nicola Corna--- drivers/i2c/algos/i2c-algo-bit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index 899bede..9d233bb 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c @@ -617,6 +617,10 @@ const struct i2c_algorithm i2c_bit_algo = { }; EXPORT_SYMBOL(i2c_bit_algo); +const struct i2c_adapter_quirks i2c_bit_quirk_no_clk_stretch = { + .flags = I2C_AQ_NO_CLK_STRETCH, +}; + /* * registering functions to load algorithms at runtime */ @@ -635,6 +639,8 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, /* register new adapter to i2c module... */ adap->algo = _bit_algo; adap->retries = 3; + if (bit_adap->getscl == NULL) + adap->quirks = _bit_quirk_no_clk_stretch; ret = add_adapter(adap); if (ret < 0) -- 2.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/5] i2c: add i2c_check_quirks helper function
This patch adds a i2c_check_quirks helper function to check the quirk flags of an i2c adapter, in a similar way to i2c_check_functionality. Signed-off-by: Nicola Corna--- include/linux/i2c.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9697002..51028f3 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -617,6 +617,20 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func) return (func & i2c_get_functionality(adap)) == func; } +/** + * i2c_check_quirks() - Function for checking the quirk flags in an i2c adapter + * @adap: i2c adapter + * @quirks: quirk flags + * + * Return: true if the adapter has all the specified quirk flags, false if not + */ +static inline bool i2c_check_quirks(struct i2c_adapter *adap, u64 quirks) +{ + if (!adap->quirks) + return false; + return (adap->quirks->flags & quirks) == quirks; +} + /* Return the adapter number for a specific adapter */ static inline int i2c_adapter_id(struct i2c_adapter *adap) { -- 2.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/5] i2c: add i2c quirk flag for unsupported clock stretching
Add I2C_AQ_NO_CLK_STRETCH quirk flag, to be used when clock stretching is not supported. Signed-off-by: Nicola Corna--- include/linux/i2c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 768063b..9697002 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -493,6 +493,8 @@ struct i2c_adapter_quirks { /* convenience macro for typical write-then read case */ #define I2C_AQ_COMB_WRITE_THEN_READ(I2C_AQ_COMB | I2C_AQ_COMB_WRITE_FIRST | \ I2C_AQ_COMB_READ_SECOND | I2C_AQ_COMB_SAME_ADDR) +/* clock stretching is not supported */ +#define I2C_AQ_NO_CLK_STRETCH BIT(4) /* * i2c_adapter is the structure used to identify a physical i2c bus along -- 2.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] i2c: rcar: call rcar_i2c_init() after pm_runtime_get_sync()
On Thu, Oct 29, 2015 at 10:37 AM, Kuninori Morimotowrote: > From: Kuninori Morimoto > > rcar_i2c_init() initializes I2C device, but it should be called > *after* pm_runtime_get_sync(). Otherwise it outputs very hi speed > clock. This patch solved this issue, > This patch also removes pointless rcar_i2c_init() > from rcar_i2c_probe() > > Signed-off-by: Kuninori Morimoto > --- > drivers/i2c/busses/i2c-rcar.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c > index 616433d..edbfefc 100644 > --- a/drivers/i2c/busses/i2c-rcar.c > +++ b/drivers/i2c/busses/i2c-rcar.c > @@ -474,6 +474,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, > > pm_runtime_get_sync(dev); > > + rcar_i2c_init(priv); Hence now it's done again for every transfer? What about moving it just before the call to i2c_add_numbered_adapter(), and wrapping it inside pm_runtime_get_sync(dev)/pm_runtime_put()? Wolfram, what do you think? > + > ret = rcar_i2c_bus_barrier(priv); > if (ret < 0) > goto out; > @@ -612,8 +614,6 @@ static int rcar_i2c_probe(struct platform_device *pdev) > if (IS_ERR(priv->io)) > return PTR_ERR(priv->io); > > - rcar_i2c_init(priv); > - > irq = platform_get_irq(pdev, 0); > init_waitqueue_head(>wait); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 5/5] iio: humidity: si7020: add No Hold read mode
The Si7013/20/21 modules support 2 read modes: * Hold mode (blocking), where the device stretches the clock until the end of the measurement * No Hold mode (non-blocking), where the device replies NACK for every I2C call during the measurement Here the No Hold mode is implemented, selectable with the blocking_io variable within si7020_platform_data. The default mode is Hold, unless the adapter does not support clock stretching, in which case the No Hold mode is used. Signed-off-by: Nicola Corna--- This patch depends on patch "[PATCH v4 1/2] iio: humidity: si7020: replaced bitmask on humidity values with range check" drivers/iio/humidity/si7020.c| 75 include/linux/platform_data/si7020.h | 21 ++ 2 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 include/linux/platform_data/si7020.h diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c index 12128d1..674a61a 100644 --- a/drivers/iio/humidity/si7020.c +++ b/drivers/iio/humidity/si7020.c @@ -2,6 +2,7 @@ * si7020.c - Silicon Labs Si7013/20/21 Relative Humidity and Temp Sensors * Copyright (c) 2013,2014 Uplogix, Inc. * David Barksdale + * Copyright (c) 2015 Nicola Corna * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -30,33 +31,78 @@ #include #include #include +#include #include #include +#include /* Measure Relative Humidity, Hold Master Mode */ #define SI7020CMD_RH_HOLD 0xE5 +/* Measure Relative Humidity, No Hold Master Mode */ +#define SI7020CMD_RH_NO_HOLD 0xF5 /* Measure Temperature, Hold Master Mode */ #define SI7020CMD_TEMP_HOLD0xE3 +/* Measure Temperature, No Hold Master Mode */ +#define SI7020CMD_TEMP_NO_HOLD 0xF3 /* Software Reset */ #define SI7020CMD_RESET0xFE +/* Relative humidity measurement timeout (us) */ +#define SI7020_RH_TIMEOUT 22800 +/* Temperature measurement timeout (us) */ +#define SI7020_TEMP_TIMEOUT10800 +/* Minimum delay between retries (No Hold Mode) in us */ +#define SI7020_NOHOLD_SLEEP_MIN2000 +/* Maximum delay between retries (No Hold Mode) in us */ +#define SI7020_NOHOLD_SLEEP_MAX6000 static int si7020_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) { struct i2c_client **client = iio_priv(indio_dev); + struct si7020_platform_data *pdata; int ret; + bool holdmode; + unsigned char buf[2]; + unsigned long start; switch (mask) { case IIO_CHAN_INFO_RAW: - ret = i2c_smbus_read_word_data(*client, - chan->type == IIO_TEMP ? - SI7020CMD_TEMP_HOLD : - SI7020CMD_RH_HOLD); - if (ret < 0) - return ret; - *val = ret >> 2; + pdata = dev_get_platdata(&(*client)->dev); + if (pdata) + holdmode = pdata->blocking_io; + else + holdmode = !i2c_check_quirks((*client)->adapter, + I2C_AQ_NO_CLK_STRETCH); + if (holdmode) { + ret = i2c_smbus_read_word_data(*client, + chan->type == IIO_TEMP ? + SI7020CMD_TEMP_HOLD : + SI7020CMD_RH_HOLD); + if (ret < 0) + return ret; + *val = ret >> 2; + } else { + ret = i2c_smbus_write_byte(*client, + chan->type == IIO_TEMP ? + SI7020CMD_TEMP_NO_HOLD : + SI7020CMD_RH_NO_HOLD); + if (ret < 0) + return ret; + start = jiffies; + while ((ret = i2c_master_recv(*client, buf, 2)) < 0) { + if (time_after(jiffies, start + + usecs_to_jiffies( + chan->type == IIO_TEMP ? + SI7020_TEMP_TIMEOUT : + SI7020_RH_TIMEOUT))) + return ret; + usleep_range(SI7020_NOHOLD_SLEEP_MIN, +SI7020_NOHOLD_SLEEP_MAX); + } +
Re: [PATCH] MAINTAINERS: i2c: mark also subdirectories as maintained
On Thu, 2015-10-29 at 08:25 +0100, Wolfram Sang wrote: > Otherwise get_maintainer.pl will fall back to git history and CC > more people than needed. > > Signed-off-by: Wolfram Sang> Acked-by: Lee Jones > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 2f23aab10398bb..c3f01dc36b26b4 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -5090,6 +5090,7 @@ S: Maintained > F: Documentation/devicetree/bindings/i2c/ > F: Documentation/i2c/ > F: drivers/i2c/ > +F: drivers/i2c/*/ > F: include/linux/i2c.h > F: include/linux/i2c-*.h > F: include/uapi/linux/i2c.h Maybe something like this too: diff --git a/MAINTAINERS b/MAINTAINERS index a2d50fe..ff0ca88 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -93,6 +93,14 @@ Descriptions of section entries: F: drivers/net/* all files in drivers/net, but not below F: */net/* all files in "any top level directory"/net One pattern per line. Multiple F: lines acceptable. + The scripts/get_maintainer.pl tool has a quirk about subdirectories. + If the file pattern is for a directory, then any subdirectories of + the parent directory should also be specified. For instance: + F: drivers/i2c/ + F: drivers/i2c/*/ + Otherwise, the scripts/get_maintainer.pl tool by default will use + git history to add additional people that have "Signed-off-by:" + style signatures on commits to files in those subdirectories. N: Files and directories with regex patterns. N: [^a-z]tegra all files whose path contains the word tegra One pattern per line. Multiple N: lines acceptable. -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] i2c: cadence: Move to sensible power management
On Wed, Oct 28, 2015 at 9:48 PM, Sören Brinkmannwrote: > Hi Shubhrajyoti, > > > On Wed, 2015-10-28 at 12:56PM +0530, Shubhrajyoti Datta wrote: >> Currently the clocks are enabled at probe and disabled at remove. >> Which keeps the clocks enabled even if no transaction is going on. >> This patch enables the clocks at the start of transfer and disables >> after it. >> >> Also adapts to runtime pm. >> Remove xi2c->suspended and use pm runtime status instead. >> >> converts dev pm to const to silence a checkpatch warning. >> >> Signed-off-by: Shubhrajyoti Datta > > To me, this looks all good. Just one small concern below. Thanks for the review. > >> --- >> changes since v2 >> update the cc list >> >> drivers/i2c/busses/i2c-cadence.c | 73 >> -- >> 1 files changed, 46 insertions(+), 27 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-cadence.c >> b/drivers/i2c/busses/i2c-cadence.c >> index 84deed6..6b08d16 100644 >> --- a/drivers/i2c/busses/i2c-cadence.c >> +++ b/drivers/i2c/busses/i2c-cadence.c >> @@ -18,6 +18,7 @@ >> #include >> #include >> #include >> +#include >> >> /* Register offsets for the I2C device. */ >> #define CDNS_I2C_CR_OFFSET 0x00 /* Control Register, RW */ >> @@ -96,6 +97,8 @@ >>CDNS_I2C_IXR_COMP) >> >> #define CDNS_I2C_TIMEOUT msecs_to_jiffies(1000) >> +/* timeout for pm runtime autosuspend */ >> +#define CNDS_I2C_PM_TIMEOUT 1000/* ms */ >> >> #define CDNS_I2C_FIFO_DEPTH 16 >> /* FIFO depth at which the DATA interrupt occurs */ >> @@ -128,7 +131,6 @@ >> * @xfer_done: Transfer complete status >> * @p_send_buf: Pointer to transmit buffer >> * @p_recv_buf: Pointer to receive buffer >> - * @suspended: Flag holding the device's PM status >> * @send_count: Number of bytes still expected to send >> * @recv_count: Number of bytes still expected to receive >> * @curr_recv_count: Number of bytes to be received in current transfer >> @@ -141,6 +143,7 @@ >> * @quirks: flag for broken hold bit usage in r1p10 >> */ >> struct cdns_i2c { >> + struct device *dev; >> void __iomem *membase; >> struct i2c_adapter adap; >> struct i2c_msg *p_msg; >> @@ -148,7 +151,6 @@ struct cdns_i2c { >> struct completion xfer_done; >> unsigned char *p_send_buf; >> unsigned char *p_recv_buf; >> - u8 suspended; > > There might have been a reason to store this flag here. Did you test > this with lockdep and CONFIG_DEBUG_ATOMIC_SLEEP? Just to make sure that > nothing that can sleep is called from atomic context. Done now. Essentially this is a flag is set in suspend routine. and checked in the isr I use pm_runtime_suspended(id->dev) instead. > > Sören > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] MAINTAINERS: i2c: mark also subdirectories as maintained
> +The scripts/get_maintainer.pl tool has a quirk about subdirectories. > +If the file pattern is for a directory, then any subdirectories of > +the parent directory should also be specified. For instance: > + F: drivers/i2c/ > + F: drivers/i2c/*/ > +Otherwise, the scripts/get_maintainer.pl tool by default will use > +git history to add additional people that have "Signed-off-by:" > +style signatures on commits to files in those subdirectories. I'd be fine with the change. The patch description should probably state why fixing the tool is not worth it. signature.asc Description: Digital signature
Issues with touchpad / touchscreen on yoga 900
Greetings. I'm having problems with a lenovo yoga 900 not seeing it's touchscreen or touchpad. Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1275718 The problem parts of dmesg seem to be: Oct 26 15:20:08 localhost kernel: i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration Oct 26 15:20:08 localhost kernel: i2c_hid i2c-SYNA2B29:00: hid_descr_cmd failed Oct 26 15:20:08 localhost kernel: i2c_designware i2c_designware.2: i2c_dw_handle_tx_abort: lost arbitration Oct 26 15:20:08 localhost kernel: i2c_hid i2c-ELAN21EF:00: hid_descr_cmd failed This is with 4.3.0-0.rc7.git1.1.fc24.x86_64 (post rc7 4.3.0). Happy to gather further info or try patches. ;) Thanks! kevin pgpgF9G3HT9Jf.pgp Description: OpenPGP digital signature
Re: [PATCH] MAINTAINERS: i2c: mark also subdirectories as maintained
On Thu, 2015-10-29 at 16:52 +0100, Wolfram Sang wrote: > > + The scripts/get_maintainer.pl tool has a quirk about subdirectories. > > + If the file pattern is for a directory, then any subdirectories of > > + the parent directory should also be specified. For instance: > > + F: drivers/i2c/ > > + F: drivers/i2c/*/ > > + Otherwise, the scripts/get_maintainer.pl tool by default will use > > + git history to add additional people that have "Signed-off-by:" > > + style signatures on commits to files in those subdirectories. > > I'd be fine with the change. The patch description should probably state > why fixing the tool is not worth it. Not worth it vs inappropriate (arch/arm, etc...) Maybe the wording around "quirk" could be improved or expanded. Any suggestions? -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] i2c: rcar: make sure clocks are on when doing hw init
Hi Wolfram, On Thu, Oct 29, 2015 at 8:19 PM, Wolfram Sangwrote: > From: Wolfram Sang > > Reported-by: Kuninori Morimoto > Signed-off-by: Wolfram Sang Thanks for your patch! I suspect this bug was also the cause of the spurious failures of the R-Car Gen2 regulator quirk code I experienced sometimes during the last few days. > --- > drivers/i2c/busses/i2c-rcar.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c > index 616433d387cdb2..ef26e933b1e9cb 100644 > --- a/drivers/i2c/busses/i2c-rcar.c > +++ b/drivers/i2c/busses/i2c-rcar.c > @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) > if (IS_ERR(priv->io)) > return PTR_ERR(priv->io); > > + pm_runtime_enable(dev); > + pm_runtime_get_sync(dev); > rcar_i2c_init(priv); > + pm_runtime_put(dev); > > irq = platform_get_irq(pdev, 0); > init_waitqueue_head(>wait); > @@ -634,7 +637,6 @@ static int rcar_i2c_probe(struct platform_device *pdev) > return ret; pm_runtime_disable() in error path? > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Issues with touchpad / touchscreen on yoga 900
On Thu, Oct 29, 2015 at 11:29:13AM -0600, Kevin Fenzi wrote: > Greetings. > > I'm having problems with a lenovo yoga 900 not seeing it's touchscreen > or touchpad. > > Downstream bug: > https://bugzilla.redhat.com/show_bug.cgi?id=1275718 > > The problem parts of dmesg seem to be: > > Oct 26 15:20:08 localhost kernel: i2c_designware i2c_designware.1: > i2c_dw_handle_tx_abort: lost arbitration > Oct 26 15:20:08 localhost kernel: i2c_hid i2c-SYNA2B29:00: hid_descr_cmd > failed > Oct 26 15:20:08 localhost kernel: i2c_designware i2c_designware.2: > i2c_dw_handle_tx_abort: lost arbitration > Oct 26 15:20:08 localhost kernel: i2c_hid i2c-ELAN21EF:00: > hid_descr_cmd failed > > This is with 4.3.0-0.rc7.git1.1.fc24.x86_64 (post rc7 4.3.0). > > Happy to gather further info or try patches. ;) Ccing more people... signature.asc Description: Digital signature
Re: [PATCH 5/9] i2c: rcar: init new messages in irq
Laurent, > RTPORC7791SEB00010S > KOELSCH SN.057 > > I'm not sure if that tells anything about the board revision. Can you try this patch I just sent out? "i2c: rcar: make sure clocks are on when doing hw init" We know that Koelsch boards have different bootloaders leaving the clocks in different states. What you see could be the result of a disabled clock. signature.asc Description: Digital signature
Re: [PATCH] i2c: rcar: call rcar_i2c_init() after pm_runtime_get_sync()
> Hence now it's done again for every transfer? > > What about moving it just before the call to i2c_add_numbered_adapter(), > and wrapping it inside pm_runtime_get_sync(dev)/pm_runtime_put()? > > Wolfram, what do you think? I'd prefer the latter. Sending a tested patch in a second... signature.asc Description: Digital signature
[PATCH] i2c: rcar: make sure clocks are on when doing hw init
From: Wolfram SangReported-by: Kuninori Morimoto Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rcar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 616433d387cdb2..ef26e933b1e9cb 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) if (IS_ERR(priv->io)) return PTR_ERR(priv->io); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); rcar_i2c_init(priv); + pm_runtime_put(dev); irq = platform_get_irq(pdev, 0); init_waitqueue_head(>wait); @@ -634,7 +637,6 @@ static int rcar_i2c_probe(struct platform_device *pdev) return ret; } - pm_runtime_enable(dev); platform_set_drvdata(pdev, priv); ret = i2c_add_numbered_adapter(adap); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V6 6/6] dts/ls1043a: add LS1043ARDB board support
On Fri, Oct 23, 2015 at 3:01 AM, Zhiqiang Houwrote: > From: Shaohui Xie > > Signed-off-by: Shaohui Xie > Signed-off-by: Mingkai Hu > Signed-off-by: Wenbin Song > Signed-off-by: Hou Zhiqiang > --- > V6: V5 V4 V3 > - No change. > > V2: > - Remove the useless compatible "simple-bus" from cpld node. > > arch/arm64/boot/dts/freescale/Makefile| 2 +- > arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 116 > ++ > 2 files changed, 117 insertions(+), 1 deletion(-) > create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts > > diff --git a/arch/arm64/boot/dts/freescale/Makefile > b/arch/arm64/boot/dts/freescale/Makefile > index 57b41c7..33b1e57 100644 > --- a/arch/arm64/boot/dts/freescale/Makefile > +++ b/arch/arm64/boot/dts/freescale/Makefile > @@ -1,4 +1,4 @@ > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-qds.dtb fsl-ls2080a-rdb.dtb > fsl-ls2080a-simu.dtb > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-qds.dtb fsl-ls2080a-rdb.dtb > fsl-ls2080a-simu.dtb fsl-ls1043a-rdb.dtb I tried to apply the patch, but it can not be applied due to the change from a depending ls2080 patch. I will help to respin this patch and resend the three device tree related patches. Regards, Leo -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] i2c: rcar: make sure clocks are on when doing hw init
From: Wolfram SangReported-by: Kuninori Morimoto Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-rcar.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 616433d387cdb2..58dbd30c24d1cc 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) if (IS_ERR(priv->io)) return PTR_ERR(priv->io); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); rcar_i2c_init(priv); + pm_runtime_put(dev); irq = platform_get_irq(pdev, 0); init_waitqueue_head(>wait); @@ -631,22 +634,24 @@ static int rcar_i2c_probe(struct platform_device *pdev) dev_name(dev), priv); if (ret < 0) { dev_err(dev, "cannot get irq %d\n", irq); - return ret; + goto out_pm_disable; } - pm_runtime_enable(dev); platform_set_drvdata(pdev, priv); ret = i2c_add_numbered_adapter(adap); if (ret < 0) { dev_err(dev, "reg adap failed: %d\n", ret); - pm_runtime_disable(dev); - return ret; + goto out_pm_disable; } dev_info(dev, "probed\n"); return 0; + + out_pm_disable: + pm_runtime_disable(dev); + return ret; } static int rcar_i2c_remove(struct platform_device *pdev) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init
Hi Wolfram Sang wrote: > > From: Wolfram Sang> > Reported-by: Kuninori Morimoto > Signed-off-by: Wolfram Sang > --- Please add explain why this patch is needed, and what happen without this patch. And my previous patch didn't explain this, but please add 93c659d820ef291f6ca5e628f44b26cfb2226aba was cause of this issue. > drivers/i2c/busses/i2c-rcar.c | 13 + > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c > index 616433d387cdb2..58dbd30c24d1cc 100644 > --- a/drivers/i2c/busses/i2c-rcar.c > +++ b/drivers/i2c/busses/i2c-rcar.c > @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) > if (IS_ERR(priv->io)) > return PTR_ERR(priv->io); > > + pm_runtime_enable(dev); > + pm_runtime_get_sync(dev); > rcar_i2c_init(priv); > + pm_runtime_put(dev); > > irq = platform_get_irq(pdev, 0); > init_waitqueue_head(>wait); > @@ -631,22 +634,24 @@ static int rcar_i2c_probe(struct platform_device *pdev) > dev_name(dev), priv); > if (ret < 0) { > dev_err(dev, "cannot get irq %d\n", irq); > - return ret; > + goto out_pm_disable; > } > > - pm_runtime_enable(dev); > platform_set_drvdata(pdev, priv); > > ret = i2c_add_numbered_adapter(adap); > if (ret < 0) { > dev_err(dev, "reg adap failed: %d\n", ret); > - pm_runtime_disable(dev); > - return ret; > + goto out_pm_disable; > } > > dev_info(dev, "probed\n"); > > return 0; > + > + out_pm_disable: > + pm_runtime_disable(dev); > + return ret; > } > > static int rcar_i2c_remove(struct platform_device *pdev) > -- > 2.1.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] i2c: rcar: call rcar_i2c_init() after pm_runtime_get_sync()
Hi Geert > > From: Kuninori Morimoto> > > > rcar_i2c_init() initializes I2C device, but it should be called > > *after* pm_runtime_get_sync(). Otherwise it outputs very hi speed > > clock. This patch solved this issue, > > This patch also removes pointless rcar_i2c_init() > > from rcar_i2c_probe() > > > > Signed-off-by: Kuninori Morimoto > > --- > > drivers/i2c/busses/i2c-rcar.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c > > index 616433d..edbfefc 100644 > > --- a/drivers/i2c/busses/i2c-rcar.c > > +++ b/drivers/i2c/busses/i2c-rcar.c > > @@ -474,6 +474,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter > > *adap, > > > > pm_runtime_get_sync(dev); > > > > + rcar_i2c_init(priv); > > Hence now it's done again for every transfer? > > What about moving it just before the call to i2c_add_numbered_adapter(), > and wrapping it inside pm_runtime_get_sync(dev)/pm_runtime_put()? In my experience, it should be called again for every transfer. Because SoC/IP might doesn't keep register setting value if you call pm_runtime_put() (I fought with this behavior when sh_mobile IP :P ) -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] i2c: rcar: make sure clocks are on when doing hw init
Hi, Wolfram > From: Wolfram Sang> > Reported-by: Kuninori Morimoto > Signed-off-by: Wolfram Sang > --- > drivers/i2c/busses/i2c-rcar.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c > index 616433d387cdb2..ef26e933b1e9cb 100644 > --- a/drivers/i2c/busses/i2c-rcar.c > +++ b/drivers/i2c/busses/i2c-rcar.c > @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev) > if (IS_ERR(priv->io)) > return PTR_ERR(priv->io); > > + pm_runtime_enable(dev); > + pm_runtime_get_sync(dev); > rcar_i2c_init(priv); > + pm_runtime_put(dev); Please correct me if I'm misunderstanding, but in my experience, above rcar_i2c_init() result can be removed if SoC has power-off feature, and if IP doesn't keep register value power-off case ? This case register doesn't keep myfunc_A's setting, because it calls pm_runtime_put() pm_runtime_get_sync() myfunc_A() pm_runtime_put() ... pm_runtime_get_sync() myfunc_B() pm_runtime_put() It should be this ? pm_runtime_get_sync() myfunc_A() myfunc_B() pm_runtime_put() -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] MAINTAINERS: i2c: mark also subdirectories as maintained
Otherwise get_maintainer.pl will fall back to git history and CC more people than needed. Signed-off-by: Wolfram SangAcked-by: Lee Jones --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2f23aab10398bb..c3f01dc36b26b4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5090,6 +5090,7 @@ S:Maintained F: Documentation/devicetree/bindings/i2c/ F: Documentation/i2c/ F: drivers/i2c/ +F: drivers/i2c/*/ F: include/linux/i2c.h F: include/linux/i2c-*.h F: include/uapi/linux/i2c.h -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] i2c: rcar: call rcar_i2c_init() after pm_runtime_get_sync()
From: Kuninori Morimotorcar_i2c_init() initializes I2C device, but it should be called *after* pm_runtime_get_sync(). Otherwise it outputs very hi speed clock. This patch solved this issue, This patch also removes pointless rcar_i2c_init() from rcar_i2c_probe() Signed-off-by: Kuninori Morimoto --- drivers/i2c/busses/i2c-rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 616433d..edbfefc 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -474,6 +474,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, pm_runtime_get_sync(dev); + rcar_i2c_init(priv); + ret = rcar_i2c_bus_barrier(priv); if (ret < 0) goto out; @@ -612,8 +614,6 @@ static int rcar_i2c_probe(struct platform_device *pdev) if (IS_ERR(priv->io)) return PTR_ERR(priv->io); - rcar_i2c_init(priv); - irq = platform_get_irq(pdev, 0); init_waitqueue_head(>wait); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 4/4] iio: humidity: si7020: added No Hold read mode
>> 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 return type? I'd use bool, given that the result is a boolean value. It's semantically more clear this way. -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init
Hi Wolfram, Thank you for the patch. I'm afraid this doesn't make any noticeable difference. With or without the patch applied the adv7511 can't be detected using the latest driver tag (renesas-devel-20151026-v4.3-rc7). However, I have a bit more information to report. First of all, I got one kernel panic. [9.596439] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [9.603252] [drm] No driver support for vblank timestamp query. [9.609724] rcar-du feb0.display: failed to initialize DRM/KMS (-517) [9.616106] adv7180 2-0020: chip found @ 0x20 (e653.i2c) [9.632980] rcar_thermal e61f.thermal: 1 sensor probed [9.641533] Unable to handle kernel paging request at virtual address [9.648927] pgd = eb2adf40 [9.651695] [] *pgd=8040007003, *pmd=6bfde003, *pte= [9.658579] Internal error: Oops: a07 [#1] SMP ARM [9.663475] Modules linked in: rcar_thermal adv7180(+) phy_rcar_gen2 soundcore udc_core [9.671719] CPU: 0 PID: 552 Comm: udevd Not tainted 4.3.0-rc7-07332- gfb990fd3ff96 #114 [9.679811] Hardware name: Generic R8A7791 (Flattened Device Tree) [9.686125] task: eb11f400 ti: ea92e000 task.ti: ea92e000 [9.691653] PC is at rcar_i2c_irq+0xd4/0x3e4 [9.696018] LR is at rcar_i2c_write+0x28/0x38 [9.700471] pc : []lr : []psr: 8193 [9.700471] sp : ea92fea8 ip : ea92fe88 fp : ea92fecc [9.712200] r10: r9 : c067f37c r8 : [9.717538] r7 : r6 : ea92db38 r5 : r4 : eb223c10 [9.724206] r3 : r2 : r1 : r0 : eb223c10 [9.730877] Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [9.738260] Control: 30c5387d Table: 6b2adf40 DAC: fffd [9.744131] Process udevd (pid: 552, stack limit = 0xea92e210) [9.750090] Stack: (0xea92fea8 to 0xea93) [9.754543] fea0: c0121368 c011cdfc eb1f9b90 eb21cc40 eb1d4220 0068 [9.762903] fec0: ea92ff0c ea92fed0 c00727bc c03244c0 ea886198 0101 eada6e90 eb1d41c0 [9.771263] fee0: eb1d41c0 eb1d4220 eb00a800 0003 f0803000 [9.779622] ff00: ea92ff2c ea92ff10 c0072a24 c0072760 eb1d41c0 c0656484 [9.787981] ff20: ea92ff4c ea92ff30 c0075e40 c00729c0 c0075d80 0068 c06361f0 [9.796339] ff40: ea92ff5c ea92ff50 c0071fd0 c0075d8c ea92ff84 ea92ff60 c007211c c0071fb4 [9.804697] ff60: ea92ffb0 f0802000 f080200c c063cd10 c0656480 ea92ffb0 ea92ffac ea92ff88 [9.813055] ff80: c000a4a0 c00720c4 f948 8010 30c5387d 30c5387d 0004 [9.821414] ffa0: ea92ffb0 c0015dc8 c000a45c 0004 0001fabc 0004 0002d00c [9.829773] ffc0: 03ef 000419be bec86de8 00041168 00032060 0003 0004 000419bf [9.838132] ffe0: 0018 bec86dc0 f97c f948 8010 ea92fff4 [9.846488] Backtrace: [9.849010] [] (rcar_i2c_irq) from [] (handle_irq_event_percpu+0x68/0x260) [9.857810] r6:0068 r5:eb1d4220 r4:eb21cc40 [9.862560] [] (handle_irq_event_percpu) from [] (handle_irq_event+0x70/0x94) [9.871626] r10:f0803000 r9:0003 r8:eb00a800 r7: r6: r5:eb1d4220 [9.879675] r4:eb1d41c0 [9.882278] [] (handle_irq_event) from [] (handle_fasteoi_irq+0xc0/0x1c0) [9.890990] r6: r5:c0656484 r4:eb1d41c0 r3: [9.896812] [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x28/0x38) [9.905612] r6: r5:c06361f0 r4:0068 r3:c0075d80 [9.911433] [] (generic_handle_irq) from [] (__handle_domain_irq+0x64/0xc4) [9.920327] [] (__handle_domain_irq) from [] (gic_handle_irq+0x50/0x98) [9.928860] r8:ea92ffb0 r7:c0656480 r6:c063cd10 r5:f080200c r4:f0802000 r3:ea92ffb0 [9.936824] [] (gic_handle_irq) from [] (__irq_usr+0x48/0x60) [9.944471] Exception stack(0xea92ffb0 to 0xea92fff8) [9.949632] ffa0: 0004 0001fabc 0004 0002d00c [9.957991] ffc0: 03ef 000419be bec86de8 00041168 00032060 0003 0004 000419bf [9.966349] ffe0: 0018 bec86dc0 f97c f948 8010 [9.973105] r10:0004 r8:30c5387d r7:30c5387d r6: r5:8010 r4:f948 [9.981158] Code: e5962008 e5941000 e5911024 f57ff04f (e7c21003) [9.987389] ---[ end trace 4f04837ce7816c01 ]--- [9.992107] Kernel panic - not syncing: Fatal exception in interrupt [9.998603] CPU1: stopping [ 10.001380] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 4.3.0- rc7-07332-gfb990fd3ff96 #114 [ 10.010893] Hardware name: Generic R8A7791 (Flattened Device Tree) [ 10.017207] Backtrace: [ 10.019729] [] (dump_backtrace) from [] (show_stack+0x20/0x24) [ 10.027466] r6:c067f2c8 r5:0001 r4: r3: [ 10.033297] [] (show_stack) from [] (dump_stack+0x8c/0xc0) [ 10.040686] [] (dump_stack) from [] (handle_IPI+0x1b8/0x2dc) [ 10.048245]
RE: [PATCH V6 6/6] dts/ls1043a: add LS1043ARDB board support
> -Original Message- > From: pku@gmail.com [mailto:pku@gmail.com] On Behalf Of Li Yang > Sent: 2015年10月30日 4:33 > To: Hou Zhiqiang-B48286 > Cc: linux-arm-ker...@lists.infradead.org; Catalin Marinas; Will Deacon; > linux-i2c@vger.kernel.org; linux-watch...@vger.kernel.org; linux- > d...@vger.kernel.org; linux-...@vger.kernel.org; Mark Rutland; Xie > Shaohui-B21989; Jonathan Corbet; Sharma Bhupesh-B45370; Michael Turquette; > w...@the-dreams.de; sb...@codeaurora.org; w...@iguana.be; Song Wenbin- > B53747; Wood Scott-B07421; Hu Mingkai-B21284; li...@roeck-us.net > Subject: Re: [PATCH V6 6/6] dts/ls1043a: add LS1043ARDB board support > > On Fri, Oct 23, 2015 at 3:01 AM, Zhiqiang Hou> wrote: > > From: Shaohui Xie > > > > Signed-off-by: Shaohui Xie > > Signed-off-by: Mingkai Hu > > Signed-off-by: Wenbin Song > > Signed-off-by: Hou Zhiqiang > > --- > > V6: V5 V4 V3 > > - No change. > > > > V2: > > - Remove the useless compatible "simple-bus" from cpld node. > > > > arch/arm64/boot/dts/freescale/Makefile| 2 +- > > arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 116 > > ++ > > 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 > > arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts > > > > diff --git a/arch/arm64/boot/dts/freescale/Makefile > > b/arch/arm64/boot/dts/freescale/Makefile > > index 57b41c7..33b1e57 100644 > > --- a/arch/arm64/boot/dts/freescale/Makefile > > +++ b/arch/arm64/boot/dts/freescale/Makefile > > @@ -1,4 +1,4 @@ > > -dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-qds.dtb > > fsl-ls2080a-rdb.dtb fsl-ls2080a-simu.dtb > > +dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-qds.dtb > > +fsl-ls2080a-rdb.dtb fsl-ls2080a-simu.dtb fsl-ls1043a-rdb.dtb > > I tried to apply the patch, but it can not be applied due to the change > from a depending ls2080 patch. I will help to respin this patch and > resend the three device tree related patches. ok. Thanks, Zhiqiang