zpa2326_i2c.c (29583dfcd2dd72c766422bd05c16f06c6b1fb356) | zpa2326_i2c.c (1bee48f48a69013cdd5ed5fdbff1e0410a18a381) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Murata ZPA2326 I2C pressure and temperature sensor driver 4 * 5 * Copyright (c) 2016 Parrot S.A. 6 * 7 * Author: Gregor Boirie <gregor.boirie@parrot.com> 8 */ --- 24 unchanged lines hidden (view full) --- 33#define ZPA2326_SA0(_addr) (_addr & BIT(0)) 34#define ZPA2326_DEVICE_ID_SA0_SHIFT (1) 35 36 /* Identification register bit 1 mirrors device address bit 0. */ 37 return (ZPA2326_DEVICE_ID | 38 (ZPA2326_SA0(client->addr) << ZPA2326_DEVICE_ID_SA0_SHIFT)); 39} 40 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Murata ZPA2326 I2C pressure and temperature sensor driver 4 * 5 * Copyright (c) 2016 Parrot S.A. 6 * 7 * Author: Gregor Boirie <gregor.boirie@parrot.com> 8 */ --- 24 unchanged lines hidden (view full) --- 33#define ZPA2326_SA0(_addr) (_addr & BIT(0)) 34#define ZPA2326_DEVICE_ID_SA0_SHIFT (1) 35 36 /* Identification register bit 1 mirrors device address bit 0. */ 37 return (ZPA2326_DEVICE_ID | 38 (ZPA2326_SA0(client->addr) << ZPA2326_DEVICE_ID_SA0_SHIFT)); 39} 40 |
41static int zpa2326_probe_i2c(struct i2c_client *client, 42 const struct i2c_device_id *i2c_id) | 41static int zpa2326_probe_i2c(struct i2c_client *client) |
43{ | 42{ |
43 const struct i2c_device_id *i2c_id = i2c_client_get_device_id(client); |
|
44 struct regmap *regmap; 45 46 regmap = devm_regmap_init_i2c(client, &zpa2326_regmap_i2c_config); 47 if (IS_ERR(regmap)) { 48 dev_err(&client->dev, "failed to init registers map"); 49 return PTR_ERR(regmap); 50 } 51 --- 19 unchanged lines hidden (view full) --- 71MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); 72 73static struct i2c_driver zpa2326_i2c_driver = { 74 .driver = { 75 .name = "zpa2326-i2c", 76 .of_match_table = zpa2326_i2c_matches, 77 .pm = ZPA2326_PM_OPS, 78 }, | 44 struct regmap *regmap; 45 46 regmap = devm_regmap_init_i2c(client, &zpa2326_regmap_i2c_config); 47 if (IS_ERR(regmap)) { 48 dev_err(&client->dev, "failed to init registers map"); 49 return PTR_ERR(regmap); 50 } 51 --- 19 unchanged lines hidden (view full) --- 71MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); 72 73static struct i2c_driver zpa2326_i2c_driver = { 74 .driver = { 75 .name = "zpa2326-i2c", 76 .of_match_table = zpa2326_i2c_matches, 77 .pm = ZPA2326_PM_OPS, 78 }, |
79 .probe = zpa2326_probe_i2c, | 79 .probe_new = zpa2326_probe_i2c, |
80 .remove = zpa2326_remove_i2c, 81 .id_table = zpa2326_i2c_ids, 82}; 83module_i2c_driver(zpa2326_i2c_driver); 84 85MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); 86MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor"); 87MODULE_LICENSE("GPL v2"); 88MODULE_IMPORT_NS(IIO_ZPA2326); | 80 .remove = zpa2326_remove_i2c, 81 .id_table = zpa2326_i2c_ids, 82}; 83module_i2c_driver(zpa2326_i2c_driver); 84 85MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); 86MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor"); 87MODULE_LICENSE("GPL v2"); 88MODULE_IMPORT_NS(IIO_ZPA2326); |