public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Adrian Fiergolski <adrian.fiergolski@cern.ch>, linux-i2c@vger.kernel.org
Cc: giometti@enneenne.com, giometti@linux.it
Subject: Re: [PATCH v3] i2c: Add support for NXP PCA984x family.
Date: Tue, 12 Dec 2017 20:03:45 +0100	[thread overview]
Message-ID: <7b8066a5-0a61-ca1b-e41f-6437e47ed7b2@axentia.se> (raw)
In-Reply-To: <f3883936-d621-cc48-444b-db08470d256f@axentia.se>

On 2017-12-11 20:14, Peter Rosin wrote:
> On 2017-12-11 17:58, Adrian Fiergolski wrote:
>> +	/* Check manufacturer ID (12 bits) */
>> +	manufacturer_id = ((u16) device_id_raw.block[1] << 4) | (device_id_raw.block[2] >> 4);
> 
> This assignment is still broken...

Ooops, no, this one is fine. Sorry about that.

>> +	if (manufacturer_id != NXP_ID) {
>> +		dev_warn(&client->dev, "PCA9846 family: Manufacturer ID does not match NXP\n");
>> +		return -ENODEV;
>> +	}
>> +
>> +	/* Check device ID (9 bits) */
>> +	device_id = ((u16) device_id_raw.block[2] << 5) | (device_id_raw.block[3] >> 3);
> 
> ...and this is also broken.

But this one is broken. You need to mask out the upper half of
...block[2] so that the lower bits of the manufacturer don't
end up above the device id bits.

Cheers,
Peter

>> +	if (device_id != chips[id->driver_data].deviceID) {
>> +		dev_warn(&client->dev, "PCA9846 family: Device ID does not match %s\n", id->name);
>> +		return -ENODEV;
>> +	}

      parent reply	other threads:[~2017-12-12 19:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 11:10 [PATCH] i2c: Add support for NXP PCA984x family Adrian Fiergolski
2017-12-11 11:25 ` Rodolfo Giometti
2017-12-11 12:51   ` Peter Rosin
2017-12-11 13:15     ` Adrian Fiergolski
2017-12-11 13:26       ` Peter Rosin
2017-12-11 13:29       ` Rodolfo Giometti
2017-12-11 14:27         ` [PATCH v2] " Adrian Fiergolski
2017-12-11 14:59           ` Peter Rosin
2017-12-11 15:07           ` Rodolfo Giometti
2017-12-11 16:58             ` [PATCH v3] " Adrian Fiergolski
2017-12-11 19:14               ` Peter Rosin
2017-12-12 12:06                 ` Adrian Fiergolski
2017-12-12 15:25                   ` Peter Rosin
2017-12-12 17:14                     ` Adrian Fiergolski
2017-12-12 19:03                       ` Peter Rosin
2017-12-12 22:05                         ` Wolfram Sang
2017-12-13 17:17                           ` Adrian Fiergolski
2017-12-14  0:30                             ` Wolfram Sang
2017-12-13  8:47                         ` Adrian Fiergolski
2017-12-13  9:39                           ` Peter Rosin
2017-12-13 10:02                             ` Adrian Fiergolski
2017-12-13 16:12                         ` [PATCH v4] " Adrian Fiergolski
2017-12-13 16:56                           ` Wolfram Sang
2017-12-15  9:46                             ` Rodolfo Giometti
2017-12-13 18:26                           ` Peter Rosin
2017-12-14  9:54                             ` Peter Rosin
     [not found]                               ` <990e4a1f-a9ac-c899-0075-ae3211ff9475-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2017-12-14 11:20                                 ` [PATCH v5] " Adrian Fiergolski
     [not found]                                   ` <20171214112003.13701-1-adrian.fiergolski-vJEk5272eHo@public.gmane.org>
2017-12-14 21:22                                     ` Peter Rosin
2017-12-18 17:45                                       ` [PATCH v6] " Adrian Fiergolski
2017-12-20 18:27                                         ` Rob Herring
2017-12-25 21:26                                           ` [PATCH v7] " Adrian Fiergolski
     [not found]                                             ` <20171225212646.8062-1-adrian.fiergolski-vJEk5272eHo@public.gmane.org>
2017-12-26 17:58                                               ` Rob Herring
2017-12-28 23:31                                               ` Peter Rosin
2017-12-15 10:40                                     ` [PATCH v5] " Peter Rosin
2017-12-12 19:03                 ` Peter Rosin [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=7b8066a5-0a61-ca1b-e41f-6437e47ed7b2@axentia.se \
    --to=peda@axentia.se \
    --cc=adrian.fiergolski@cern.ch \
    --cc=giometti@enneenne.com \
    --cc=giometti@linux.it \
    --cc=linux-i2c@vger.kernel.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