Commit Graph

13 Commits

Author SHA1 Message Date
Hoan Tran da24b8240f i2c: xgene-slimpro: Support v2
This patch supports xgene-slimpro-i2c v2 which uses the non-cachable memory
as the PCC shared memory.

Signed-off-by: Hoan Tran <hotran@apm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-11-01 23:54:53 +01:00
Arnd Bergmann 063345aede i2c: xgene-slimpro: include linux/io.h for memremap
The newly added support for the pcc mailbox fails to build
in some configurations:

drivers/i2c/busses/i2c-xgene-slimpro.c: In function 'xgene_slimpro_i2c_probe':
drivers/i2c/busses/i2c-xgene-slimpro.c:516:25: error: implicit declaration of function 'memremap'; did you mean 'memcmp'? [-Werror=implicit-function-declaration]
drivers/i2c/busses/i2c-xgene-slimpro.c:518:13: error: 'MEMREMAP_WB' undeclared (first use in this function)
drivers/i2c/busses/i2c-xgene-slimpro.c:518:13: note: each undeclared identifier is reported only once for each function it appears in

This includes the missing header file.

Fixes: df5da47fe7 ("i2c: xgene-slimpro: Add ACPI support by using PCC mailbox")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-18 14:59:45 +02:00
Hoan Tran df5da47fe7 i2c: xgene-slimpro: Add ACPI support by using PCC mailbox
This patch adds ACPI support by using PCC mailbox communication
interface.

Signed-off-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-02 22:27:25 +02:00
Hoan Tran d140bd42b2 i2c: xgene-slimpro: Use a single function to send command message
This patch refactors the code to use a single message function to
send command message.

Signed-off-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-02 22:21:21 +02:00
Tin Huynh 83345d51a4 i2c: xgene: Set ACPI_COMPANION_I2C
With ACPI, i2c-core requires ACPI companion to be set in order for it
to create slave device.
This patch sets the ACPI companion accordingly.

Signed-off-by: Tin Huynh <tnhuynh@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-05-17 09:21:06 +02:00
Bhumika Goyal 92d9d0dfb0 i2c: busses: constify i2c_algorithm structures
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: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> for
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-02-09 17:06:52 +01:00
Tin Huynh 1635c5d04e i2c: xgene: Fix missing code of DTB support
In DTB case, i2c-core doesn't create slave device which is installed
on i2c-xgene bus because of missing code in this driver.
This patch fixes this issue.

Signed-off-by: Tin Huynh <tnhuynh@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-12-17 19:35:41 +01:00
Hoan Tran 603616017c i2c: xgene: Avoid dma_buffer overrun
SMBus block command uses the first byte of buffer for the data length.
The dma_buffer should be increased by 1 to avoid the overrun issue.

Reported-by: Phil Endecott <phil_gjouf_endecott@chezphil.org>
Signed-off-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
2016-10-25 11:50:52 +02:00
Wolfram Sang ea734404f3 i2c: don't print error when adding adapter fails
The core will do this for us now.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-08-22 08:19:55 +02:00
Dan Carpenter a4a9a8cb32 i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code
The dma_mapping_error() function returns true if there is an error, it
doesn't return an error code.  We should return -ENOMEM.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
2015-08-24 14:23:31 +02:00
Axel Lin 724948106e i2c: xgene-slimpro: Fix missing mbox_free_channel call in probe error path
Free requested mailbox channel before return error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-07-09 22:13:10 +02:00
Feng Kan d845340394 i2c: busses: xgene-slimpro: fix incorrect __init declation for probe
Fix section mismatch error during kernel build for xgene_slimpro_i2c_probe
function. It was incorrectly defined with __init declaration.

Signed-off-by: Feng Kan <fkan@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-06-10 22:17:34 +09:00
Feng Kan f6505fbabc i2c: add SLIMpro I2C device driver on APM X-Gene platform
Add SLIMpro I2C device driver on APM X-Gene platform. This I2C
device driver use the SLIMpro Mailbox driver to tunnel message to
the SLIMpro coprocessor to do the work of accessing I2C components.

Signed-off-by: Feng Kan <fkan@apm.com>
Signed-off-by: Hieu Le <hnle@apm.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-05-12 22:06:05 +02:00