aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-brcmstb.c
AgeCommit message (Collapse)Author
2022-02-23i2c: brcmstb: fix support for DSL and CM variantsRafał Miłecki
commit 834cea3a252ed4847db076a769ad9efe06afe2d5 upstream. DSL and CM (Cable Modem) support 8 B max transfer size and have a custom DT binding for that reason. This driver was checking for a wrong "compatible" however which resulted in an incorrect setup. Fixes: e2e5a2c61837 ("i2c: brcmstb: Adding support for CM and DSL SoCs") Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-04i2c: brcmstb: Fix brcmstd_send_i2c_cmd conditionMaxime Ripard
[ Upstream commit a1858ce0cfe31368b23ba55794e409fb57ced4a4 ] The brcmstb_send_i2c_cmd currently has a condition that is (CMD_RD || CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-15i2c: brcmstb: remove unused struct memberWolfram Sang
No further occurences in the driver. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2019-01-08i2c: brcmstb: use core helper to mark adapter suspendedWolfram Sang
Rejecting transfers should be handled by the core. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2018-07-13i2c: remove i2c_lock_adapter and use i2c_lock_bus directlyPeter Rosin
The i2c_lock_adapter name is ambiguous since it is unclear if it refers to the root adapter or the adapter you name in the argument. The natural interpretation is the adapter you name in the argument, but there are historical reasons for that not being the case; it in fact locks the root adapter. Just remove the function and force users to spell out the I2C_LOCK_ROOT_ADAPTER name to indicate what is really going on. Also remove i2c_unlock_adapter, of course. This patch was generated with git grep -l 'i2c_\(un\)\?lock_adapter' \ | xargs sed -i 's/i2c_\(un\)\?lock_adapter(\([^)]*\))/'\ 'i2c_\1lock_bus(\2, I2C_LOCK_ROOT_ADAPTER)/g' followed by white-space touch-up. Signed-off-by: Peter Rosin <peda@axentia.se> Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com> Tested-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-03-08i2c: brcmstb: Fix START and STOP conditionsJaedon Shin
The BSC data buffers to send and receive data are each of size 32 bytes or 8 bytes 'xfersz' depending on SoC. The problem observed for all the combined message transfer was if length of data transfer was a multiple of 'xfersz' a repeated START was being transmitted by BSC driver. Fixed this by appropriately setting START/STOP conditions for such transfers. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com> Acked-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-08-22i2c: don't print error when adding adapter failsWolfram Sang
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-15i2c: brcmstb: Use complete() instead of complete_all()Daniel Wagner
There is only one waiter for the completion, therefore there is no need to use complete_all(). Let's make that clear by using complete() instead of complete_all(). The usage pattern of the completion is: brcmstb_send_i2c_cmd() reinit_completion() ... /* initiate transfer by setting iic_enable */ ... brcmstb_i2c_wait_for_completion() Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-07-15i2c: brcmstb: Remove superfluous size checkJaedon Shin
The driver transfer to a message with NOACK always in any size. If client (eg. EDID segment point message) needs NOACK condition, it can use I2C_M_IGNORE_NAK flag. Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com> Acked-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-04-11i2c: brcmstb: use new 8 bit address helper functionWolfram Sang
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-03-01i2c: brcmstb: allocate correct amount of memory for regmapWolfram Sang
We want the size of the struct, not of a pointer to it. To be future proof, just dereference the pointer to get the desired type. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Acked-by: Gregory Fong <gregory.0xf0@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Kamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
2016-01-03i2c: brcmstb: Adding support for CM and DSL SoCsKamal Dasu
Broadcoms DSL, CM (cable modem)and STB I2C core implementation have 8 data in/out registers that can transfer 8 bytes or 32 bytes max. Cable and DSL "Peripheral" i2c cores use single byte per data register and the STB can use 4 byte per data register transfer. Adding support to take care of this difference. Accordingly added the compatible string for SoCs using the "Peripheral" I2C block. Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-06-10i2c: brcmstb: Add Broadcom settop SoC i2c controller driverKamal Dasu
Adding support for i2c controller driver for Broadcom settop SoCs. Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com> [wsa: removed superfluous owner in platform_driver] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>