summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-qup.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: qup: Fix fifo handling after adding V2 supportSricharan R2016-03-031-7/+39
| | | | | | | | | | | | After the addition of V2 support, there was a regression observed when testing it on MSM8996. The reason is driver puts the controller in to RUN state and writes the data to be 'tx' ed in fifo. But controller has to be put in to 'PAUSE' state and data has to written to fifo. Then should be put in to 'RUN' state separately. Signed-off-by: Sricharan R <sricharan@codeaurora.org> Tested-by: Pramod Gurav <gpramod@codeaurora.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Add bam dma capabilitiesSricharan R2016-02-241-14/+459
| | | | | | | | | | | | | | | | | QUP cores can be attached to a BAM module, which acts as a dma engine for the QUP core. When DMA with BAM is enabled, the BAM consumer pipe transmitted data is written to the output FIFO and the BAM producer pipe received data is read from the input FIFO. With BAM capabilities, qup-i2c core can transfer more than 256 bytes, without a 'stop' which is not possible otherwise. Signed-off-by: Sricharan R <sricharan@codeaurora.org> Reviewed-by: Andy Gross <andy.gross@linaro.org> Tested-by: Archit Taneja <architt@codeaurora.org> Tested-by: Telkar Nagender <ntelkar@codeaurora.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Transfer each i2c_msg in i2c_msgs without a stop bitSricharan R2016-02-121-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | The definition of i2c_msg says that "If this is the last message in a group, it is followed by a STOP. Otherwise it is followed by the next @i2c_msg transaction segment, beginning with a (repeated) START" So the expectation is that there is no 'STOP' bit inbetween individual i2c_msg segments with repeated 'START'. Adding the support for the same. This is required for some clients like touchscreen which keeps incrementing counts across individual transfers and 'STOP' bit inbetween resets the counter, which is not required. This patch adds the support in non-dma mode. Signed-off-by: Sricharan R <sricharan@codeaurora.org> Reviewed-by: Andy Gross <andy.gross@linaro.org> Tested-by: Archit Taneja <architt@codeaurora.org> Tested-by: Telkar Nagender <ntelkar@codeaurora.org> [wsa: updated commit message] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Add V2 tags supportSricharan R2016-02-121-29/+386
| | | | | | | | | | | | | | | | | | QUP from version 2.1.1 onwards, supports a new format of i2c command tags. Tag codes instructs the controller to perform a operation like read/write. This new tagging version supports bam dma and transfers of more than 256 bytes without 'stop' in between. Adding the support for the same. For each block a data_write/read tag and data_len tag is added to the output fifo. For the final block of data write_stop/read_stop tag is used. Signed-off-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Tested-by: Archit Taneja <architt@codeaurora.org> Tested-by: Telkar Nagender <ntelkar@codeaurora.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Change qup_wait_writeready function to use for all timeoutsSricharan R2016-02-121-19/+48
| | | | | | | | | | | | | qup_wait_writeready waits only on a output fifo empty event. Change the same function to accept the event and data length to wait as parameters. This way the same function can be used for timeouts in other places as well. Signed-off-by: Sricharan R <sricharan@codeaurora.org> Reviewed-by: Andy Gross <andy.gross@linaro.org> Tested-by: Archit Taneja <architt@codeaurora.org> Tested-by: Telkar Nagender <ntelkar@codeaurora.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: make use of the new infrastructure for quirksWolfram Sang2015-03-131-11/+10
| | | | | Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com>
* i2c: busses: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Fix order of runtime pm initializationAndy Gross2014-10-031-4/+8
| | | | | | | | | | | | The runtime pm calls need to be done before populating the children via the i2c_add_adapter call. If this is not done, a child can run into issues trying to do i2c read/writes due to the pm_runtime_sync failing. Signed-off-by: Andy Gross <agross@codeaurora.org> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: stable@kernel.org
* i2c: qup: disable clks and return instead of just returning errorPramod Gurav2014-08-061-4/+8
| | | | | | | | | | | This fixes a error handling scenario where clocks were not being disabled when QUP_OUTPUT_BLOCK_SIZE returns a size greater than the size of blk_sizes array. So this patch adds a statement to jump to the fail lable to release the clocks. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: Fix pm_runtime_get_sync usageAndy Gross2014-05-141-1/+1
| | | | | | | | | This patch corrects the error check on the call to pm_runtime_get_sync. Signed-off-by: Andy Gross <agross@codeaurora.org> Reviewed-by: Ivan T. Ivanov <iivanov@mm-sol.com> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: use proper type fro clk_freqWolfram Sang2014-04-061-1/+1
| | | | | | | | It is used with of_property_read_u32(), so it should be u32. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Fixes: 10c5a8425968 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller')
* i2c: qup: off by ones in qup_i2c_probe()Dan Carpenter2014-04-031-2/+2
| | | | | | | | These should ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()". Fixes: 10c5a8425968 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* i2c: qup: New bus driver for the Qualcomm QUP I2C controllerBjorn Andersson2014-03-281-0/+768
This bus driver supports the QUP i2c hardware controller in the Qualcomm SOCs. The Qualcomm Universal Peripheral Engine (QUP) is a general purpose data path engine with input/output FIFOs and an embedded i2c mini-core. The driver supports FIFO mode (for low bandwidth applications) and block mode (interrupt generated for each block-size data transfer). Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Reviewed-by: Andy Gross <agross@codeaurora.org> Tested-by: Philip Elcan <pelcan@codeaurora.org> [wsa: removed needless IS_ERR_VALUE] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
OpenPOWER on IntegriCloud