| // SPDX-License-Identifier: GPL-2.0 |
| * Analog Devices LTC2947 high precision power and energy monitor over SPI |
| * Copyright 2019 Analog Devices Inc. |
| #include <linux/module.h> |
| #include <linux/regmap.h> |
| #include <linux/spi/spi.h> |
| static const struct regmap_config ltc2947_regmap_config = { |
| .read_flag_mask = BIT(0), |
| static int ltc2947_probe(struct spi_device *spi) |
| map = devm_regmap_init_spi(spi, <c2947_regmap_config); |
| return ltc2947_core_probe(map, spi_get_device_id(spi)->name); |
| static const struct spi_device_id ltc2947_id[] = { |
| MODULE_DEVICE_TABLE(spi, ltc2947_id); |
| static struct spi_driver ltc2947_driver = { |
| .of_match_table = ltc2947_of_match, |
| module_spi_driver(ltc2947_driver); |
| MODULE_AUTHOR("Nuno Sa <nuno.sa@analog.com>"); |
| MODULE_DESCRIPTION("LTC2947 SPI power and energy monitor driver"); |