- 22 6月, 2017 1 次提交
-
-
The i2c-imx driver incorrectly uses readb()/writeb() to read and write to the appropriate registers when performing a repeated start. The appropriate imx_i2c_read_reg()/imx_i2c_write_reg() functions should be used instead. Performing a repeated start results in a kernel panic. The platform is imx. Signed-off-by: NMichail G Etairidis <m.etairidis@beck-ipc.com> Fixes: ce1a7884 ("i2c: imx: add DMA support for freescale i2c driver") Fixes: 054b62d9 ("i2c: imx: fix the i2c bus hang issue when do repeat restart") Acked-by: NFugang Duan <fugang.duan@nxp.com> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 2月, 2017 1 次提交
-
-
由 Bhumika Goyal 提交于
Declare i2c_algorithm structures as const as they are only stored in the algo field of an i2c_adapter structure. This field is of type const, so i2c_algorithm structures having this property can be made const too. Signed-off-by: NBhumika Goyal <bhumirks@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> for Acked-by: NPatrice Chotard <patrice.chotard@st.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: NJean Delvare <jdelvare@suse.de> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 25 10月, 2016 1 次提交
-
-
由 Stefan Agner 提交于
Some SoC might load the GPIO driver after the I2C driver and using the I2C bus recovery mechanism via GPIOs. In this case it is crucial to defer probing if the GPIO request functions do so, otherwise the I2C driver gets loaded without recovery mechanisms enabled. Signed-off-by: NStefan Agner <stefan@agner.ch> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NLi Yang <leoyang.li@nxp.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 16 9月, 2016 1 次提交
-
-
由 Yang Li 提交于
Since commit 1c4b6c3b ("i2c: imx: implement bus recovery") the driver starts to use gpio/pinctrl to support optional bus recovery feature. But pinctrl is not always usable. There are platforms such as ls1021a and ls1043a that don't support pinctrl, and it could just be broken due to old/broken device tree. The patch makes it really optional that the probe function won't bailout on pinctrl problems instead it just disables bus recovery and prints out notification when there is problem with pinctrl. Since pinctrl is only used by bus recovery in this driver, move pinctrl initialization into bus recovery init function to prevent confusion. Signed-off-by: NLi Yang <leoyang.li@nxp.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 8月, 2016 1 次提交
-
-
由 Wolfram Sang 提交于
The core will do this for us now. Signed-off-by: NWolfram Sang <wsa-dev@sang-engineering.com> Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com> Acked-by: NPeter Korsgaard <peter@korsgaard.com> Acked-by: NHeiko Stuebner <heiko@sntech.de> Acked-by: NNeil Horman <nhorman@tuxdriver.com> Acked-by: NThierry Reding <treding@nvidia.com> Acked-by: NRay Jui <ray.jui@broadcom.com> Acked-by: NVladimir Zapolskiy <vz@mleia.com> Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com> Acked-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: NLaxman Dewangan <ldewangan@nvidia.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 27 4月, 2016 1 次提交
-
-
由 Oleksij Rempel 提交于
Documentation/timers/timers-howto.txt recommends to use usleep_range on delays > 10usec. According to my test results with Neonode zForce touchscreen driver, usleep_range indeed reduces CPU load. Stats collected with "./perf record -a -g -F 1000 sleep 10" i2c-imx with udelay(50): 34.19% 0.00% irq/220-Neonode [kernel.kallsyms] [k] irq_thread ---irq_thread |--33.75%--irq_thread_fn | |--19.27%--0x7f08a878 | | i2c_master_recv | | i2c_transfer | | __i2c_transfer | | i2c_imx_xfer | | |--11.71%--i2c_imx_trx_complete | | |--5.70%--i2c_imx_start <<<<---------------- | | | |--5.38%--__timer_const_udelay | | | | __timer_delay | | | | --5.07%--read_current_timer i2c-imx with usleep_range(50,100) 29.08% 0.00% irq/220-Neonode [kernel.kallsyms] [k] irq_thread ---irq_thread |--28.89%--irq_thread_fn | |--17.21%--0x7f08a878 | | i2c_master_recv | | |--17.14%--i2c_transfer | | | __i2c_transfer | | | i2c_imx_xfer | | | |--14.29%--i2c_imx_trx_complete | | | |--1.42%--i2c_imx_start <<<<---------- | | | | |--0.71%--usleep_range | | | | |--0.53%--i2c_imx_bus_busy Signed-off-by: NOleksij Rempel <linux@rempel-privat.de> Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com> Reviewed-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 3月, 2016 1 次提交
-
-
由 Dmitriy Baranov 提交于
Signed-off-by: NDmitriy Baranov <dbaranov@dev.rtsoft.ru> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 1月, 2016 1 次提交
-
-
由 Gao Pan 提交于
In i2c_imx_dma_xfer(), when dmaengine_submit() returns error, the context goto label err_submit and then return. However, the memory allocated for txdesc has not been freed yet, which leads to resource leak. Signed-off-by: NGao Pan <b54642@freescale.com> Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 05 1月, 2016 1 次提交
-
-
由 Fabio Estevam 提交于
These multi-lines comments do not follow the standard kernel coding style. In fact, they are not useful comments, so get rid of them. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 1月, 2016 4 次提交
-
-
由 Gao Pan 提交于
Replace of_get_named_gpio_flags with of_get_named_gpio because the latter has less parameters, which improves code readability. Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NGao Pan <b54642@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fabio Estevam 提交于
When DMA cannot be used, it is better to state that the I2C controller will operate in PIO mode. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Gao Pan 提交于
In our former i2c driver, i2c clk is enabled and disabled in xfer function, which contributes to power saving. However, the clk enable process brings a busy wait delay until the core is stable. As a result, the performance is sacrificed. To weigh the power consumption and i2c bus performance, runtime pm is the good solution for it. The clk is enabled when a i2c transfer starts, and disabled after a specifically defined delay. If CONFIG_PM is disabled the net result of this patch is that the clock is never disabled. Without the patch the test case (many eeprom reads) executes with approx: real 1m7.735s user 0m0.488s sys 0m20.040s With the patch the same test case (many eeprom reads) executes with approx: real 0m54.241s user 0m0.440s sys 0m5.920s Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NGao Pan <b54642@freescale.com> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> [wsa: sorted includes] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Gao Pan 提交于
During driver probe, i2c_imx_init_recovery_info() must come before i2c_add_numbered_adapter(), because the get/set_scl() functions are assigned in i2c_register_adapter() under the conditon that bus recover_info are initialized. Otherwise, get/set_scl() function pointers never get assigned. In such case, when i2c_generic_gpio_recovery() is used for bus recovery, there will be kernel crash because bri->set_scl is NULL. The solution to this bug is moving i2c_imx_init_recovery_info() before i2c_register_adapter(). Signed-off-by: NGao Pan <b54642@freescale.com> Signed-off-by: NFugang Duan <B38611@freescale.com> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 09 12月, 2015 1 次提交
-
-
由 Gao Pan 提交于
During driver probe, i2c_imx_init_recovery_info() must come before i2c_add_numbered_adapter(), because the get/set_scl() functions are assigned in i2c_register_adapter() under the conditon that bus recover_info are initialized. Otherwise, get/set_scl() function pointers never get assigned. In such case, when i2c_generic_gpio_recovery() is used for bus recovery, there will be kernel crash because bri->set_scl is NULL. The solution to this bug is moving i2c_imx_init_recovery_info() before i2c_register_adapter(). Signed-off-by: NGao Pan <b54642@freescale.com> Signed-off-by: NFugang Duan <B38611@freescale.com> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
-
- 20 11月, 2015 1 次提交
-
-
由 Hou Zhiqiang 提交于
drivers/i2c/busses/i2c-imx.c:978:2: error: implicit declaration of function ‘pinctrl_select_state’ [-Werror=implicit-function-declaration] pinctrl_select_state(i2c_imx->pinctrl, i2c_imx->pinctrl_pins_gpio); ^ Signed-off-by: NHou Zhiqiang <Zhiqiang.Hou@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 24 10月, 2015 2 次提交
-
-
由 Fabio Estevam 提交于
According to Documentation/i2c/fault-codes the response to a bus NACK should be -ENXIO, so fix the error code. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Gao Pan 提交于
Implement bus recovery methods for i2c-imx so we can recover from situations where SCL/SDA are stuck low. Once i2c bus SCL/SDA are stuck low during transfer, config the i2c pinctrl to gpio mode by calling pinctrl sleep set function, and then use GPIO to emulate the i2c protocol to send nine dummy clock to recover i2c device. After recovery, set i2c pinctrl to default group setting. Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NGao Pan <b54642@freescale.com> Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 5月, 2015 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
The platform_device_id is not modified by these drivers and core uses it as const. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 15 3月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
return type of wait_for_completion_timeout is unsigned long not int. An appropriate variable of type unsigned long is introduced and the assignments fixed up. Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 1月, 2015 1 次提交
-
-
由 Philipp Zabel 提交于
This patch fixes up some whitespace issues and addresses a few checkpatch warnings. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 14 1月, 2015 1 次提交
-
-
由 Philipp Zabel 提交于
The ret variable is set and never used in the error path of i2c_imx_dma_request. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Acked-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 1月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
wait_for_completion_timeout does not return negative values so "result" handling here should be simplified to cover the actually possible cases only. Signed-off-by: NNicholas Mc Guire <der.herr@hofr.at> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 19 11月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NYao Yuan <yao.yuan@freescale.com>
-
- 18 11月, 2014 2 次提交
-
-
由 Yao Yuan 提交于
Add dma support for i2c. This function depend on DMA driver. You can turn on it by write both the dmas and dma-name properties in dts node. DMA is optional, even DMA request unsuccessfully, i2c can also work well. Signed-off-by: NYuan Yao <yao.yuan@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Yao Yuan 提交于
If the inlcude headers aren't sorted alphabetically, then the logical choice is to append new ones, however that creates a lot of potential for conflicts or duplicates because every change will then add new includes in the same location. Signed-off-by: NYuan Yao <yao.yuan@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 11月, 2014 1 次提交
-
-
由 Fabio Estevam 提交于
According to Documentation/CodingStyle - Chapter 14: "The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); The alternative form where struct name is spelled out hurts readability and introduces an opportunity for a bug when the pointer variable type is changed but the corresponding sizeof that is passed to a memory allocator is not." So do it as recommeded. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 08 11月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
We have a central copy of the GPL for that. Some addresses were already outdated. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
-
- 20 10月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 07 10月, 2014 1 次提交
-
-
由 Fabio Estevam 提交于
In the case of errors during probe, we should disable i2c_imx->clk. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 30 9月, 2014 1 次提交
-
-
由 Haibo Chen 提交于
According to the i.mx spec, for multimaster mode, if I2C is enabled when the bus is busy and asserts start, hardware inhibits the transmission, clears MSTA without signaling a stop, generate an interrupt, and set I2C_I2SR[IAL] to indicate a failed attempt to engage the bus, which means arbitration lost. In this case, we should first test I2C_I2SR[IAL], and clear this bit if it is set, and then I2C controller default to slave receive mode. This patch check the IAL bit every time before an I2c transmission. if IAL is set, clear it and make I2C controller to default mode. Signed-off-by: NHaibo Chen <haibo.chen@freescale.com> Acked-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 07 8月, 2014 1 次提交
-
-
由 Xiubo Li 提交于
Fixes the following by using %pR: drivers/i2c/busses/i2c-imx.c: In function i2c_imx_probe() drivers/i2c/busses/i2c-imx.c:689:2: warning: format 0x%x expects argument of type unsigned int, but argument 4 has type resource_size_t [-Wformat=] dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n", ^ ... Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 03 6月, 2014 3 次提交
-
-
由 Jingoo Han 提交于
The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. For example, k.alloc and v.alloc failures use dump_stack(). Signed-off-by: NJingoo Han <jg1.han@samsung.com> Acked-by: NGuenter Roeck <linux@roeck-us.net> Reviewed-by: NJean Delvare <jdelvare@suse.de> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NFelipe Balbi <balbi@ti.com> Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fugang Duan 提交于
Since IMX serial SOCs support low bus freq mode, some clocks freq may change to save power. I2C needs to check the clock source and update the divider. For example: i.MX6SL I2C clk is from IPG_PERCLK which is sourced from IPG_CLK. Under normal operation, IPG_CLK is 66MHz, ipg_perclk is at 22MHz. In low bus freq mode, IPG_CLK is at 12MHz and IPG_PERCLK is down to 4MHz. So the I2C driver must update the divider register for each transaction when the current IPG_PERCLK is not equal to the clock of previous transaction. Signed-off-by: NFugang Duan <B38611@freescale.com> [wsa: removed an outdated comment and simplified debug output] Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fugang Duan 提交于
Test i2c device Maxim max44009, datasheet is located at: http://www.maximintegrated.com/datasheet/index.mvp/id/7175 The max44009 support repeat operation like: read -> repeat restart -> read/write The current i2c imx host controller driver don't support this operation that causes i2c bus hang due to "MTX" is cleared in .i2c_imx_read(). If "read" is the last message there have no problem, so the current driver supports all SMbus operation like: write -> repeat restart -> read/write IMX i2c controller for master receiver has some limitation: - If it is the last byte for one operation, it must generate STOP signal before read I2DR to prevent controller from generating another clock cycle. - If it is the last byte in the read, and then do repeat restart, it must set "MTX" before read I2DR to prevent controller from generating another extra clock cycle. The patch is to fix the issue. Signed-off-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 22 5月, 2014 1 次提交
-
-
由 Kaushal Butala 提交于
The smbus block read is not currently supported for imx i2c devices. This patchset adds the support to imx i2c bus so that blocks of data can be read using SMbus block reads.(using i2c_smbus_read_block_data() function from the i2c_core.c.). Tested with 3.10.9 kernel. Reviewed-by: NShawn Guo <shawn.guo@freescale.com> Signed-off-by: NKaushal Butala <kaushalkernelmailinglist@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 04 1月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
smatch rightfully says: drivers/i2c/busses/i2c-imx.c:610 i2c_imx_probe() info: why not propagate 'irq' from platform_get_irq() instead of (-2)? Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 13 12月, 2013 1 次提交
-
-
由 Fabio Estevam 提交于
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 10 10月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 23 8月, 2013 1 次提交
-
-
由 Wolfram Sang 提交于
I2C of helpers used to live in of_i2c.c but experience (from SPI) shows that it is much cleaner to have this in the core. This also removes a circular dependency between the helpers and the core, and so we can finally register child nodes in the core instead of doing this manually in each driver. So, fix the drivers and documentation, too. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 20 8月, 2013 1 次提交
-
-
由 Jingoo Han 提交于
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-