Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: max77686: Add Maxim 77802 PMIC support

Maxim MAX77802 is a power management chip that contains 10 high
efficiency Buck regulators, 32 Low-dropout (LDO) regulators used
to power up application processors and peripherals, a 2-channel
32kHz clock outputs, a Real-Time-Clock (RTC) and a I2C interface
to program the individual regulators, clocks outputs and the RTC.

This patch adds support for MAX77802 to the MAX77686 driver and is
based on a driver added to the Chrome OS kernel 3.8 by Simon Glass.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Javier Martinez Canillas and committed by
Lee Jones
a259f389 ad83533a

+435 -31
+3 -3
drivers/mfd/Kconfig
··· 380 380 of the device. 381 381 382 382 config MFD_MAX77686 383 - bool "Maxim Semiconductor MAX77686 PMIC Support" 383 + bool "Maxim Semiconductor MAX77686/802 PMIC Support" 384 384 depends on I2C=y 385 385 select MFD_CORE 386 386 select REGMAP_I2C 387 387 select REGMAP_IRQ 388 388 select IRQ_DOMAIN 389 389 help 390 - Say yes here to add support for Maxim Semiconductor MAX77686. 391 - This is a Power Management IC with RTC on chip. 390 + Say yes here to add support for Maxim Semiconductor MAX77686 and 391 + MAX77802 which are Power Management IC with an RTC on chip. 392 392 This driver provides common support for accessing the device; 393 393 additional drivers must be enabled in order to use the functionality 394 394 of the device.
+169 -26
drivers/mfd/max77686.c
··· 1 1 /* 2 - * max77686.c - mfd core driver for the Maxim 77686 2 + * max77686.c - mfd core driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electronics 5 5 * Chiwoong Byun <woong.byun@smasung.com> ··· 43 43 { .name = "max77686-clk", }, 44 44 }; 45 45 46 + static const struct mfd_cell max77802_devs[] = { 47 + { .name = "max77802-pmic", }, 48 + { .name = "max77802-clk", }, 49 + { .name = "max77802-rtc", }, 50 + }; 51 + 52 + static bool max77802_pmic_is_accessible_reg(struct device *dev, 53 + unsigned int reg) 54 + { 55 + return (reg >= MAX77802_REG_DEVICE_ID && reg < MAX77802_REG_PMIC_END); 56 + } 57 + 58 + static bool max77802_rtc_is_accessible_reg(struct device *dev, 59 + unsigned int reg) 60 + { 61 + return (reg >= MAX77802_RTC_INT && reg < MAX77802_RTC_END); 62 + } 63 + 64 + static bool max77802_is_accessible_reg(struct device *dev, unsigned int reg) 65 + { 66 + return (max77802_pmic_is_accessible_reg(dev, reg) || 67 + max77802_rtc_is_accessible_reg(dev, reg)); 68 + } 69 + 70 + static bool max77802_pmic_is_precious_reg(struct device *dev, unsigned int reg) 71 + { 72 + return (reg == MAX77802_REG_INTSRC || reg == MAX77802_REG_INT1 || 73 + reg == MAX77802_REG_INT2); 74 + } 75 + 76 + static bool max77802_rtc_is_precious_reg(struct device *dev, unsigned int reg) 77 + { 78 + return (reg == MAX77802_RTC_INT || 79 + reg == MAX77802_RTC_UPDATE0 || 80 + reg == MAX77802_RTC_UPDATE1); 81 + } 82 + 83 + static bool max77802_is_precious_reg(struct device *dev, unsigned int reg) 84 + { 85 + return (max77802_pmic_is_precious_reg(dev, reg) || 86 + max77802_rtc_is_precious_reg(dev, reg)); 87 + } 88 + 89 + static bool max77802_pmic_is_volatile_reg(struct device *dev, unsigned int reg) 90 + { 91 + return (max77802_is_precious_reg(dev, reg) || 92 + reg == MAX77802_REG_STATUS1 || reg == MAX77802_REG_STATUS2 || 93 + reg == MAX77802_REG_PWRON); 94 + } 95 + 96 + static bool max77802_rtc_is_volatile_reg(struct device *dev, unsigned int reg) 97 + { 98 + return (max77802_rtc_is_precious_reg(dev, reg) || 99 + reg == MAX77802_RTC_SEC || 100 + reg == MAX77802_RTC_MIN || 101 + reg == MAX77802_RTC_HOUR || 102 + reg == MAX77802_RTC_WEEKDAY || 103 + reg == MAX77802_RTC_MONTH || 104 + reg == MAX77802_RTC_YEAR || 105 + reg == MAX77802_RTC_DATE); 106 + } 107 + 108 + static bool max77802_is_volatile_reg(struct device *dev, unsigned int reg) 109 + { 110 + return (max77802_pmic_is_volatile_reg(dev, reg) || 111 + max77802_rtc_is_volatile_reg(dev, reg)); 112 + } 113 + 46 114 static struct regmap_config max77686_regmap_config = { 47 115 .reg_bits = 8, 48 116 .val_bits = 8, ··· 119 51 static struct regmap_config max77686_rtc_regmap_config = { 120 52 .reg_bits = 8, 121 53 .val_bits = 8, 54 + }; 55 + 56 + static struct regmap_config max77802_regmap_config = { 57 + .reg_bits = 8, 58 + .val_bits = 8, 59 + .writeable_reg = max77802_is_accessible_reg, 60 + .readable_reg = max77802_is_accessible_reg, 61 + .precious_reg = max77802_is_precious_reg, 62 + .volatile_reg = max77802_is_volatile_reg, 63 + .name = "max77802-pmic", 64 + .cache_type = REGCACHE_RBTREE, 122 65 }; 123 66 124 67 static const struct regmap_irq max77686_irqs[] = { ··· 175 96 .num_irqs = ARRAY_SIZE(max77686_rtc_irqs), 176 97 }; 177 98 99 + static const struct regmap_irq_chip max77802_irq_chip = { 100 + .name = "max77802-pmic", 101 + .status_base = MAX77802_REG_INT1, 102 + .mask_base = MAX77802_REG_INT1MSK, 103 + .num_regs = 2, 104 + .irqs = max77686_irqs, /* same masks as 77686 */ 105 + .num_irqs = ARRAY_SIZE(max77686_irqs), 106 + }; 107 + 108 + static const struct regmap_irq_chip max77802_rtc_irq_chip = { 109 + .name = "max77802-rtc", 110 + .status_base = MAX77802_RTC_INT, 111 + .mask_base = MAX77802_RTC_INTM, 112 + .num_regs = 1, 113 + .irqs = max77686_rtc_irqs, /* same masks as 77686 */ 114 + .num_irqs = ARRAY_SIZE(max77686_rtc_irqs), 115 + }; 116 + 178 117 static const struct of_device_id max77686_pmic_dt_match[] = { 179 - {.compatible = "maxim,max77686", .data = NULL}, 180 - {}, 118 + { 119 + .compatible = "maxim,max77686", 120 + .data = (void *)TYPE_MAX77686, 121 + }, 122 + { 123 + .compatible = "maxim,max77802", 124 + .data = (void *)TYPE_MAX77802, 125 + }, 126 + { }, 181 127 }; 182 128 183 129 static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device ··· 223 119 { 224 120 struct max77686_dev *max77686 = NULL; 225 121 struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev); 122 + const struct of_device_id *match; 226 123 unsigned int data; 227 124 int ret = 0; 125 + const struct regmap_config *config; 126 + const struct regmap_irq_chip *irq_chip; 127 + const struct regmap_irq_chip *rtc_irq_chip; 128 + struct regmap **rtc_regmap; 129 + const struct mfd_cell *cells; 130 + int n_devs; 228 131 229 132 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node && !pdata) 230 133 pdata = max77686_i2c_parse_dt_pdata(&i2c->dev); ··· 246 135 if (!max77686) 247 136 return -ENOMEM; 248 137 138 + if (i2c->dev.of_node) { 139 + match = of_match_node(max77686_pmic_dt_match, i2c->dev.of_node); 140 + if (!match) 141 + return -EINVAL; 142 + 143 + max77686->type = (int)match->data; 144 + } else { 145 + max77686->type = id->driver_data; 146 + } 147 + 249 148 i2c_set_clientdata(i2c, max77686); 250 149 max77686->dev = &i2c->dev; 251 150 max77686->i2c = i2c; 252 - max77686->type = id->driver_data; 253 151 254 152 max77686->wakeup = pdata->wakeup; 255 153 max77686->irq = i2c->irq; 256 154 257 - max77686->regmap = devm_regmap_init_i2c(i2c, &max77686_regmap_config); 155 + if (max77686->type == TYPE_MAX77686) { 156 + config = &max77686_regmap_config; 157 + irq_chip = &max77686_irq_chip; 158 + rtc_irq_chip = &max77686_rtc_irq_chip; 159 + rtc_regmap = &max77686->rtc_regmap; 160 + cells = max77686_devs; 161 + n_devs = ARRAY_SIZE(max77686_devs); 162 + } else { 163 + config = &max77802_regmap_config; 164 + irq_chip = &max77802_irq_chip; 165 + rtc_irq_chip = &max77802_rtc_irq_chip; 166 + rtc_regmap = &max77686->regmap; 167 + cells = max77802_devs; 168 + n_devs = ARRAY_SIZE(max77802_devs); 169 + } 170 + 171 + max77686->regmap = devm_regmap_init_i2c(i2c, config); 258 172 if (IS_ERR(max77686->regmap)) { 259 173 ret = PTR_ERR(max77686->regmap); 260 174 dev_err(max77686->dev, "Failed to allocate register map: %d\n", ··· 294 158 return -ENODEV; 295 159 } 296 160 297 - max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC); 298 - if (!max77686->rtc) { 299 - dev_err(max77686->dev, "Failed to allocate I2C device for RTC\n"); 300 - return -ENODEV; 301 - } 302 - i2c_set_clientdata(max77686->rtc, max77686); 161 + if (max77686->type == TYPE_MAX77686) { 162 + max77686->rtc = i2c_new_dummy(i2c->adapter, I2C_ADDR_RTC); 163 + if (!max77686->rtc) { 164 + dev_err(max77686->dev, 165 + "Failed to allocate I2C device for RTC\n"); 166 + return -ENODEV; 167 + } 168 + i2c_set_clientdata(max77686->rtc, max77686); 303 169 304 - max77686->rtc_regmap = devm_regmap_init_i2c(max77686->rtc, 305 - &max77686_rtc_regmap_config); 306 - if (IS_ERR(max77686->rtc_regmap)) { 307 - ret = PTR_ERR(max77686->rtc_regmap); 308 - dev_err(max77686->dev, "failed to allocate RTC regmap: %d\n", 309 - ret); 310 - goto err_unregister_i2c; 170 + max77686->rtc_regmap = 171 + devm_regmap_init_i2c(max77686->rtc, 172 + &max77686_rtc_regmap_config); 173 + if (IS_ERR(max77686->rtc_regmap)) { 174 + ret = PTR_ERR(max77686->rtc_regmap); 175 + dev_err(max77686->dev, 176 + "failed to allocate RTC regmap: %d\n", 177 + ret); 178 + goto err_unregister_i2c; 179 + } 311 180 } 312 181 313 182 ret = regmap_add_irq_chip(max77686->regmap, max77686->irq, 314 183 IRQF_TRIGGER_FALLING | IRQF_ONESHOT | 315 - IRQF_SHARED, 0, &max77686_irq_chip, 184 + IRQF_SHARED, 0, irq_chip, 316 185 &max77686->irq_data); 317 186 if (ret) { 318 187 dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret); 319 188 goto err_unregister_i2c; 320 189 } 321 - ret = regmap_add_irq_chip(max77686->rtc_regmap, max77686->irq, 190 + 191 + ret = regmap_add_irq_chip(*rtc_regmap, max77686->irq, 322 192 IRQF_TRIGGER_FALLING | IRQF_ONESHOT | 323 - IRQF_SHARED, 0, &max77686_rtc_irq_chip, 193 + IRQF_SHARED, 0, rtc_irq_chip, 324 194 &max77686->rtc_irq_data); 325 195 if (ret) { 326 196 dev_err(&i2c->dev, "failed to add RTC irq chip: %d\n", ret); 327 197 goto err_del_irqc; 328 198 } 329 199 330 - ret = mfd_add_devices(max77686->dev, -1, max77686_devs, 331 - ARRAY_SIZE(max77686_devs), NULL, 0, NULL); 200 + ret = mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, 0, NULL); 332 201 if (ret < 0) { 333 202 dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret); 334 203 goto err_del_rtc_irqc; ··· 346 205 err_del_irqc: 347 206 regmap_del_irq_chip(max77686->irq, max77686->irq_data); 348 207 err_unregister_i2c: 349 - i2c_unregister_device(max77686->rtc); 208 + if (max77686->type == TYPE_MAX77686) 209 + i2c_unregister_device(max77686->rtc); 350 210 351 211 return ret; 352 212 } ··· 361 219 regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); 362 220 regmap_del_irq_chip(max77686->irq, max77686->irq_data); 363 221 364 - i2c_unregister_device(max77686->rtc); 222 + if (max77686->type == TYPE_MAX77686) 223 + i2c_unregister_device(max77686->rtc); 365 224 366 225 return 0; 367 226 } ··· 437 294 } 438 295 module_exit(max77686_i2c_exit); 439 296 440 - MODULE_DESCRIPTION("MAXIM 77686 multi-function core driver"); 297 + MODULE_DESCRIPTION("MAXIM 77686/802 multi-function core driver"); 441 298 MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>"); 442 299 MODULE_LICENSE("GPL");
+207 -1
include/linux/mfd/max77686-private.h
··· 1 1 /* 2 - * max77686-private.h - Voltage regulator driver for the Maxim 77686 2 + * max77686-private.h - Voltage regulator driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electrnoics 5 5 * Chiwoong Byun <woong.byun@samsung.com> ··· 28 28 29 29 #define MAX77686_REG_INVALID (0xff) 30 30 31 + /* MAX77686 PMIC registers */ 31 32 enum max77686_pmic_reg { 32 33 MAX77686_REG_DEVICE_ID = 0x00, 33 34 MAX77686_REG_INTSRC = 0x01, ··· 182 181 MAX77686_ALARM2_DATE = 0x1B, 183 182 }; 184 183 184 + /* MAX77802 PMIC registers */ 185 + enum max77802_pmic_reg { 186 + MAX77802_REG_DEVICE_ID = 0x00, 187 + MAX77802_REG_INTSRC = 0x01, 188 + MAX77802_REG_INT1 = 0x02, 189 + MAX77802_REG_INT2 = 0x03, 190 + 191 + MAX77802_REG_INT1MSK = 0x04, 192 + MAX77802_REG_INT2MSK = 0x05, 193 + 194 + MAX77802_REG_STATUS1 = 0x06, 195 + MAX77802_REG_STATUS2 = 0x07, 196 + 197 + MAX77802_REG_PWRON = 0x08, 198 + /* Reserved: 0x09 */ 199 + MAX77802_REG_MRSTB = 0x0A, 200 + MAX77802_REG_EPWRHOLD = 0x0B, 201 + /* Reserved: 0x0C-0x0D */ 202 + MAX77802_REG_BOOSTCTRL = 0x0E, 203 + MAX77802_REG_BOOSTOUT = 0x0F, 204 + 205 + MAX77802_REG_BUCK1CTRL = 0x10, 206 + MAX77802_REG_BUCK1DVS1 = 0x11, 207 + MAX77802_REG_BUCK1DVS2 = 0x12, 208 + MAX77802_REG_BUCK1DVS3 = 0x13, 209 + MAX77802_REG_BUCK1DVS4 = 0x14, 210 + MAX77802_REG_BUCK1DVS5 = 0x15, 211 + MAX77802_REG_BUCK1DVS6 = 0x16, 212 + MAX77802_REG_BUCK1DVS7 = 0x17, 213 + MAX77802_REG_BUCK1DVS8 = 0x18, 214 + /* Reserved: 0x19 */ 215 + MAX77802_REG_BUCK2CTRL1 = 0x1A, 216 + MAX77802_REG_BUCK2CTRL2 = 0x1B, 217 + MAX77802_REG_BUCK2PHTRAN = 0x1C, 218 + MAX77802_REG_BUCK2DVS1 = 0x1D, 219 + MAX77802_REG_BUCK2DVS2 = 0x1E, 220 + MAX77802_REG_BUCK2DVS3 = 0x1F, 221 + MAX77802_REG_BUCK2DVS4 = 0x20, 222 + MAX77802_REG_BUCK2DVS5 = 0x21, 223 + MAX77802_REG_BUCK2DVS6 = 0x22, 224 + MAX77802_REG_BUCK2DVS7 = 0x23, 225 + MAX77802_REG_BUCK2DVS8 = 0x24, 226 + /* Reserved: 0x25-0x26 */ 227 + MAX77802_REG_BUCK3CTRL1 = 0x27, 228 + MAX77802_REG_BUCK3DVS1 = 0x28, 229 + MAX77802_REG_BUCK3DVS2 = 0x29, 230 + MAX77802_REG_BUCK3DVS3 = 0x2A, 231 + MAX77802_REG_BUCK3DVS4 = 0x2B, 232 + MAX77802_REG_BUCK3DVS5 = 0x2C, 233 + MAX77802_REG_BUCK3DVS6 = 0x2D, 234 + MAX77802_REG_BUCK3DVS7 = 0x2E, 235 + MAX77802_REG_BUCK3DVS8 = 0x2F, 236 + /* Reserved: 0x30-0x36 */ 237 + MAX77802_REG_BUCK4CTRL1 = 0x37, 238 + MAX77802_REG_BUCK4DVS1 = 0x38, 239 + MAX77802_REG_BUCK4DVS2 = 0x39, 240 + MAX77802_REG_BUCK4DVS3 = 0x3A, 241 + MAX77802_REG_BUCK4DVS4 = 0x3B, 242 + MAX77802_REG_BUCK4DVS5 = 0x3C, 243 + MAX77802_REG_BUCK4DVS6 = 0x3D, 244 + MAX77802_REG_BUCK4DVS7 = 0x3E, 245 + MAX77802_REG_BUCK4DVS8 = 0x3F, 246 + /* Reserved: 0x40 */ 247 + MAX77802_REG_BUCK5CTRL = 0x41, 248 + MAX77802_REG_BUCK5OUT = 0x42, 249 + /* Reserved: 0x43 */ 250 + MAX77802_REG_BUCK6CTRL = 0x44, 251 + MAX77802_REG_BUCK6DVS1 = 0x45, 252 + MAX77802_REG_BUCK6DVS2 = 0x46, 253 + MAX77802_REG_BUCK6DVS3 = 0x47, 254 + MAX77802_REG_BUCK6DVS4 = 0x48, 255 + MAX77802_REG_BUCK6DVS5 = 0x49, 256 + MAX77802_REG_BUCK6DVS6 = 0x4A, 257 + MAX77802_REG_BUCK6DVS7 = 0x4B, 258 + MAX77802_REG_BUCK6DVS8 = 0x4C, 259 + /* Reserved: 0x4D */ 260 + MAX77802_REG_BUCK7CTRL = 0x4E, 261 + MAX77802_REG_BUCK7OUT = 0x4F, 262 + /* Reserved: 0x50 */ 263 + MAX77802_REG_BUCK8CTRL = 0x51, 264 + MAX77802_REG_BUCK8OUT = 0x52, 265 + /* Reserved: 0x53 */ 266 + MAX77802_REG_BUCK9CTRL = 0x54, 267 + MAX77802_REG_BUCK9OUT = 0x55, 268 + /* Reserved: 0x56 */ 269 + MAX77802_REG_BUCK10CTRL = 0x57, 270 + MAX77802_REG_BUCK10OUT = 0x58, 271 + 272 + /* Reserved: 0x59-0x5F */ 273 + 274 + MAX77802_REG_LDO1CTRL1 = 0x60, 275 + MAX77802_REG_LDO2CTRL1 = 0x61, 276 + MAX77802_REG_LDO3CTRL1 = 0x62, 277 + MAX77802_REG_LDO4CTRL1 = 0x63, 278 + MAX77802_REG_LDO5CTRL1 = 0x64, 279 + MAX77802_REG_LDO6CTRL1 = 0x65, 280 + MAX77802_REG_LDO7CTRL1 = 0x66, 281 + MAX77802_REG_LDO8CTRL1 = 0x67, 282 + MAX77802_REG_LDO9CTRL1 = 0x68, 283 + MAX77802_REG_LDO10CTRL1 = 0x69, 284 + MAX77802_REG_LDO11CTRL1 = 0x6A, 285 + MAX77802_REG_LDO12CTRL1 = 0x6B, 286 + MAX77802_REG_LDO13CTRL1 = 0x6C, 287 + MAX77802_REG_LDO14CTRL1 = 0x6D, 288 + MAX77802_REG_LDO15CTRL1 = 0x6E, 289 + /* Reserved: 0x6F */ 290 + MAX77802_REG_LDO17CTRL1 = 0x70, 291 + MAX77802_REG_LDO18CTRL1 = 0x71, 292 + MAX77802_REG_LDO19CTRL1 = 0x72, 293 + MAX77802_REG_LDO20CTRL1 = 0x73, 294 + MAX77802_REG_LDO21CTRL1 = 0x74, 295 + MAX77802_REG_LDO22CTRL1 = 0x75, 296 + MAX77802_REG_LDO23CTRL1 = 0x76, 297 + MAX77802_REG_LDO24CTRL1 = 0x77, 298 + MAX77802_REG_LDO25CTRL1 = 0x78, 299 + MAX77802_REG_LDO26CTRL1 = 0x79, 300 + MAX77802_REG_LDO27CTRL1 = 0x7A, 301 + MAX77802_REG_LDO28CTRL1 = 0x7B, 302 + MAX77802_REG_LDO29CTRL1 = 0x7C, 303 + MAX77802_REG_LDO30CTRL1 = 0x7D, 304 + /* Reserved: 0x7E */ 305 + MAX77802_REG_LDO32CTRL1 = 0x7F, 306 + MAX77802_REG_LDO33CTRL1 = 0x80, 307 + MAX77802_REG_LDO34CTRL1 = 0x81, 308 + MAX77802_REG_LDO35CTRL1 = 0x82, 309 + /* Reserved: 0x83-0x8F */ 310 + MAX77802_REG_LDO1CTRL2 = 0x90, 311 + MAX77802_REG_LDO2CTRL2 = 0x91, 312 + MAX77802_REG_LDO3CTRL2 = 0x92, 313 + MAX77802_REG_LDO4CTRL2 = 0x93, 314 + MAX77802_REG_LDO5CTRL2 = 0x94, 315 + MAX77802_REG_LDO6CTRL2 = 0x95, 316 + MAX77802_REG_LDO7CTRL2 = 0x96, 317 + MAX77802_REG_LDO8CTRL2 = 0x97, 318 + MAX77802_REG_LDO9CTRL2 = 0x98, 319 + MAX77802_REG_LDO10CTRL2 = 0x99, 320 + MAX77802_REG_LDO11CTRL2 = 0x9A, 321 + MAX77802_REG_LDO12CTRL2 = 0x9B, 322 + MAX77802_REG_LDO13CTRL2 = 0x9C, 323 + MAX77802_REG_LDO14CTRL2 = 0x9D, 324 + MAX77802_REG_LDO15CTRL2 = 0x9E, 325 + /* Reserved: 0x9F */ 326 + MAX77802_REG_LDO17CTRL2 = 0xA0, 327 + MAX77802_REG_LDO18CTRL2 = 0xA1, 328 + MAX77802_REG_LDO19CTRL2 = 0xA2, 329 + MAX77802_REG_LDO20CTRL2 = 0xA3, 330 + MAX77802_REG_LDO21CTRL2 = 0xA4, 331 + MAX77802_REG_LDO22CTRL2 = 0xA5, 332 + MAX77802_REG_LDO23CTRL2 = 0xA6, 333 + MAX77802_REG_LDO24CTRL2 = 0xA7, 334 + MAX77802_REG_LDO25CTRL2 = 0xA8, 335 + MAX77802_REG_LDO26CTRL2 = 0xA9, 336 + MAX77802_REG_LDO27CTRL2 = 0xAA, 337 + MAX77802_REG_LDO28CTRL2 = 0xAB, 338 + MAX77802_REG_LDO29CTRL2 = 0xAC, 339 + MAX77802_REG_LDO30CTRL2 = 0xAD, 340 + /* Reserved: 0xAE */ 341 + MAX77802_REG_LDO32CTRL2 = 0xAF, 342 + MAX77802_REG_LDO33CTRL2 = 0xB0, 343 + MAX77802_REG_LDO34CTRL2 = 0xB1, 344 + MAX77802_REG_LDO35CTRL2 = 0xB2, 345 + /* Reserved: 0xB3 */ 346 + 347 + MAX77802_REG_BBAT_CHG = 0xB4, 348 + MAX77802_REG_32KHZ = 0xB5, 349 + 350 + MAX77802_REG_PMIC_END = 0xB6, 351 + }; 352 + 353 + enum max77802_rtc_reg { 354 + MAX77802_RTC_INT = 0xC0, 355 + MAX77802_RTC_INTM = 0xC1, 356 + MAX77802_RTC_CONTROLM = 0xC2, 357 + MAX77802_RTC_CONTROL = 0xC3, 358 + MAX77802_RTC_UPDATE0 = 0xC4, 359 + MAX77802_RTC_UPDATE1 = 0xC5, 360 + MAX77802_WTSR_SMPL_CNTL = 0xC6, 361 + MAX77802_RTC_SEC = 0xC7, 362 + MAX77802_RTC_MIN = 0xC8, 363 + MAX77802_RTC_HOUR = 0xC9, 364 + MAX77802_RTC_WEEKDAY = 0xCA, 365 + MAX77802_RTC_MONTH = 0xCB, 366 + MAX77802_RTC_YEAR = 0xCC, 367 + MAX77802_RTC_DATE = 0xCD, 368 + MAX77802_RTC_AE1 = 0xCE, 369 + MAX77802_ALARM1_SEC = 0xCF, 370 + MAX77802_ALARM1_MIN = 0xD0, 371 + MAX77802_ALARM1_HOUR = 0xD1, 372 + MAX77802_ALARM1_WEEKDAY = 0xD2, 373 + MAX77802_ALARM1_MONTH = 0xD3, 374 + MAX77802_ALARM1_YEAR = 0xD4, 375 + MAX77802_ALARM1_DATE = 0xD5, 376 + MAX77802_RTC_AE2 = 0xD6, 377 + MAX77802_ALARM2_SEC = 0xD7, 378 + MAX77802_ALARM2_MIN = 0xD8, 379 + MAX77802_ALARM2_HOUR = 0xD9, 380 + MAX77802_ALARM2_WEEKDAY = 0xDA, 381 + MAX77802_ALARM2_MONTH = 0xDB, 382 + MAX77802_ALARM2_YEAR = 0xDC, 383 + MAX77802_ALARM2_DATE = 0xDD, 384 + 385 + MAX77802_RTC_END = 0xDF, 386 + }; 387 + 185 388 enum max77686_irq_source { 186 389 PMIC_INT1 = 0, 187 390 PMIC_INT2, ··· 455 250 456 251 enum max77686_types { 457 252 TYPE_MAX77686, 253 + TYPE_MAX77802, 458 254 }; 459 255 460 256 extern int max77686_irq_init(struct max77686_dev *max77686);
+56 -1
include/linux/mfd/max77686.h
··· 1 1 /* 2 - * max77686.h - Driver for the Maxim 77686 2 + * max77686.h - Driver for the Maxim 77686/802 3 3 * 4 4 * Copyright (C) 2012 Samsung Electrnoics 5 5 * Chiwoong Byun <woong.byun@samsung.com> ··· 71 71 MAX77686_REG_MAX, 72 72 }; 73 73 74 + /* MAX77802 regulator IDs */ 75 + enum max77802_regulators { 76 + MAX77802_BUCK1 = 0, 77 + MAX77802_BUCK2, 78 + MAX77802_BUCK3, 79 + MAX77802_BUCK4, 80 + MAX77802_BUCK5, 81 + MAX77802_BUCK6, 82 + MAX77802_BUCK7, 83 + MAX77802_BUCK8, 84 + MAX77802_BUCK9, 85 + MAX77802_BUCK10, 86 + MAX77802_LDO1, 87 + MAX77802_LDO2, 88 + MAX77802_LDO3, 89 + MAX77802_LDO4, 90 + MAX77802_LDO5, 91 + MAX77802_LDO6, 92 + MAX77802_LDO7, 93 + MAX77802_LDO8, 94 + MAX77802_LDO9, 95 + MAX77802_LDO10, 96 + MAX77802_LDO11, 97 + MAX77802_LDO12, 98 + MAX77802_LDO13, 99 + MAX77802_LDO14, 100 + MAX77802_LDO15, 101 + MAX77802_LDO17, 102 + MAX77802_LDO18, 103 + MAX77802_LDO19, 104 + MAX77802_LDO20, 105 + MAX77802_LDO21, 106 + MAX77802_LDO23, 107 + MAX77802_LDO24, 108 + MAX77802_LDO25, 109 + MAX77802_LDO26, 110 + MAX77802_LDO27, 111 + MAX77802_LDO28, 112 + MAX77802_LDO29, 113 + MAX77802_LDO30, 114 + MAX77802_LDO32, 115 + MAX77802_LDO33, 116 + MAX77802_LDO34, 117 + MAX77802_LDO35, 118 + 119 + MAX77802_REG_MAX, 120 + }; 121 + 74 122 struct max77686_regulator_data { 75 123 int id; 76 124 struct regulator_init_data *initdata; ··· 129 81 MAX77686_OPMODE_NORMAL, 130 82 MAX77686_OPMODE_LP, 131 83 MAX77686_OPMODE_STANDBY, 84 + }; 85 + 86 + enum max77802_opmode { 87 + MAX77802_OPMODE_OFF, 88 + MAX77802_OPMODE_STANDBY, 89 + MAX77802_OPMODE_LP, 90 + MAX77802_OPMODE_NORMAL, 132 91 }; 133 92 134 93 struct max77686_opmode_data {