linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Peter Rosin <peda@axentia.se>,
	Quentin Strydom <quentin.strydom@bluwireless.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: mux: pca9541: Change to correct bus control commands
Date: Tue, 2 Jun 2020 08:42:39 -0700	[thread overview]
Message-ID: <89e367db-a5f7-6eb0-5437-0ea0646b85d0@roeck-us.net> (raw)
In-Reply-To: <2e2c3b98-20a6-2671-ad74-a0f171073bd0@axentia.se>

On 6/2/20 8:05 AM, Peter Rosin wrote:
> On 2020-06-02 14:12, Quentin Strydom wrote:
>> Change current bus commands to match the pca9541a datasheet
>> (see table 12 on page 14 of
>> https://www.nxp.com/docs/en/data-sheet/PCA9541A.pdf). Also
>> where entries are marked as no change the current control
>> command is repeated as the current master reading the
>> control register has control of the bus and bus is on.
>>
>> Signed-off-by: Quentin Strydom <quentin.strydom@bluwireless.com>
>> ---
>>  drivers/i2c/muxes/i2c-mux-pca9541.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c
>> index 6a39ada..50808fa 100644
>> --- a/drivers/i2c/muxes/i2c-mux-pca9541.c
>> +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
>> @@ -211,7 +211,7 @@ static void pca9541_release_bus(struct i2c_client *client)
>>  
>>  /* Control commands per PCA9541 datasheet */
>>  static const u8 pca9541_control[16] = {
>> -	4, 0, 1, 5, 4, 4, 5, 5, 0, 0, 1, 1, 0, 4, 5, 1
>> +	4, 4, 5, 5, 4, 4, 5, 7, 8, 0, 1, 11, 0, 0, 1, 1
>>  };
>>  
>>  /*
> 
> I found all your mails from git send-email in my spam folder. They probably
> lack some headers that have become increasingly important... [Don't ask me
> for further details.]
> 
> I do not have the HW to test this. I'm only going by the datasheet.
> 
> But yes, pca9541_control[1] and [2] indeed seem exchanged with [13] and [14].
> 
> However, pca9541_control[5], [7], [8], and [11] are never used AFAICT.
> Trying to write 7, 8 and 11 also attempts to write various read-only bits
> and makes no sense. So, I'd skip those changes.
> 
> All that said, I'm a bit skeptic as to why this has worked at all if this
> is incorrect. I would like to see a more detailed failure description that
> could explain why this change is indeed "it".
> 

Good question. I had tested the code quite extensively. Maybe the failing cases
did not apply to my situation. Too long to recall, unfortunately.

Guenter

      reply	other threads:[~2020-06-02 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1591099969-30446-1-git-send-email-quentin.strydom@bluwireless.com>
2020-06-02 13:40 ` [PATCH 1/2] i2c: mux: pca9541: Change to correct bus control commands Guenter Roeck
2020-06-02 15:05 ` Peter Rosin
2020-06-02 15:42   ` Guenter Roeck [this message]

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=89e367db-a5f7-6eb0-5437-0ea0646b85d0@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=quentin.strydom@bluwireless.com \
    --cc=wsa@the-dreams.de \
    /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).