linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vaibhav.hiremath@linaro.org (Vaibhav Hiremath)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/12] i2c: pxa: enable/disable i2c module across msg xfer
Date: Thu, 04 Jun 2015 12:49:48 +0530	[thread overview]
Message-ID: <556FFC14.3050901@linaro.org> (raw)
In-Reply-To: <20150604062924.GA10576@yizhang>



On Thursday 04 June 2015 11:59 AM, Yi Zhang wrote:
> On Wed, Jun 03, 2015 at 12:59:23AM +0800, Vaibhav Hiremath wrote:
>>
>>
>> On Tuesday 02 June 2015 10:22 PM, Vaibhav Hiremath wrote:
>>>
>>>
>>> On Thursday 28 May 2015 06:53 PM, Russell King - ARM Linux wrote:
>>>> On Thu, May 28, 2015 at 06:33:44PM +0530, Vaibhav Hiremath wrote:
>>>>> From: Yi Zhang <yizhang@marvell.com>
>>>>>
>>>>> Enable i2c module/unit before transmission and disable when it finishes.
>>>>>
>>>>> why?
>>>>> It's because the i2c bus may be distrubed if the slave device,
>>>>> typically a touch, powers on.
>>>>
>>>> "disturbed"
>>>>
>>>> I'd recommend that this is a DT property - not every platform is going to
>>>> want this, and as there is rudimentary I2C slave support in this driver,
>>>> this change breaks that.
>>>>
>>>
>>> I would take it as two different comments here, and I believe you also
>>> meant same,
>>>
>>> 1. Not breaking I2C slave support
>>>
>>> Not sure whether enabling/disabling module in ISR would suffice here.
>>> To be specific, in the functions i2c_pxa_slave_start() &
>>> i2c_pxa_slave_stop()
>>>
>>>
>>
>> Please ignore this option, as enable is important to generate interrupt
>> on slave start.
>
>    Hi, Vaibhav:
>
>    sorry there is something wrong with my mailbox, so I list the LCR/WCR
>    information here, hoping not to confuse you;genr
>

Thanks for the info.


>    LCR: it's used to minor adjustments to the SCL, increasing it
>    decreases the SCL frequency, vice versa;
>    yes, it has relation with the I2C input clock:
>    if input_clk = 32MHz, LCR = 0x0804_1c96
>       LCR[SLV] = 0x096, bit 8~0
>       LCR[FLV] = 0xe,   bit 17~9
>       LCR[HLVH] = 0x1,  bit 26~18
>       LCR[HLVL] = 0x1,  bit 31~27
>    if input_clk = 52MHz,   LCR = 0x081c_60f9
>    if input_clk = 62.4MHz, LCR = 0x082c_8330
>

Whether they are simply counters which count downs to generate required
timing profile on the bus.

So would be possible for you to provide timing values generated by this?
Or please confirm below understanding,


@32MHz, SLV = 0x96,
thigh/tlow = 31nsec * 150 = 4.650 usec
thigh/tlow = 32nsec * 150 = 4.8 usec	[using ceil()]


and as per I2C spec,

thigh,min = 4 usec
tlow,min = 4.7usec

I believe my understanding is correct, please confirm.


>    WCR: it's used to control setup and hold timing during slave mode

This is is useful info. So in master mode we can ignore this.

Just to clarify, this bit is don't care in master-transmit and 
master-receive, right?

>    WCR[31: 15], reserved, always write 0;
>    WCR[14: 10], default 0x5, and should not be changed
>    WCR[9: 5], default 0x1, and should not be changed
>    WCR[4:0], default 0x1a, if input_clk = 33MHz, it's 0x0a;
>                            if input_clk = 66MHz, it's 0x14;
>
>    hope it's helpful;


Yes certainly. Thanks.

Thanks,
Vaibhav
>
>    ---
>    Yi Zhang <yizhang@marvell.com>
>
>>
>> I will add DT property with clear note on SLAVE support issue, so that
>> it can be disabled and SLAVE support should work as is.
>>
>> Thanks,
>> Vaibhav

  reply	other threads:[~2015-06-04  7:19 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 13:03 [PATCH 00/12] i2c: pxa: Fixes, cleanup and support for pxa910 family Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 01/12] i2c: pxa: keep i2c irq ON in suspend Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 02/12] i2c: pxa: No need to set slave addr for i2c master mode reset Vaibhav Hiremath
2015-05-29 19:21   ` Robert Jarzmik
2015-05-29 19:25     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 03/12] i2c: pxa: Add reset operation when i2c bus busy Vaibhav Hiremath
2015-05-29 19:39   ` Robert Jarzmik
2015-05-29 20:20     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 04/12] i2c: pxa: Add support for pxa910/988 & new configuration features Vaibhav Hiremath
2015-05-29 20:22   ` Robert Jarzmik
2015-05-29 20:33     ` Vaibhav Hiremath
2015-06-04  2:31     ` Yi Zhang
2015-06-04  5:46       ` Vaibhav Hiremath
2015-06-01  0:13   ` Wolfram Sang
2015-06-02  5:01     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 05/12] i2c: pxa: Add bus reset functionality Vaibhav Hiremath
2015-05-29 13:59   ` Rob Herring
2015-05-29 15:40     ` Vaibhav Hiremath
2015-05-29 20:31   ` Robert Jarzmik
2015-06-02 13:12   ` Linus Walleij
2015-06-02 16:40     ` Vaibhav Hiremath
2015-06-03 19:16     ` Vaibhav Hiremath
2015-06-02 17:33   ` Wolfram Sang
2015-06-02 17:40     ` Vaibhav Hiremath
2015-06-02 17:48       ` Wolfram Sang
2015-06-02 17:57         ` Vaibhav Hiremath
2015-06-02 18:02           ` Wolfram Sang
2015-06-02 18:06             ` Vaibhav Hiremath
2015-06-02 18:24               ` Wolfram Sang
2015-06-02 18:46                 ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 06/12] i2c: pxa: Return I2C_RETRY when timeout in pio mode Vaibhav Hiremath
2015-05-29 20:46   ` Robert Jarzmik
2015-05-29 21:23     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 07/12] i2c: pxa: Reset i2c controller on timeout in interrupt and " Vaibhav Hiremath
2015-05-29 21:13   ` Robert Jarzmik
2015-05-29 21:19     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 08/12] i2c: pxa: enable/disable irq across message xfer Vaibhav Hiremath
2015-05-28 13:17   ` Russell King - ARM Linux
2015-05-28 13:29     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 09/12] i2c: pxa: Remove compile warnning in 64bit mode Vaibhav Hiremath
2015-05-29 21:28   ` Robert Jarzmik
2015-05-28 13:03 ` [PATCH 10/12] i2c: pxa: Update debug function to dump more info on error Vaibhav Hiremath
2015-05-29 21:42   ` Robert Jarzmik
2015-05-29 21:45     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 11/12] i2c:pxa: Use devm_ variants in probe function Vaibhav Hiremath
2015-05-30 15:53   ` Robert Jarzmik
2015-05-31  7:36     ` Vaibhav Hiremath
2015-05-28 13:03 ` [PATCH 12/12] i2c: pxa: enable/disable i2c module across msg xfer Vaibhav Hiremath
2015-05-28 13:23   ` Russell King - ARM Linux
2015-06-02 16:52     ` Vaibhav Hiremath
2015-06-02 16:59       ` Vaibhav Hiremath
2015-06-03 10:56         ` Yi Zhang
2015-06-03 18:49           ` Vaibhav Hiremath
2015-06-04  6:29         ` Yi Zhang
2015-06-04  7:19           ` Vaibhav Hiremath [this message]
2015-06-04  7:58             ` Yi Zhang
2015-06-01  0:07 ` [PATCH 00/12] i2c: pxa: Fixes, cleanup and support for pxa910 family Wolfram Sang
2015-06-02  4:58   ` Vaibhav Hiremath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556FFC14.3050901@linaro.org \
    --to=vaibhav.hiremath@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).