| .. | .. |
|---|
| 8 | 8 | * TODO: Proximity |
|---|
| 9 | 9 | */ |
|---|
| 10 | 10 | #include <linux/bitops.h> |
|---|
| 11 | +#include <linux/bitfield.h> |
|---|
| 11 | 12 | #include <linux/i2c.h> |
|---|
| 12 | 13 | #include <linux/module.h> |
|---|
| 13 | 14 | #include <linux/pm_runtime.h> |
|---|
| .. | .. |
|---|
| 42 | 43 | #define VCNL4035_ALS_PERS_MASK GENMASK(3, 2) |
|---|
| 43 | 44 | #define VCNL4035_INT_ALS_IF_H_MASK BIT(12) |
|---|
| 44 | 45 | #define VCNL4035_INT_ALS_IF_L_MASK BIT(13) |
|---|
| 46 | +#define VCNL4035_DEV_ID_MASK GENMASK(7, 0) |
|---|
| 45 | 47 | |
|---|
| 46 | 48 | /* Default values */ |
|---|
| 47 | 49 | #define VCNL4035_MODE_ALS_ENABLE BIT(0) |
|---|
| .. | .. |
|---|
| 415 | 417 | return ret; |
|---|
| 416 | 418 | } |
|---|
| 417 | 419 | |
|---|
| 420 | + id = FIELD_GET(VCNL4035_DEV_ID_MASK, id); |
|---|
| 418 | 421 | if (id != VCNL4035_DEV_ID_VAL) { |
|---|
| 419 | 422 | dev_err(&data->client->dev, "Wrong id, got %x, expected %x\n", |
|---|
| 420 | 423 | id, VCNL4035_DEV_ID_VAL); |
|---|