zpa2326_i2c.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) | zpa2326_i2c.c (a409d2b6391376180d4440a4336d4e67ee4fd754) |
---|---|
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 */ 9 10#include <linux/module.h> 11#include <linux/regmap.h> 12#include <linux/i2c.h> | 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 */ 9 10#include <linux/module.h> 11#include <linux/regmap.h> 12#include <linux/i2c.h> |
13#include <linux/of_device.h> | 13#include <linux/mod_devicetable.h> |
14#include "zpa2326.h" 15 16/* 17 * read_flag_mask: 18 * - address bit 7 must be set to request a register read operation 19 */ 20static const struct regmap_config zpa2326_regmap_i2c_config = { 21 .reg_bits = 8, --- 39 unchanged lines hidden (view full) --- 61} 62 63static const struct i2c_device_id zpa2326_i2c_ids[] = { 64 { "zpa2326", 0 }, 65 { }, 66}; 67MODULE_DEVICE_TABLE(i2c, zpa2326_i2c_ids); 68 | 14#include "zpa2326.h" 15 16/* 17 * read_flag_mask: 18 * - address bit 7 must be set to request a register read operation 19 */ 20static const struct regmap_config zpa2326_regmap_i2c_config = { 21 .reg_bits = 8, --- 39 unchanged lines hidden (view full) --- 61} 62 63static const struct i2c_device_id zpa2326_i2c_ids[] = { 64 { "zpa2326", 0 }, 65 { }, 66}; 67MODULE_DEVICE_TABLE(i2c, zpa2326_i2c_ids); 68 |
69#if defined(CONFIG_OF) | |
70static const struct of_device_id zpa2326_i2c_matches[] = { 71 { .compatible = "murata,zpa2326" }, 72 { } 73}; 74MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); | 69static const struct of_device_id zpa2326_i2c_matches[] = { 70 { .compatible = "murata,zpa2326" }, 71 { } 72}; 73MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); |
75#endif | |
76 77static struct i2c_driver zpa2326_i2c_driver = { 78 .driver = { 79 .name = "zpa2326-i2c", | 74 75static struct i2c_driver zpa2326_i2c_driver = { 76 .driver = { 77 .name = "zpa2326-i2c", |
80 .of_match_table = of_match_ptr(zpa2326_i2c_matches), | 78 .of_match_table = zpa2326_i2c_matches, |
81 .pm = ZPA2326_PM_OPS, 82 }, 83 .probe = zpa2326_probe_i2c, 84 .remove = zpa2326_remove_i2c, 85 .id_table = zpa2326_i2c_ids, 86}; 87module_i2c_driver(zpa2326_i2c_driver); 88 89MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); 90MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor"); 91MODULE_LICENSE("GPL v2"); | 79 .pm = ZPA2326_PM_OPS, 80 }, 81 .probe = zpa2326_probe_i2c, 82 .remove = zpa2326_remove_i2c, 83 .id_table = zpa2326_i2c_ids, 84}; 85module_i2c_driver(zpa2326_i2c_driver); 86 87MODULE_AUTHOR("Gregor Boirie <gregor.boirie@parrot.com>"); 88MODULE_DESCRIPTION("I2C driver for Murata ZPA2326 pressure sensor"); 89MODULE_LICENSE("GPL v2"); |