motorola-cpcap.c (03ab8e6297acd1bc0eedaa050e2a1635c576fd11) motorola-cpcap.c (4060c6e50a77a70bf7b7ff3a3aaaa8b1828ec7b6)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Motorola CPCAP PMIC core driver
4 *
5 * Copyright (C) 2016 Tony Lindgren <tony@atomide.com>
6 */
7
8#include <linux/device.h>

--- 207 unchanged lines hidden (view full) ---

216 .val_bits = 16,
217 .write_flag_mask = 0x8000,
218 .max_register = CPCAP_REG_ST_TEST2,
219 .cache_type = REGCACHE_NONE,
220 .reg_format_endian = REGMAP_ENDIAN_LITTLE,
221 .val_format_endian = REGMAP_ENDIAN_LITTLE,
222};
223
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Motorola CPCAP PMIC core driver
4 *
5 * Copyright (C) 2016 Tony Lindgren <tony@atomide.com>
6 */
7
8#include <linux/device.h>

--- 207 unchanged lines hidden (view full) ---

216 .val_bits = 16,
217 .write_flag_mask = 0x8000,
218 .max_register = CPCAP_REG_ST_TEST2,
219 .cache_type = REGCACHE_NONE,
220 .reg_format_endian = REGMAP_ENDIAN_LITTLE,
221 .val_format_endian = REGMAP_ENDIAN_LITTLE,
222};
223
224#ifdef CONFIG_PM_SLEEP
225static int cpcap_suspend(struct device *dev)
226{
227 struct spi_device *spi = to_spi_device(dev);
228
229 disable_irq(spi->irq);
230
231 return 0;
232}
233
234static int cpcap_resume(struct device *dev)
235{
236 struct spi_device *spi = to_spi_device(dev);
237
238 enable_irq(spi->irq);
239
240 return 0;
241}
224static int cpcap_suspend(struct device *dev)
225{
226 struct spi_device *spi = to_spi_device(dev);
227
228 disable_irq(spi->irq);
229
230 return 0;
231}
232
233static int cpcap_resume(struct device *dev)
234{
235 struct spi_device *spi = to_spi_device(dev);
236
237 enable_irq(spi->irq);
238
239 return 0;
240}
242#endif
243
241
244static SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
242static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
245
246static const struct mfd_cell cpcap_mfd_devices[] = {
247 {
248 .name = "cpcap_adc",
249 .of_compatible = "motorola,mapphone-cpcap-adc",
250 }, {
251 .name = "cpcap_battery",
252 .of_compatible = "motorola,cpcap-battery",

--- 88 unchanged lines hidden (view full) ---

341 return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
342 ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
343}
344
345static struct spi_driver cpcap_driver = {
346 .driver = {
347 .name = "cpcap-core",
348 .of_match_table = cpcap_of_match,
243
244static const struct mfd_cell cpcap_mfd_devices[] = {
245 {
246 .name = "cpcap_adc",
247 .of_compatible = "motorola,mapphone-cpcap-adc",
248 }, {
249 .name = "cpcap_battery",
250 .of_compatible = "motorola,cpcap-battery",

--- 88 unchanged lines hidden (view full) ---

339 return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
340 ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
341}
342
343static struct spi_driver cpcap_driver = {
344 .driver = {
345 .name = "cpcap-core",
346 .of_match_table = cpcap_of_match,
349 .pm = &cpcap_pm,
347 .pm = pm_sleep_ptr(&cpcap_pm),
350 },
351 .probe = cpcap_probe,
352 .id_table = cpcap_spi_ids,
353};
354module_spi_driver(cpcap_driver);
355
356MODULE_ALIAS("platform:cpcap");
357MODULE_DESCRIPTION("CPCAP driver");
358MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
359MODULE_LICENSE("GPL v2");
348 },
349 .probe = cpcap_probe,
350 .id_table = cpcap_spi_ids,
351};
352module_spi_driver(cpcap_driver);
353
354MODULE_ALIAS("platform:cpcap");
355MODULE_DESCRIPTION("CPCAP driver");
356MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
357MODULE_LICENSE("GPL v2");