iio: light: vcnl4035: fixed chip ID check
authorFrank Li <Frank.Li@nxp.com>
Mon, 1 May 2023 14:36:04 +0000 (10:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:18 +0000 (10:34 +0200)
commit54d737d79672c12c6af469ef9a6ff285666e2d0c
tree266087a758c44e7b8a130b45a9036dea6f905041
parent2896a356ed079b7d585f4ae0ab7628a2d7e23190
iio: light: vcnl4035: fixed chip ID check

commit a551c26e8e568fad42120843521529241b9bceec upstream.

VCNL4035 register(0xE) ID_L and ID_M define as:

 ID_L: 0x80
 ID_H: 7:6 (0:0)
       5:4 (0:0) slave address = 0x60 (7-bit)
           (0:1) slave address = 0x51 (7-bit)
           (1:0) slave address = 0x40 (7-bit)
           (1:0) slave address = 0x41 (7-bit)
       3:0 Version code default (0:0:0:0)

So just check ID_L.

Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20230501143605.1615549-1-Frank.Li@nxp.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/vcnl4035.c