ltc2945.c (8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17) | ltc2945.c (4b0654e2c35938f5613edb3bc7550130145ebe62) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Driver for Linear Technology LTC2945 I2C Power Monitor 4 * 5 * Copyright (c) 2014 Guenter Roeck 6 */ 7 8#include <linux/kernel.h> --- 44 unchanged lines hidden (view full) --- 53#define FAULT_POWER_UV (1 << 6) 54#define FAULT_POWER_OV (1 << 7) 55 56/* Control register bits */ 57 58#define CONTROL_MULT_SELECT (1 << 0) 59#define CONTROL_TEST_MODE (1 << 4) 60 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Driver for Linear Technology LTC2945 I2C Power Monitor 4 * 5 * Copyright (c) 2014 Guenter Roeck 6 */ 7 8#include <linux/kernel.h> --- 44 unchanged lines hidden (view full) --- 53#define FAULT_POWER_UV (1 << 6) 54#define FAULT_POWER_OV (1 << 7) 55 56/* Control register bits */ 57 58#define CONTROL_MULT_SELECT (1 << 0) 59#define CONTROL_TEST_MODE (1 << 4) 60 |
61static const struct of_device_id __maybe_unused ltc2945_of_match[] = { 62 { .compatible = "adi,ltc2945" }, 63 { } 64}; 65MODULE_DEVICE_TABLE(of, ltc2945_of_match); 66 |
|
61static inline bool is_power_reg(u8 reg) 62{ 63 return reg < LTC2945_SENSE_H; 64} 65 66/* Return the value from the given register in uW, mV, or mA */ 67static long long ltc2945_reg_to_val(struct device *dev, u8 reg) 68{ --- 401 unchanged lines hidden (view full) --- 470 {"ltc2945", 0}, 471 { } 472}; 473 474MODULE_DEVICE_TABLE(i2c, ltc2945_id); 475 476static struct i2c_driver ltc2945_driver = { 477 .driver = { | 67static inline bool is_power_reg(u8 reg) 68{ 69 return reg < LTC2945_SENSE_H; 70} 71 72/* Return the value from the given register in uW, mV, or mA */ 73static long long ltc2945_reg_to_val(struct device *dev, u8 reg) 74{ --- 401 unchanged lines hidden (view full) --- 476 {"ltc2945", 0}, 477 { } 478}; 479 480MODULE_DEVICE_TABLE(i2c, ltc2945_id); 481 482static struct i2c_driver ltc2945_driver = { 483 .driver = { |
478 .name = "ltc2945", 479 }, | 484 .name = "ltc2945", 485 .of_match_table = of_match_ptr(ltc2945_of_match), 486 }, |
480 .probe_new = ltc2945_probe, 481 .id_table = ltc2945_id, 482}; 483 484module_i2c_driver(ltc2945_driver); 485 486MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); 487MODULE_DESCRIPTION("LTC2945 driver"); 488MODULE_LICENSE("GPL"); | 487 .probe_new = ltc2945_probe, 488 .id_table = ltc2945_id, 489}; 490 491module_i2c_driver(ltc2945_driver); 492 493MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); 494MODULE_DESCRIPTION("LTC2945 driver"); 495MODULE_LICENSE("GPL"); |