Lines Matching +full:adp5585 +full:- +full:00
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Analog Devices ADP5585 I/O expander, PWM controller and keypad controller
13 #include <linux/mfd/adp5585.h>
21 { .name = "adp5585-gpio", },
22 { .name = "adp5585-pwm", },
35 * Chip variants differ in the default configuration of pull-up and pull-down
38 * - The -00, -01 and -03 variants (collectively referred to as
39 * ADP5585_REGMAP_00) have pull-up on all GPIO pins by default.
40 * - The -02 variant has no default pull-up or pull-down resistors.
41 * - The -04 variant has default pull-down resistors on all GPIO pins.
116 struct adp5585_dev *adp5585; in adp5585_i2c_probe() local
120 adp5585 = devm_kzalloc(&i2c->dev, sizeof(*adp5585), GFP_KERNEL); in adp5585_i2c_probe()
121 if (!adp5585) in adp5585_i2c_probe()
122 return -ENOMEM; in adp5585_i2c_probe()
124 i2c_set_clientdata(i2c, adp5585); in adp5585_i2c_probe()
127 adp5585->regmap = devm_regmap_init_i2c(i2c, regmap_config); in adp5585_i2c_probe()
128 if (IS_ERR(adp5585->regmap)) in adp5585_i2c_probe()
129 return dev_err_probe(&i2c->dev, PTR_ERR(adp5585->regmap), in adp5585_i2c_probe()
132 ret = regmap_read(adp5585->regmap, ADP5585_ID, &id); in adp5585_i2c_probe()
134 return dev_err_probe(&i2c->dev, ret, in adp5585_i2c_probe()
138 return dev_err_probe(&i2c->dev, -ENODEV, in adp5585_i2c_probe()
141 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, in adp5585_i2c_probe()
145 return dev_err_probe(&i2c->dev, ret, in adp5585_i2c_probe()
153 struct adp5585_dev *adp5585 = dev_get_drvdata(dev); in adp5585_suspend() local
155 regcache_cache_only(adp5585->regmap, true); in adp5585_suspend()
162 struct adp5585_dev *adp5585 = dev_get_drvdata(dev); in adp5585_resume() local
164 regcache_cache_only(adp5585->regmap, false); in adp5585_resume()
165 regcache_mark_dirty(adp5585->regmap); in adp5585_resume()
167 return regcache_sync(adp5585->regmap); in adp5585_resume()
174 .compatible = "adi,adp5585-00",
177 .compatible = "adi,adp5585-01",
180 .compatible = "adi,adp5585-02",
183 .compatible = "adi,adp5585-03",
186 .compatible = "adi,adp5585-04",
195 .name = "adp5585",
203 MODULE_DESCRIPTION("ADP5585 core driver");