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

Merge tag 'mfd-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
"Core Framework:
- New API to call bespoke pre/post IRQ handlers; Regmap

New Device Support:
- Add support for RN5T567 to rn5t618
- Add support for COMe-cSL6 and COMe-mAL10 to kempld-core

New Functionality:
- Add support for USB Power Supply to axp20x
- Add support for Power Key to hi655x-pmic

Fix-ups:
- Update MAINTAINERS; Dialog, Altera
- Remove module support; max77843, max77620, max8998, max8997, max8925-i2c
- Add module support; max14577
- Constifying; max77620
- Allow bespoke IRQ masking/unmasking; max77620
- Remove superfluous code; arizona, qcom_rpm, smsc-ece1099
- Power Management fixups; arizona-core
- Error-path improvement; twl-core, dm355evm_msp, smsc-ece1099, hi655x
- Clocking fixups; twl6040
- Trivial (spelling, headers, coding-style, whitespace, (re)naming);
si476x-i2c, omap-usb-tll, ti_am335x_tscadc, tps6507, hi655x-pmic

Bug Fixes:
- Fix offset error for MSM8660; qcom_rpm
- Fix possible spurious IRQs; arizona, hi655x-pmic"

* tag 'mfd-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (42 commits)
mfd: qcom_rpm: Parametrize also ack selector size
mfd: twl6040: Handle mclk used for HPPLL and optional internal clock source
mfd: Add support for COMe-cSL6 and COMe-mAL10 to Kontron PLD driver
mfd: hi655x: Fix return value check in hi655x_pmic_probe()
mfd: smsc-ece1099: Return directly after a function failure in smsc_i2c_probe()
mfd: smsc-ece1099: Delete an unnecessary variable initialisation in smsc_i2c_probe()
mfd: dm355evm_msp: Return directly after a failed platform_device_alloc() in add_child()
mfd: twl-core: Refactoring for add_numbered_child()
mfd: twl-core: Return directly after a failed platform_device_alloc() in add_numbered_child()
mfd: arizona: Add missing disable of PM runtime on probe error path
mfd: stmpe: Move platform data into MFD driver
mfd: max14577: Allow driver to be built as a module
mfd: max14577: Use module_init() instead of subsys_initcall()
mfd: arizona: Remove some duplicate defines
mfd: qcom_rpm: Remove unused define
mfd: hi655x-pmic: Add powerkey device to hi655x PMIC driver
mfd: hi655x-pmic: Rename some interrupt macro names
mfd: hi655x-pmic: Fixup issue with un-acked interrupts
mfd: arizona: Check if AOD interrupts are pending before dispatching
mfd: qcom_rpm: Fix offset error for msm8660
...

+635 -324
+2 -2
Documentation/devicetree/bindings/mfd/twl6040.txt
··· 19 19 20 20 Optional properties, nodes: 21 21 - enable-active-high: To power on the twl6040 during boot. 22 - - clocks: phandle to the clk32k clock provider 23 - - clock-names: Must be "clk32k" 22 + - clocks: phandle to the clk32k and/or to mclk clock provider 23 + - clock-names: Must be "clk32k" for the 32K clock and "mclk" for the MCLK. 24 24 25 25 Vibra functionality 26 26 Required properties:
+11
MAINTAINERS
··· 612 612 S: Maintained 613 613 F: drivers/gpio/gpio-altera.c 614 614 615 + ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT 616 + M: Thor Thayer <tthayer@opensource.altera.com> 617 + S: Maintained 618 + F: drivers/gpio/gpio-altera-a10sr.c 619 + F: drivers/mfd/altera-a10sr.c 620 + F: include/linux/mfd/altera-a10sr.h 621 + 615 622 ALTERA TRIPLE SPEED ETHERNET DRIVER 616 623 M: Vince Bridgers <vbridger@opensource.altera.com> 617 624 L: netdev@vger.kernel.org ··· 3718 3711 W: http://www.dialog-semiconductor.com/products 3719 3712 S: Supported 3720 3713 F: Documentation/hwmon/da90?? 3714 + F: Documentation/devicetree/bindings/mfd/da90*.txt 3715 + F: Documentation/devicetree/bindings/regulator/da92*.txt 3721 3716 F: Documentation/devicetree/bindings/sound/da[79]*.txt 3722 3717 F: drivers/gpio/gpio-da90??.c 3723 3718 F: drivers/hwmon/da90??-hwmon.c ··· 3740 3731 F: include/linux/mfd/da903x.h 3741 3732 F: include/linux/mfd/da9052/ 3742 3733 F: include/linux/mfd/da9055/ 3734 + F: include/linux/mfd/da9062/ 3743 3735 F: include/linux/mfd/da9063/ 3744 3736 F: include/linux/mfd/da9150/ 3737 + F: include/linux/regulator/da9211.h 3745 3738 F: include/sound/da[79]*.h 3746 3739 F: sound/soc/codecs/da[79]*.[ch] 3747 3740
+15 -2
drivers/mfd/Kconfig
··· 18 18 This is the core driver for CS5535/CS5536 MFD functions. This is 19 19 necessary for using the board's GPIO and MFGPT functionality. 20 20 21 + config MFD_ALTERA_A10SR 22 + bool "Altera Arria10 DevKit System Resource chip" 23 + depends on ARCH_SOCFPGA && SPI_MASTER=y && OF 24 + select REGMAP_SPI 25 + select MFD_CORE 26 + help 27 + Support for the Altera Arria10 DevKit MAX5 System Resource chip 28 + using the SPI interface. This driver provides common support for 29 + accessing the external gpio extender (LEDs & buttons) and 30 + power supply alarms (hwmon). 31 + 21 32 config MFD_ACT8945A 22 33 tristate "Active-semi ACT8945A" 23 34 select MFD_CORE ··· 491 480 * COMe-cDC2 (microETXexpress-DC) 492 481 * COMe-cHL6 493 482 * COMe-cPC2 (microETXexpress-PC) 483 + * COMe-cSL6 484 + * COMe-mAL10 494 485 * COMe-mBT10 495 486 * COMe-mCT10 496 487 * COMe-mTT10 (nanoETXexpress-TT) ··· 537 524 battery-charger under the corresponding menus. 538 525 539 526 config MFD_MAX14577 540 - bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support" 541 - depends on I2C=y 527 + tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support" 528 + depends on I2C 542 529 select MFD_CORE 543 530 select REGMAP_I2C 544 531 select REGMAP_IRQ
+2
drivers/mfd/Makefile
··· 205 205 intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC) += intel_soc_pmic_bxtwc.o 206 206 obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o 207 207 obj-$(CONFIG_MFD_MT6397) += mt6397-core.o 208 + 209 + obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o
+169
drivers/mfd/altera-a10sr.c
··· 1 + /* 2 + * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * You should have received a copy of the GNU General Public License along with 14 + * this program. If not, see <http://www.gnu.org/licenses/>. 15 + * 16 + * SPI access for Altera Arria10 MAX5 System Resource Chip 17 + * 18 + * Adapted from DA9052 19 + */ 20 + 21 + #include <linux/mfd/altera-a10sr.h> 22 + #include <linux/mfd/core.h> 23 + #include <linux/module.h> 24 + #include <linux/of.h> 25 + #include <linux/spi/spi.h> 26 + 27 + static const struct mfd_cell altr_a10sr_subdev_info[] = { 28 + { 29 + .name = "altr_a10sr_gpio", 30 + .of_compatible = "altr,a10sr-gpio", 31 + }, 32 + }; 33 + 34 + static bool altr_a10sr_reg_readable(struct device *dev, unsigned int reg) 35 + { 36 + switch (reg) { 37 + case ALTR_A10SR_VERSION_READ: 38 + case ALTR_A10SR_LED_REG: 39 + case ALTR_A10SR_PBDSW_REG: 40 + case ALTR_A10SR_PBDSW_IRQ_REG: 41 + case ALTR_A10SR_PWR_GOOD1_REG: 42 + case ALTR_A10SR_PWR_GOOD2_REG: 43 + case ALTR_A10SR_PWR_GOOD3_REG: 44 + case ALTR_A10SR_FMCAB_REG: 45 + case ALTR_A10SR_HPS_RST_REG: 46 + case ALTR_A10SR_USB_QSPI_REG: 47 + case ALTR_A10SR_SFPA_REG: 48 + case ALTR_A10SR_SFPB_REG: 49 + case ALTR_A10SR_I2C_M_REG: 50 + case ALTR_A10SR_WARM_RST_REG: 51 + case ALTR_A10SR_WR_KEY_REG: 52 + case ALTR_A10SR_PMBUS_REG: 53 + return true; 54 + default: 55 + return false; 56 + } 57 + } 58 + 59 + static bool altr_a10sr_reg_writeable(struct device *dev, unsigned int reg) 60 + { 61 + switch (reg) { 62 + case ALTR_A10SR_LED_REG: 63 + case ALTR_A10SR_PBDSW_IRQ_REG: 64 + case ALTR_A10SR_FMCAB_REG: 65 + case ALTR_A10SR_HPS_RST_REG: 66 + case ALTR_A10SR_USB_QSPI_REG: 67 + case ALTR_A10SR_SFPA_REG: 68 + case ALTR_A10SR_SFPB_REG: 69 + case ALTR_A10SR_WARM_RST_REG: 70 + case ALTR_A10SR_WR_KEY_REG: 71 + case ALTR_A10SR_PMBUS_REG: 72 + return true; 73 + default: 74 + return false; 75 + } 76 + } 77 + 78 + static bool altr_a10sr_reg_volatile(struct device *dev, unsigned int reg) 79 + { 80 + switch (reg) { 81 + case ALTR_A10SR_PBDSW_REG: 82 + case ALTR_A10SR_PBDSW_IRQ_REG: 83 + case ALTR_A10SR_PWR_GOOD1_REG: 84 + case ALTR_A10SR_PWR_GOOD2_REG: 85 + case ALTR_A10SR_PWR_GOOD3_REG: 86 + case ALTR_A10SR_HPS_RST_REG: 87 + case ALTR_A10SR_I2C_M_REG: 88 + case ALTR_A10SR_WARM_RST_REG: 89 + case ALTR_A10SR_WR_KEY_REG: 90 + case ALTR_A10SR_PMBUS_REG: 91 + return true; 92 + default: 93 + return false; 94 + } 95 + } 96 + 97 + const struct regmap_config altr_a10sr_regmap_config = { 98 + .reg_bits = 8, 99 + .val_bits = 8, 100 + 101 + .cache_type = REGCACHE_NONE, 102 + 103 + .use_single_rw = true, 104 + .read_flag_mask = 1, 105 + .write_flag_mask = 0, 106 + 107 + .max_register = ALTR_A10SR_WR_KEY_REG, 108 + .readable_reg = altr_a10sr_reg_readable, 109 + .writeable_reg = altr_a10sr_reg_writeable, 110 + .volatile_reg = altr_a10sr_reg_volatile, 111 + 112 + }; 113 + 114 + static int altr_a10sr_spi_probe(struct spi_device *spi) 115 + { 116 + int ret; 117 + struct altr_a10sr *a10sr; 118 + 119 + a10sr = devm_kzalloc(&spi->dev, sizeof(*a10sr), 120 + GFP_KERNEL); 121 + if (!a10sr) 122 + return -ENOMEM; 123 + 124 + spi->mode = SPI_MODE_3; 125 + spi->bits_per_word = 8; 126 + spi_setup(spi); 127 + 128 + a10sr->dev = &spi->dev; 129 + 130 + spi_set_drvdata(spi, a10sr); 131 + 132 + a10sr->regmap = devm_regmap_init_spi(spi, &altr_a10sr_regmap_config); 133 + if (IS_ERR(a10sr->regmap)) { 134 + ret = PTR_ERR(a10sr->regmap); 135 + dev_err(&spi->dev, "Failed to allocate register map: %d\n", 136 + ret); 137 + return ret; 138 + } 139 + 140 + ret = devm_mfd_add_devices(a10sr->dev, PLATFORM_DEVID_AUTO, 141 + altr_a10sr_subdev_info, 142 + ARRAY_SIZE(altr_a10sr_subdev_info), 143 + NULL, 0, NULL); 144 + if (ret) 145 + dev_err(a10sr->dev, "Failed to register sub-devices: %d\n", 146 + ret); 147 + 148 + return ret; 149 + } 150 + 151 + static const struct of_device_id altr_a10sr_spi_of_match[] = { 152 + { .compatible = "altr,a10sr" }, 153 + { }, 154 + }; 155 + MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match); 156 + 157 + static struct spi_driver altr_a10sr_spi_driver = { 158 + .probe = altr_a10sr_spi_probe, 159 + .driver = { 160 + .name = "altr_a10sr", 161 + .of_match_table = of_match_ptr(altr_a10sr_spi_of_match), 162 + }, 163 + }; 164 + 165 + module_spi_driver(altr_a10sr_spi_driver); 166 + 167 + MODULE_LICENSE("GPL v2"); 168 + MODULE_AUTHOR("Thor Thayer <tthayer@opensource.altera.com>"); 169 + MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver");
+3 -1
drivers/mfd/arizona-core.c
··· 1462 1462 /* Set up for interrupts */ 1463 1463 ret = arizona_irq_init(arizona); 1464 1464 if (ret != 0) 1465 - goto err_reset; 1465 + goto err_pm; 1466 1466 1467 1467 pm_runtime_set_autosuspend_delay(arizona->dev, 100); 1468 1468 pm_runtime_use_autosuspend(arizona->dev); ··· 1486 1486 1487 1487 err_irq: 1488 1488 arizona_irq_exit(arizona); 1489 + err_pm: 1490 + pm_runtime_disable(arizona->dev); 1489 1491 err_reset: 1490 1492 arizona_enable_reset(arizona); 1491 1493 regulator_disable(arizona->dcvdd);
+14 -2
drivers/mfd/arizona-irq.c
··· 109 109 do { 110 110 poll = false; 111 111 112 - if (arizona->aod_irq_chip) 113 - handle_nested_irq(irq_find_mapping(arizona->virq, 0)); 112 + if (arizona->aod_irq_chip) { 113 + /* 114 + * Check the AOD status register to determine whether 115 + * the nested IRQ handler should be called. 116 + */ 117 + ret = regmap_read(arizona->regmap, 118 + ARIZONA_AOD_IRQ1, &val); 119 + if (ret) 120 + dev_warn(arizona->dev, 121 + "Failed to read AOD IRQ1 %d\n", ret); 122 + else if (val) 123 + handle_nested_irq( 124 + irq_find_mapping(arizona->virq, 0)); 125 + } 114 126 115 127 /* 116 128 * Check if one of the main interrupts is asserted and only
+17
drivers/mfd/axp20x.c
··· 17 17 */ 18 18 19 19 #include <linux/err.h> 20 + #include <linux/delay.h> 20 21 #include <linux/interrupt.h> 21 22 #include <linux/kernel.h> 22 23 #include <linux/module.h> ··· 94 93 }; 95 94 96 95 static const struct regmap_range axp22x_volatile_ranges[] = { 96 + regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP20X_PWR_OP_MODE), 97 97 regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IRQ5_STATE), 98 + regmap_reg_range(AXP22X_GPIO_STATE, AXP22X_GPIO_STATE), 99 + regmap_reg_range(AXP20X_FG_RES, AXP20X_FG_RES), 98 100 }; 99 101 100 102 static const struct regmap_access_table axp22x_writeable_table = { ··· 159 155 DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), 160 156 DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_VALID, "VBUS_VALID"), 161 157 DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_NOT_VALID, "VBUS_NOT_VALID"), 158 + }; 159 + 160 + static struct resource axp22x_usb_power_supply_resources[] = { 161 + DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"), 162 + DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"), 162 163 }; 163 164 164 165 static struct resource axp22x_pek_resources[] = { ··· 533 524 .resources = axp22x_pek_resources, 534 525 }, { 535 526 .name = "axp20x-regulator", 527 + }, { 528 + .name = "axp20x-usb-power-supply", 529 + .of_compatible = "x-powers,axp221-usb-power-supply", 530 + .num_resources = ARRAY_SIZE(axp22x_usb_power_supply_resources), 531 + .resources = axp22x_usb_power_supply_resources, 536 532 }, 537 533 }; 538 534 ··· 678 664 679 665 regmap_write(axp20x_pm_power_off->regmap, AXP20X_OFF_CTRL, 680 666 AXP20X_OFF); 667 + 668 + /* Give capacitors etc. time to drain to avoid kernel panic msg. */ 669 + msleep(500); 681 670 } 682 671 683 672 int axp20x_match_device(struct axp20x_dev *axp20x)
+2 -5
drivers/mfd/dm355evm_msp.c
··· 199 199 int status; 200 200 201 201 pdev = platform_device_alloc(name, -1); 202 - if (!pdev) { 203 - dev_dbg(&client->dev, "can't alloc dev\n"); 204 - status = -ENOMEM; 205 - goto err; 206 - } 202 + if (!pdev) 203 + return ERR_PTR(-ENOMEM); 207 204 208 205 device_init_wakeup(&pdev->dev, can_wakeup); 209 206 pdev->dev.parent = &client->dev;
+41 -18
drivers/mfd/hi655x-pmic.c
··· 24 24 #include <linux/platform_device.h> 25 25 #include <linux/regmap.h> 26 26 27 - static const struct mfd_cell hi655x_pmic_devs[] = { 28 - { .name = "hi655x-regulator", }, 29 - }; 30 - 31 27 static const struct regmap_irq hi655x_irqs[] = { 32 - { .reg_offset = 0, .mask = OTMP_D1R_INT }, 33 - { .reg_offset = 0, .mask = VSYS_2P5_R_INT }, 34 - { .reg_offset = 0, .mask = VSYS_UV_D3R_INT }, 35 - { .reg_offset = 0, .mask = VSYS_6P0_D200UR_INT }, 36 - { .reg_offset = 0, .mask = PWRON_D4SR_INT }, 37 - { .reg_offset = 0, .mask = PWRON_D20F_INT }, 38 - { .reg_offset = 0, .mask = PWRON_D20R_INT }, 39 - { .reg_offset = 0, .mask = RESERVE_INT }, 28 + { .reg_offset = 0, .mask = OTMP_D1R_INT_MASK }, 29 + { .reg_offset = 0, .mask = VSYS_2P5_R_INT_MASK }, 30 + { .reg_offset = 0, .mask = VSYS_UV_D3R_INT_MASK }, 31 + { .reg_offset = 0, .mask = VSYS_6P0_D200UR_INT_MASK }, 32 + { .reg_offset = 0, .mask = PWRON_D4SR_INT_MASK }, 33 + { .reg_offset = 0, .mask = PWRON_D20F_INT_MASK }, 34 + { .reg_offset = 0, .mask = PWRON_D20R_INT_MASK }, 35 + { .reg_offset = 0, .mask = RESERVE_INT_MASK }, 40 36 }; 41 37 42 38 static const struct regmap_irq_chip hi655x_irq_chip = { ··· 41 45 .num_regs = 1, 42 46 .num_irqs = ARRAY_SIZE(hi655x_irqs), 43 47 .status_base = HI655X_IRQ_STAT_BASE, 48 + .ack_base = HI655X_IRQ_STAT_BASE, 44 49 .mask_base = HI655X_IRQ_MASK_BASE, 45 50 }; 46 51 ··· 50 53 .reg_stride = HI655X_STRIDE, 51 54 .val_bits = 8, 52 55 .max_register = HI655X_BUS_ADDR(0xFFF), 56 + }; 57 + 58 + static struct resource pwrkey_resources[] = { 59 + { 60 + .name = "down", 61 + .start = PWRON_D20R_INT, 62 + .end = PWRON_D20R_INT, 63 + .flags = IORESOURCE_IRQ, 64 + }, { 65 + .name = "up", 66 + .start = PWRON_D20F_INT, 67 + .end = PWRON_D20F_INT, 68 + .flags = IORESOURCE_IRQ, 69 + }, { 70 + .name = "hold 4s", 71 + .start = PWRON_D4SR_INT, 72 + .end = PWRON_D4SR_INT, 73 + .flags = IORESOURCE_IRQ, 74 + }, 75 + }; 76 + 77 + static const struct mfd_cell hi655x_pmic_devs[] = { 78 + { 79 + .name = "hi65xx-powerkey", 80 + .num_resources = ARRAY_SIZE(pwrkey_resources), 81 + .resources = &pwrkey_resources[0], 82 + }, 83 + { .name = "hi655x-regulator", }, 53 84 }; 54 85 55 86 static void hi655x_local_irq_clear(struct regmap *map) ··· 105 80 pmic->dev = dev; 106 81 107 82 pmic->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 108 - if (!pmic->res) 109 - return -ENOENT; 110 - 111 83 base = devm_ioremap_resource(dev, pmic->res); 112 - if (!base) 113 - return -ENOMEM; 84 + if (IS_ERR(base)) 85 + return PTR_ERR(base); 114 86 115 87 pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base, 116 88 &hi655x_regmap_config); ··· 145 123 platform_set_drvdata(pdev, pmic); 146 124 147 125 ret = mfd_add_devices(dev, PLATFORM_DEVID_AUTO, hi655x_pmic_devs, 148 - ARRAY_SIZE(hi655x_pmic_devs), NULL, 0, NULL); 126 + ARRAY_SIZE(hi655x_pmic_devs), NULL, 0, 127 + regmap_irq_get_domain(pmic->irq_data)); 149 128 if (ret) { 150 129 dev_err(dev, "Failed to register device %d\n", ret); 151 130 regmap_del_irq_chip(gpio_to_irq(pmic->gpio), pmic->irq_data);
+16
drivers/mfd/kempld-core.c
··· 624 624 .driver_data = (void *)&kempld_platform_data_generic, 625 625 .callback = kempld_create_platform_device, 626 626 }, { 627 + .ident = "CSL6", 628 + .matches = { 629 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 630 + DMI_MATCH(DMI_BOARD_NAME, "COMe-cSL6"), 631 + }, 632 + .driver_data = (void *)&kempld_platform_data_generic, 633 + .callback = kempld_create_platform_device, 634 + }, { 627 635 .ident = "CVV6", 628 636 .matches = { 629 637 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), ··· 651 643 .ident = "FRI2", 652 644 .matches = { 653 645 DMI_MATCH(DMI_PRODUCT_NAME, "Fish River Island II"), 646 + }, 647 + .driver_data = (void *)&kempld_platform_data_generic, 648 + .callback = kempld_create_platform_device, 649 + }, { 650 + .ident = "MAL1", 651 + .matches = { 652 + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 653 + DMI_MATCH(DMI_BOARD_NAME, "COMe-mAL10"), 654 654 }, 655 655 .driver_data = (void *)&kempld_platform_data_generic, 656 656 .callback = kempld_create_platform_device,
+1 -1
drivers/mfd/max14577.c
··· 561 561 562 562 return i2c_add_driver(&max14577_i2c_driver); 563 563 } 564 - subsys_initcall(max14577_i2c_init); 564 + module_init(max14577_i2c_init); 565 565 566 566 static void __exit max14577_i2c_exit(void) 567 567 {
+52 -23
drivers/mfd/max77620.c
··· 31 31 #include <linux/interrupt.h> 32 32 #include <linux/mfd/core.h> 33 33 #include <linux/mfd/max77620.h> 34 - #include <linux/module.h> 34 + #include <linux/init.h> 35 35 #include <linux/of.h> 36 36 #include <linux/of_device.h> 37 37 #include <linux/regmap.h> 38 38 #include <linux/slab.h> 39 39 40 - static struct resource gpio_resources[] = { 40 + static const struct resource gpio_resources[] = { 41 41 DEFINE_RES_IRQ(MAX77620_IRQ_TOP_GPIO), 42 42 }; 43 43 44 - static struct resource power_resources[] = { 44 + static const struct resource power_resources[] = { 45 45 DEFINE_RES_IRQ(MAX77620_IRQ_LBT_MBATLOW), 46 46 }; 47 47 48 - static struct resource rtc_resources[] = { 48 + static const struct resource rtc_resources[] = { 49 49 DEFINE_RES_IRQ(MAX77620_IRQ_TOP_RTC), 50 50 }; 51 51 52 - static struct resource thermal_resources[] = { 52 + static const struct resource thermal_resources[] = { 53 53 DEFINE_RES_IRQ(MAX77620_IRQ_LBT_TJALRM1), 54 54 DEFINE_RES_IRQ(MAX77620_IRQ_LBT_TJALRM2), 55 55 }; ··· 111 111 }, 112 112 }; 113 113 114 - static struct regmap_irq_chip max77620_top_irq_chip = { 115 - .name = "max77620-top", 116 - .irqs = max77620_top_irqs, 117 - .num_irqs = ARRAY_SIZE(max77620_top_irqs), 118 - .num_regs = 2, 119 - .status_base = MAX77620_REG_IRQTOP, 120 - .mask_base = MAX77620_REG_IRQTOPM, 121 - }; 122 - 123 114 static const struct regmap_range max77620_readable_ranges[] = { 124 115 regmap_reg_range(MAX77620_REG_CNFGGLBL1, MAX77620_REG_DVSSD4), 125 116 }; ··· 169 178 .rd_table = &max20024_readable_table, 170 179 .wr_table = &max77620_writable_table, 171 180 .volatile_table = &max77620_volatile_table, 181 + }; 182 + 183 + /* 184 + * MAX77620 and MAX20024 has the following steps of the interrupt handling 185 + * for TOP interrupts: 186 + * 1. When interrupt occurs from PMIC, mask the PMIC interrupt by setting GLBLM. 187 + * 2. Read IRQTOP and service the interrupt. 188 + * 3. Once all interrupts has been checked and serviced, the interrupt service 189 + * routine un-masks the hardware interrupt line by clearing GLBLM. 190 + */ 191 + static int max77620_irq_global_mask(void *irq_drv_data) 192 + { 193 + struct max77620_chip *chip = irq_drv_data; 194 + int ret; 195 + 196 + ret = regmap_update_bits(chip->rmap, MAX77620_REG_INTENLBT, 197 + MAX77620_GLBLM_MASK, MAX77620_GLBLM_MASK); 198 + if (ret < 0) 199 + dev_err(chip->dev, "Failed to set GLBLM: %d\n", ret); 200 + 201 + return ret; 202 + } 203 + 204 + static int max77620_irq_global_unmask(void *irq_drv_data) 205 + { 206 + struct max77620_chip *chip = irq_drv_data; 207 + int ret; 208 + 209 + ret = regmap_update_bits(chip->rmap, MAX77620_REG_INTENLBT, 210 + MAX77620_GLBLM_MASK, 0); 211 + if (ret < 0) 212 + dev_err(chip->dev, "Failed to reset GLBLM: %d\n", ret); 213 + 214 + return ret; 215 + } 216 + 217 + static struct regmap_irq_chip max77620_top_irq_chip = { 218 + .name = "max77620-top", 219 + .irqs = max77620_top_irqs, 220 + .num_irqs = ARRAY_SIZE(max77620_top_irqs), 221 + .num_regs = 2, 222 + .status_base = MAX77620_REG_IRQTOP, 223 + .mask_base = MAX77620_REG_IRQTOPM, 224 + .handle_pre_irq = max77620_irq_global_mask, 225 + .handle_post_irq = max77620_irq_global_unmask, 172 226 }; 173 227 174 228 /* max77620_get_fps_period_reg_value: Get FPS bit field value from ··· 469 433 if (ret < 0) 470 434 return ret; 471 435 436 + max77620_top_irq_chip.irq_drv_data = chip; 472 437 ret = devm_regmap_add_irq_chip(chip->dev, chip->rmap, client->irq, 473 438 IRQF_ONESHOT | IRQF_SHARED, 474 439 chip->irq_base, &max77620_top_irq_chip, ··· 605 568 {"max20024", MAX20024}, 606 569 {}, 607 570 }; 608 - MODULE_DEVICE_TABLE(i2c, max77620_id); 609 571 610 572 static const struct dev_pm_ops max77620_pm_ops = { 611 573 SET_SYSTEM_SLEEP_PM_OPS(max77620_i2c_suspend, max77620_i2c_resume) ··· 618 582 .probe = max77620_probe, 619 583 .id_table = max77620_id, 620 584 }; 621 - 622 - module_i2c_driver(max77620_driver); 623 - 624 - MODULE_DESCRIPTION("MAX77620/MAX20024 Multi Function Device Core Driver"); 625 - MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 626 - MODULE_AUTHOR("Chaitanya Bandi <bandik@nvidia.com>"); 627 - MODULE_AUTHOR("Mallikarjun Kasoju <mkasoju@nvidia.com>"); 628 - MODULE_LICENSE("GPL v2"); 585 + builtin_i2c_driver(max77620_driver);
+2 -22
drivers/mfd/max77843.c
··· 15 15 #include <linux/i2c.h> 16 16 #include <linux/init.h> 17 17 #include <linux/interrupt.h> 18 - #include <linux/module.h> 18 + #include <linux/init.h> 19 19 #include <linux/mfd/core.h> 20 20 #include <linux/mfd/max77693-common.h> 21 21 #include <linux/mfd/max77843-private.h> ··· 171 171 return ret; 172 172 } 173 173 174 - static int max77843_remove(struct i2c_client *i2c) 175 - { 176 - struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 177 - 178 - mfd_remove_devices(max77843->dev); 179 - 180 - regmap_del_irq_chip(max77843->irq, max77843->irq_data_topsys); 181 - 182 - i2c_unregister_device(max77843->i2c_chg); 183 - 184 - return 0; 185 - } 186 - 187 174 static const struct of_device_id max77843_dt_match[] = { 188 175 { .compatible = "maxim,max77843", }, 189 176 { }, ··· 180 193 { "max77843", TYPE_MAX77843, }, 181 194 { }, 182 195 }; 183 - MODULE_DEVICE_TABLE(i2c, max77843_id); 184 196 185 197 static int __maybe_unused max77843_suspend(struct device *dev) 186 198 { ··· 212 226 .name = "max77843", 213 227 .pm = &max77843_pm, 214 228 .of_match_table = max77843_dt_match, 229 + .suppress_bind_attrs = true, 215 230 }, 216 231 .probe = max77843_probe, 217 - .remove = max77843_remove, 218 232 .id_table = max77843_id, 219 233 }; 220 234 ··· 223 237 return i2c_add_driver(&max77843_i2c_driver); 224 238 } 225 239 subsys_initcall(max77843_i2c_init); 226 - 227 - static void __exit max77843_i2c_exit(void) 228 - { 229 - i2c_del_driver(&max77843_i2c_driver); 230 - } 231 - module_exit(max77843_i2c_exit);
+1 -13
drivers/mfd/max8925-i2c.c
··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 #include <linux/kernel.h> 12 - #include <linux/module.h> 12 + #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/i2c.h> 15 15 #include <linux/mfd/max8925.h> ··· 133 133 { "max8925", 0 }, 134 134 { }, 135 135 }; 136 - MODULE_DEVICE_TABLE(i2c, max8925_id_table); 137 136 138 137 static int max8925_dt_init(struct device_node *np, struct device *dev, 139 138 struct max8925_platform_data *pdata) ··· 239 240 { .compatible = "maxim,max8925", }, 240 241 {}, 241 242 }; 242 - MODULE_DEVICE_TABLE(of, max8925_dt_ids); 243 243 244 244 static struct i2c_driver max8925_driver = { 245 245 .driver = { ··· 262 264 return ret; 263 265 } 264 266 subsys_initcall(max8925_i2c_init); 265 - 266 - static void __exit max8925_i2c_exit(void) 267 - { 268 - i2c_del_driver(&max8925_driver); 269 - } 270 - module_exit(max8925_i2c_exit); 271 - 272 - MODULE_DESCRIPTION("I2C Driver for Maxim 8925"); 273 - MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); 274 - MODULE_LICENSE("GPL");
+3 -27
drivers/mfd/max8997.c
··· 2 2 * max8997.c - mfd core driver for the Maxim 8966 and 8997 3 3 * 4 4 * Copyright (C) 2011 Samsung Electronics 5 - * MyungJoo Ham <myungjoo.ham@smasung.com> 5 + * MyungJoo Ham <myungjoo.ham@samsung.com> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License as published by ··· 28 28 #include <linux/of_irq.h> 29 29 #include <linux/interrupt.h> 30 30 #include <linux/pm_runtime.h> 31 - #include <linux/module.h> 31 + #include <linux/init.h> 32 32 #include <linux/mutex.h> 33 33 #include <linux/mfd/core.h> 34 34 #include <linux/mfd/max8997.h> ··· 55 55 { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 }, 56 56 {}, 57 57 }; 58 - MODULE_DEVICE_TABLE(of, max8997_pmic_dt_match); 59 58 #endif 60 59 61 60 int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) ··· 262 263 return ret; 263 264 } 264 265 265 - static int max8997_i2c_remove(struct i2c_client *i2c) 266 - { 267 - struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 268 - 269 - mfd_remove_devices(max8997->dev); 270 - i2c_unregister_device(max8997->muic); 271 - i2c_unregister_device(max8997->haptic); 272 - i2c_unregister_device(max8997->rtc); 273 - 274 - return 0; 275 - } 276 - 277 266 static const struct i2c_device_id max8997_i2c_id[] = { 278 267 { "max8997", TYPE_MAX8997 }, 279 268 { "max8966", TYPE_MAX8966 }, 280 269 { } 281 270 }; 282 - MODULE_DEVICE_TABLE(i2c, max8998_i2c_id); 283 271 284 272 static u8 max8997_dumpaddr_pmic[] = { 285 273 MAX8997_REG_INT1MSK, ··· 496 510 .driver = { 497 511 .name = "max8997", 498 512 .pm = &max8997_pm, 513 + .suppress_bind_attrs = true, 499 514 .of_match_table = of_match_ptr(max8997_pmic_dt_match), 500 515 }, 501 516 .probe = max8997_i2c_probe, 502 - .remove = max8997_i2c_remove, 503 517 .id_table = max8997_i2c_id, 504 518 }; 505 519 ··· 509 523 } 510 524 /* init early so consumer devices can complete system boot */ 511 525 subsys_initcall(max8997_i2c_init); 512 - 513 - static void __exit max8997_i2c_exit(void) 514 - { 515 - i2c_del_driver(&max8997_i2c_driver); 516 - } 517 - module_exit(max8997_i2c_exit); 518 - 519 - MODULE_DESCRIPTION("MAXIM 8997 multi-function core driver"); 520 - MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); 521 - MODULE_LICENSE("GPL");
+1 -26
drivers/mfd/max8998.c
··· 21 21 */ 22 22 23 23 #include <linux/err.h> 24 - #include <linux/module.h> 25 - #include <linux/moduleparam.h> 26 24 #include <linux/init.h> 27 25 #include <linux/slab.h> 28 26 #include <linux/i2c.h> ··· 136 138 { .compatible = "ti,lp3974", .data = (void *)TYPE_LP3974 }, 137 139 {}, 138 140 }; 139 - MODULE_DEVICE_TABLE(of, max8998_dt_match); 140 141 #endif 141 142 142 143 /* ··· 251 254 return ret; 252 255 } 253 256 254 - static int max8998_i2c_remove(struct i2c_client *i2c) 255 - { 256 - struct max8998_dev *max8998 = i2c_get_clientdata(i2c); 257 - 258 - mfd_remove_devices(max8998->dev); 259 - max8998_irq_exit(max8998); 260 - i2c_unregister_device(max8998->rtc); 261 - 262 - return 0; 263 - } 264 - 265 257 static const struct i2c_device_id max8998_i2c_id[] = { 266 258 { "max8998", TYPE_MAX8998 }, 267 259 { "lp3974", TYPE_LP3974}, 268 260 { } 269 261 }; 270 - MODULE_DEVICE_TABLE(i2c, max8998_i2c_id); 271 262 272 263 static int max8998_suspend(struct device *dev) 273 264 { ··· 363 378 .driver = { 364 379 .name = "max8998", 365 380 .pm = &max8998_pm, 381 + .suppress_bind_attrs = true, 366 382 .of_match_table = of_match_ptr(max8998_dt_match), 367 383 }, 368 384 .probe = max8998_i2c_probe, 369 - .remove = max8998_i2c_remove, 370 385 .id_table = max8998_i2c_id, 371 386 }; 372 387 ··· 376 391 } 377 392 /* init early so consumer devices can complete system boot */ 378 393 subsys_initcall(max8998_i2c_init); 379 - 380 - static void __exit max8998_i2c_exit(void) 381 - { 382 - i2c_del_driver(&max8998_i2c_driver); 383 - } 384 - module_exit(max8998_i2c_exit); 385 - 386 - MODULE_DESCRIPTION("MAXIM 8998 multi-function core driver"); 387 - MODULE_AUTHOR("Kyungmin Park <kyungmin.park@samsung.com>"); 388 - MODULE_LICENSE("GPL");
+2
drivers/mfd/omap-usb-tll.c
··· 30 30 #include <linux/platform_data/usb-omap.h> 31 31 #include <linux/of.h> 32 32 33 + #include "omap-usb.h" 34 + 33 35 #define USBTLL_DRIVER_NAME "usbhs_tll" 34 36 35 37 /* TLL Register Set */
+41 -16
drivers/mfd/qcom_rpm.c
··· 34 34 struct qcom_rpm_data { 35 35 u32 version; 36 36 const struct qcom_rpm_resource *resource_table; 37 - unsigned n_resources; 37 + unsigned int n_resources; 38 + unsigned int req_ctx_off; 39 + unsigned int req_sel_off; 40 + unsigned int ack_ctx_off; 41 + unsigned int ack_sel_off; 42 + unsigned int req_sel_size; 43 + unsigned int ack_sel_size; 38 44 }; 39 45 40 46 struct qcom_rpm { ··· 67 61 68 62 #define RPM_REQUEST_TIMEOUT (5 * HZ) 69 63 70 - #define RPM_REQUEST_CONTEXT 3 71 - #define RPM_REQ_SELECT 11 72 - #define RPM_ACK_CONTEXT 15 73 - #define RPM_ACK_SELECTOR 23 74 - #define RPM_SELECT_SIZE 7 64 + #define RPM_MAX_SEL_SIZE 7 75 65 76 66 #define RPM_NOTIFICATION BIT(30) 77 67 #define RPM_REJECTED BIT(31) 78 - 79 - #define RPM_SIGNAL BIT(2) 80 68 81 69 static const struct qcom_rpm_resource apq8064_rpm_resource_table[] = { 82 70 [QCOM_RPM_CXO_CLK] = { 25, 9, 5, 1 }, ··· 157 157 .version = 3, 158 158 .resource_table = apq8064_rpm_resource_table, 159 159 .n_resources = ARRAY_SIZE(apq8064_rpm_resource_table), 160 + .req_ctx_off = 3, 161 + .req_sel_off = 11, 162 + .ack_ctx_off = 15, 163 + .ack_sel_off = 23, 164 + .req_sel_size = 4, 165 + .ack_sel_size = 7, 160 166 }; 161 167 162 168 static const struct qcom_rpm_resource msm8660_rpm_resource_table[] = { ··· 246 240 .version = 2, 247 241 .resource_table = msm8660_rpm_resource_table, 248 242 .n_resources = ARRAY_SIZE(msm8660_rpm_resource_table), 243 + .req_ctx_off = 3, 244 + .req_sel_off = 11, 245 + .ack_ctx_off = 19, 246 + .ack_sel_off = 27, 247 + .req_sel_size = 7, 248 + .ack_sel_size = 7, 249 249 }; 250 250 251 251 static const struct qcom_rpm_resource msm8960_rpm_resource_table[] = { ··· 334 322 .version = 3, 335 323 .resource_table = msm8960_rpm_resource_table, 336 324 .n_resources = ARRAY_SIZE(msm8960_rpm_resource_table), 325 + .req_ctx_off = 3, 326 + .req_sel_off = 11, 327 + .ack_ctx_off = 15, 328 + .ack_sel_off = 23, 329 + .req_sel_size = 4, 330 + .ack_sel_size = 7, 337 331 }; 338 332 339 333 static const struct qcom_rpm_resource ipq806x_rpm_resource_table[] = { ··· 380 362 .version = 3, 381 363 .resource_table = ipq806x_rpm_resource_table, 382 364 .n_resources = ARRAY_SIZE(ipq806x_rpm_resource_table), 365 + .req_ctx_off = 3, 366 + .req_sel_off = 11, 367 + .ack_ctx_off = 15, 368 + .ack_sel_off = 23, 369 + .req_sel_size = 4, 370 + .ack_sel_size = 7, 383 371 }; 384 372 385 373 static const struct of_device_id qcom_rpm_of_match[] = { ··· 404 380 { 405 381 const struct qcom_rpm_resource *res; 406 382 const struct qcom_rpm_data *data = rpm->data; 407 - u32 sel_mask[RPM_SELECT_SIZE] = { 0 }; 383 + u32 sel_mask[RPM_MAX_SEL_SIZE] = { 0 }; 408 384 int left; 409 385 int ret = 0; 410 386 int i; ··· 422 398 writel_relaxed(buf[i], RPM_REQ_REG(rpm, res->target_id + i)); 423 399 424 400 bitmap_set((unsigned long *)sel_mask, res->select_id, 1); 425 - for (i = 0; i < ARRAY_SIZE(sel_mask); i++) { 401 + for (i = 0; i < rpm->data->req_sel_size; i++) { 426 402 writel_relaxed(sel_mask[i], 427 - RPM_CTRL_REG(rpm, RPM_REQ_SELECT + i)); 403 + RPM_CTRL_REG(rpm, rpm->data->req_sel_off + i)); 428 404 } 429 405 430 - writel_relaxed(BIT(state), RPM_CTRL_REG(rpm, RPM_REQUEST_CONTEXT)); 406 + writel_relaxed(BIT(state), RPM_CTRL_REG(rpm, rpm->data->req_ctx_off)); 431 407 432 408 reinit_completion(&rpm->ack); 433 409 regmap_write(rpm->ipc_regmap, rpm->ipc_offset, BIT(rpm->ipc_bit)); ··· 450 426 u32 ack; 451 427 int i; 452 428 453 - ack = readl_relaxed(RPM_CTRL_REG(rpm, RPM_ACK_CONTEXT)); 454 - for (i = 0; i < RPM_SELECT_SIZE; i++) 455 - writel_relaxed(0, RPM_CTRL_REG(rpm, RPM_ACK_SELECTOR + i)); 456 - writel(0, RPM_CTRL_REG(rpm, RPM_ACK_CONTEXT)); 429 + ack = readl_relaxed(RPM_CTRL_REG(rpm, rpm->data->ack_ctx_off)); 430 + for (i = 0; i < rpm->data->ack_sel_size; i++) 431 + writel_relaxed(0, 432 + RPM_CTRL_REG(rpm, rpm->data->ack_sel_off + i)); 433 + writel(0, RPM_CTRL_REG(rpm, rpm->data->ack_ctx_off)); 457 434 458 435 if (ack & RPM_NOTIFICATION) { 459 436 dev_warn(rpm->dev, "ignoring notification!\n");
+1 -1
drivers/mfd/si476x-i2c.c
··· 600 600 unknown_revision: 601 601 dev_err(&core->client->dev, 602 602 "Unsupported version of the firmware: %d.%d.%d, " 603 - "reverting to A10 comptible functions\n", 603 + "reverting to A10 compatible functions\n", 604 604 major, minor1, minor2); 605 605 606 606 return SI476X_REVISION_A10;
+4 -7
drivers/mfd/smsc-ece1099.c
··· 36 36 { 37 37 struct smsc *smsc; 38 38 int devid, rev, venid_l, venid_h; 39 - int ret = 0; 39 + int ret; 40 40 41 41 smsc = devm_kzalloc(&i2c->dev, sizeof(struct smsc), 42 42 GFP_KERNEL); ··· 46 46 } 47 47 48 48 smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config); 49 - if (IS_ERR(smsc->regmap)) { 50 - ret = PTR_ERR(smsc->regmap); 51 - goto err; 52 - } 49 + if (IS_ERR(smsc->regmap)) 50 + return PTR_ERR(smsc->regmap); 53 51 54 52 i2c_set_clientdata(i2c, smsc); 55 53 smsc->dev = &i2c->dev; ··· 66 68 67 69 ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk); 68 70 if (ret) 69 - goto err; 71 + return ret; 70 72 71 73 #ifdef CONFIG_OF 72 74 if (i2c->dev.of_node) ··· 74 76 NULL, NULL, &i2c->dev); 75 77 #endif 76 78 77 - err: 78 79 return ret; 79 80 } 80 81
+28 -12
drivers/mfd/stmpe.c
··· 23 23 #include <linux/regulator/consumer.h> 24 24 #include "stmpe.h" 25 25 26 + /** 27 + * struct stmpe_platform_data - STMPE platform data 28 + * @id: device id to distinguish between multiple STMPEs on the same board 29 + * @blocks: bitmask of blocks to enable (use STMPE_BLOCK_*) 30 + * @irq_trigger: IRQ trigger to use for the interrupt to the host 31 + * @autosleep: bool to enable/disable stmpe autosleep 32 + * @autosleep_timeout: inactivity timeout in milliseconds for autosleep 33 + * @irq_over_gpio: true if gpio is used to get irq 34 + * @irq_gpio: gpio number over which irq will be requested (significant only if 35 + * irq_over_gpio is true) 36 + */ 37 + struct stmpe_platform_data { 38 + int id; 39 + unsigned int blocks; 40 + unsigned int irq_trigger; 41 + bool autosleep; 42 + bool irq_over_gpio; 43 + int irq_gpio; 44 + int autosleep_timeout; 45 + }; 46 + 26 47 static int __stmpe_enable(struct stmpe *stmpe, unsigned int blocks) 27 48 { 28 49 return stmpe->variant->enable(stmpe, blocks, true); ··· 1208 1187 /* Called from client specific probe routines */ 1209 1188 int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum) 1210 1189 { 1211 - struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev); 1190 + struct stmpe_platform_data *pdata; 1212 1191 struct device_node *np = ci->dev->of_node; 1213 1192 struct stmpe *stmpe; 1214 1193 int ret; 1215 1194 1216 - if (!pdata) { 1217 - if (!np) 1218 - return -EINVAL; 1195 + pdata = devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL); 1196 + if (!pdata) 1197 + return -ENOMEM; 1219 1198 1220 - pdata = devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL); 1221 - if (!pdata) 1222 - return -ENOMEM; 1199 + stmpe_of_probe(pdata, np); 1223 1200 1224 - stmpe_of_probe(pdata, np); 1225 - 1226 - if (of_find_property(np, "interrupts", NULL) == NULL) 1227 - ci->irq = -1; 1228 - } 1201 + if (of_find_property(np, "interrupts", NULL) == NULL) 1202 + ci->irq = -1; 1229 1203 1230 1204 stmpe = devm_kzalloc(ci->dev, sizeof(struct stmpe), GFP_KERNEL); 1231 1205 if (!stmpe)
+56 -79
drivers/mfd/ti_am335x_tscadc.c
··· 27 27 28 28 #include <linux/mfd/ti_am335x_tscadc.h> 29 29 30 - static unsigned int tscadc_readl(struct ti_tscadc_dev *tsadc, unsigned int reg) 31 - { 32 - unsigned int val; 33 - 34 - regmap_read(tsadc->regmap_tscadc, reg, &val); 35 - return val; 36 - } 37 - 38 - static void tscadc_writel(struct ti_tscadc_dev *tsadc, unsigned int reg, 39 - unsigned int val) 40 - { 41 - regmap_write(tsadc->regmap_tscadc, reg, val); 42 - } 43 - 44 30 static const struct regmap_config tscadc_regmap_config = { 45 31 .name = "ti_tscadc", 46 32 .reg_bits = 32, ··· 34 48 .val_bits = 32, 35 49 }; 36 50 37 - void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val) 51 + void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tscadc, u32 val) 38 52 { 39 53 unsigned long flags; 40 54 41 - spin_lock_irqsave(&tsadc->reg_lock, flags); 42 - tsadc->reg_se_cache |= val; 43 - if (tsadc->adc_waiting) 44 - wake_up(&tsadc->reg_se_wait); 45 - else if (!tsadc->adc_in_use) 46 - tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache); 55 + spin_lock_irqsave(&tscadc->reg_lock, flags); 56 + tscadc->reg_se_cache |= val; 57 + if (tscadc->adc_waiting) 58 + wake_up(&tscadc->reg_se_wait); 59 + else if (!tscadc->adc_in_use) 60 + regmap_write(tscadc->regmap, REG_SE, tscadc->reg_se_cache); 47 61 48 - spin_unlock_irqrestore(&tsadc->reg_lock, flags); 62 + spin_unlock_irqrestore(&tscadc->reg_lock, flags); 49 63 } 50 64 EXPORT_SYMBOL_GPL(am335x_tsc_se_set_cache); 51 65 52 - static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc) 66 + static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tscadc) 53 67 { 54 68 DEFINE_WAIT(wait); 55 69 u32 reg; 56 70 57 - reg = tscadc_readl(tsadc, REG_ADCFSM); 71 + regmap_read(tscadc->regmap, REG_ADCFSM, &reg); 58 72 if (reg & SEQ_STATUS) { 59 - tsadc->adc_waiting = true; 60 - prepare_to_wait(&tsadc->reg_se_wait, &wait, 73 + tscadc->adc_waiting = true; 74 + prepare_to_wait(&tscadc->reg_se_wait, &wait, 61 75 TASK_UNINTERRUPTIBLE); 62 - spin_unlock_irq(&tsadc->reg_lock); 76 + spin_unlock_irq(&tscadc->reg_lock); 63 77 64 78 schedule(); 65 79 66 - spin_lock_irq(&tsadc->reg_lock); 67 - finish_wait(&tsadc->reg_se_wait, &wait); 80 + spin_lock_irq(&tscadc->reg_lock); 81 + finish_wait(&tscadc->reg_se_wait, &wait); 68 82 69 83 /* 70 84 * Sequencer should either be idle or 71 85 * busy applying the charge step. 72 86 */ 73 - reg = tscadc_readl(tsadc, REG_ADCFSM); 87 + regmap_read(tscadc->regmap, REG_ADCFSM, &reg); 74 88 WARN_ON((reg & SEQ_STATUS) && !(reg & CHARGE_STEP)); 75 - tsadc->adc_waiting = false; 89 + tscadc->adc_waiting = false; 76 90 } 77 - tsadc->adc_in_use = true; 91 + tscadc->adc_in_use = true; 78 92 } 79 93 80 - void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val) 94 + void am335x_tsc_se_set_once(struct ti_tscadc_dev *tscadc, u32 val) 81 95 { 82 - spin_lock_irq(&tsadc->reg_lock); 83 - am335x_tscadc_need_adc(tsadc); 96 + spin_lock_irq(&tscadc->reg_lock); 97 + am335x_tscadc_need_adc(tscadc); 84 98 85 - tscadc_writel(tsadc, REG_SE, val); 86 - spin_unlock_irq(&tsadc->reg_lock); 99 + regmap_write(tscadc->regmap, REG_SE, val); 100 + spin_unlock_irq(&tscadc->reg_lock); 87 101 } 88 102 EXPORT_SYMBOL_GPL(am335x_tsc_se_set_once); 89 103 90 - void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc) 104 + void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tscadc) 91 105 { 92 106 unsigned long flags; 93 107 94 - spin_lock_irqsave(&tsadc->reg_lock, flags); 95 - tsadc->adc_in_use = false; 96 - tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache); 97 - spin_unlock_irqrestore(&tsadc->reg_lock, flags); 108 + spin_lock_irqsave(&tscadc->reg_lock, flags); 109 + tscadc->adc_in_use = false; 110 + regmap_write(tscadc->regmap, REG_SE, tscadc->reg_se_cache); 111 + spin_unlock_irqrestore(&tscadc->reg_lock, flags); 98 112 } 99 113 EXPORT_SYMBOL_GPL(am335x_tsc_se_adc_done); 100 114 101 - void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val) 115 + void am335x_tsc_se_clr(struct ti_tscadc_dev *tscadc, u32 val) 102 116 { 103 117 unsigned long flags; 104 118 105 - spin_lock_irqsave(&tsadc->reg_lock, flags); 106 - tsadc->reg_se_cache &= ~val; 107 - tscadc_writel(tsadc, REG_SE, tsadc->reg_se_cache); 108 - spin_unlock_irqrestore(&tsadc->reg_lock, flags); 119 + spin_lock_irqsave(&tscadc->reg_lock, flags); 120 + tscadc->reg_se_cache &= ~val; 121 + regmap_write(tscadc->regmap, REG_SE, tscadc->reg_se_cache); 122 + spin_unlock_irqrestore(&tscadc->reg_lock, flags); 109 123 } 110 124 EXPORT_SYMBOL_GPL(am335x_tsc_se_clr); 111 125 112 - static void tscadc_idle_config(struct ti_tscadc_dev *config) 126 + static void tscadc_idle_config(struct ti_tscadc_dev *tscadc) 113 127 { 114 128 unsigned int idleconfig; 115 129 116 130 idleconfig = STEPCONFIG_YNN | STEPCONFIG_INM_ADCREFM | 117 131 STEPCONFIG_INP_ADCREFM | STEPCONFIG_YPN; 118 132 119 - tscadc_writel(config, REG_IDLECONFIG, idleconfig); 133 + regmap_write(tscadc->regmap, REG_IDLECONFIG, idleconfig); 120 134 } 121 135 122 136 static int ti_tscadc_probe(struct platform_device *pdev) ··· 168 182 } 169 183 170 184 /* Allocate memory for device */ 171 - tscadc = devm_kzalloc(&pdev->dev, 172 - sizeof(struct ti_tscadc_dev), GFP_KERNEL); 185 + tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL); 173 186 if (!tscadc) { 174 187 dev_err(&pdev->dev, "failed to allocate memory.\n"); 175 188 return -ENOMEM; ··· 187 202 if (IS_ERR(tscadc->tscadc_base)) 188 203 return PTR_ERR(tscadc->tscadc_base); 189 204 190 - tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev, 205 + tscadc->regmap = devm_regmap_init_mmio(&pdev->dev, 191 206 tscadc->tscadc_base, &tscadc_regmap_config); 192 - if (IS_ERR(tscadc->regmap_tscadc)) { 207 + if (IS_ERR(tscadc->regmap)) { 193 208 dev_err(&pdev->dev, "regmap init failed\n"); 194 - err = PTR_ERR(tscadc->regmap_tscadc); 209 + err = PTR_ERR(tscadc->regmap); 195 210 goto ret; 196 211 } 197 212 ··· 221 236 222 237 /* TSCADC_CLKDIV needs to be configured to the value minus 1 */ 223 238 tscadc->clk_div--; 224 - tscadc_writel(tscadc, REG_CLKDIV, tscadc->clk_div); 239 + regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); 225 240 226 241 /* Set the control register bits */ 227 242 ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 228 - tscadc_writel(tscadc, REG_CTRL, ctrl); 243 + regmap_write(tscadc->regmap, REG_CTRL, ctrl); 229 244 230 245 /* Set register bits for Idle Config Mode */ 231 246 if (tsc_wires > 0) { ··· 239 254 240 255 /* Enable the TSC module enable bit */ 241 256 ctrl |= CNTRLREG_TSCSSENB; 242 - tscadc_writel(tscadc, REG_CTRL, ctrl); 257 + regmap_write(tscadc->regmap, REG_CTRL, ctrl); 243 258 244 259 tscadc->used_cells = 0; 245 260 tscadc->tsc_cell = -1; ··· 285 300 { 286 301 struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev); 287 302 288 - tscadc_writel(tscadc, REG_SE, 0x00); 303 + regmap_write(tscadc->regmap, REG_SE, 0x00); 289 304 290 305 pm_runtime_put_sync(&pdev->dev); 291 306 pm_runtime_disable(&pdev->dev); ··· 295 310 return 0; 296 311 } 297 312 298 - #ifdef CONFIG_PM 299 - static int tscadc_suspend(struct device *dev) 313 + static int __maybe_unused tscadc_suspend(struct device *dev) 300 314 { 301 - struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(dev); 315 + struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 302 316 303 - tscadc_writel(tscadc_dev, REG_SE, 0x00); 317 + regmap_write(tscadc->regmap, REG_SE, 0x00); 304 318 pm_runtime_put_sync(dev); 305 319 306 320 return 0; 307 321 } 308 322 309 - static int tscadc_resume(struct device *dev) 323 + static int __maybe_unused tscadc_resume(struct device *dev) 310 324 { 311 - struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(dev); 325 + struct ti_tscadc_dev *tscadc = dev_get_drvdata(dev); 312 326 u32 ctrl; 313 327 314 328 pm_runtime_get_sync(dev); 315 329 316 330 /* context restore */ 317 331 ctrl = CNTRLREG_STEPCONFIGWRT | CNTRLREG_STEPID; 318 - tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 332 + regmap_write(tscadc->regmap, REG_CTRL, ctrl); 319 333 320 - if (tscadc_dev->tsc_cell != -1) { 321 - if (tscadc_dev->tsc_wires == 5) 334 + if (tscadc->tsc_cell != -1) { 335 + if (tscadc->tsc_wires == 5) 322 336 ctrl |= CNTRLREG_5WIRE | CNTRLREG_TSCENB; 323 337 else 324 338 ctrl |= CNTRLREG_4WIRE | CNTRLREG_TSCENB; 325 - tscadc_idle_config(tscadc_dev); 339 + tscadc_idle_config(tscadc); 326 340 } 327 341 ctrl |= CNTRLREG_TSCSSENB; 328 - tscadc_writel(tscadc_dev, REG_CTRL, ctrl); 342 + regmap_write(tscadc->regmap, REG_CTRL, ctrl); 329 343 330 - tscadc_writel(tscadc_dev, REG_CLKDIV, tscadc_dev->clk_div); 344 + regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); 331 345 332 346 return 0; 333 347 } 334 348 335 - static const struct dev_pm_ops tscadc_pm_ops = { 336 - .suspend = tscadc_suspend, 337 - .resume = tscadc_resume, 338 - }; 339 - #define TSCADC_PM_OPS (&tscadc_pm_ops) 340 - #else 341 - #define TSCADC_PM_OPS NULL 342 - #endif 349 + static SIMPLE_DEV_PM_OPS(tscadc_pm_ops, tscadc_suspend, tscadc_resume); 343 350 344 351 static const struct of_device_id ti_tscadc_dt_ids[] = { 345 352 { .compatible = "ti,am3359-tscadc", }, ··· 342 365 static struct platform_driver ti_tscadc_driver = { 343 366 .driver = { 344 367 .name = "ti_am3359-tscadc", 345 - .pm = TSCADC_PM_OPS, 368 + .pm = &tscadc_pm_ops, 346 369 .of_match_table = ti_tscadc_dt_ids, 347 370 }, 348 371 .probe = ti_tscadc_probe,
+2 -2
drivers/mfd/tps6507x.c
··· 105 105 } 106 106 107 107 static const struct i2c_device_id tps6507x_i2c_id[] = { 108 - { "tps6507x", 0 }, 109 - { } 108 + { "tps6507x", 0 }, 109 + { } 110 110 }; 111 111 MODULE_DEVICE_TABLE(i2c, tps6507x_i2c_id); 112 112
+13 -15
drivers/mfd/twl-core.c
··· 622 622 twl = &twl_priv->twl_modules[sid]; 623 623 624 624 pdev = platform_device_alloc(name, num); 625 - if (!pdev) { 626 - dev_dbg(&twl->client->dev, "can't alloc dev\n"); 627 - status = -ENOMEM; 628 - goto err; 629 - } 625 + if (!pdev) 626 + return ERR_PTR(-ENOMEM); 630 627 631 628 pdev->dev.parent = &twl->client->dev; 632 629 ··· 631 634 status = platform_device_add_data(pdev, pdata, pdata_len); 632 635 if (status < 0) { 633 636 dev_dbg(&pdev->dev, "can't add platform_data\n"); 634 - goto err; 637 + goto put_device; 635 638 } 636 639 } 637 640 ··· 644 647 status = platform_device_add_resources(pdev, r, irq1 ? 2 : 1); 645 648 if (status < 0) { 646 649 dev_dbg(&pdev->dev, "can't add irqs\n"); 647 - goto err; 650 + goto put_device; 648 651 } 649 652 } 650 653 651 654 status = platform_device_add(pdev); 652 - if (status == 0) 653 - device_init_wakeup(&pdev->dev, can_wakeup); 655 + if (status) 656 + goto put_device; 654 657 655 - err: 656 - if (status < 0) { 657 - platform_device_put(pdev); 658 - dev_err(&twl->client->dev, "can't add %s dev\n", name); 659 - return ERR_PTR(status); 660 - } 658 + device_init_wakeup(&pdev->dev, can_wakeup); 659 + 661 660 return &pdev->dev; 661 + 662 + put_device: 663 + platform_device_put(pdev); 664 + dev_err(&twl->client->dev, "failed to add device %s\n", name); 665 + return ERR_PTR(status); 662 666 } 663 667 664 668 static inline struct device *add_child(unsigned mod_no, const char *name,
+29 -12
drivers/mfd/twl6040.c
··· 323 323 324 324 /* Default PLL configuration after power up */ 325 325 twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL; 326 - twl6040->sysclk = 19200000; 327 - twl6040->mclk = 32768; 326 + twl6040->sysclk_rate = 19200000; 328 327 } else { 329 328 /* already powered-down */ 330 329 if (!twl6040->power_count) { ··· 351 352 regcache_cache_only(twl6040->regmap, true); 352 353 regcache_mark_dirty(twl6040->regmap); 353 354 354 - twl6040->sysclk = 0; 355 - twl6040->mclk = 0; 355 + twl6040->sysclk_rate = 0; 356 + 357 + if (twl6040->pll == TWL6040_SYSCLK_SEL_HPPLL) { 358 + clk_disable_unprepare(twl6040->mclk); 359 + twl6040->mclk_rate = 0; 360 + } 356 361 357 362 clk_disable_unprepare(twl6040->clk32k); 358 363 } ··· 380 377 381 378 /* Force full reconfiguration when switching between PLL */ 382 379 if (pll_id != twl6040->pll) { 383 - twl6040->sysclk = 0; 384 - twl6040->mclk = 0; 380 + twl6040->sysclk_rate = 0; 381 + twl6040->mclk_rate = 0; 385 382 } 386 383 387 384 switch (pll_id) { 388 385 case TWL6040_SYSCLK_SEL_LPPLL: 389 386 /* low-power PLL divider */ 390 387 /* Change the sysclk configuration only if it has been canged */ 391 - if (twl6040->sysclk != freq_out) { 388 + if (twl6040->sysclk_rate != freq_out) { 392 389 switch (freq_out) { 393 390 case 17640000: 394 391 lppllctl |= TWL6040_LPLLFIN; ··· 430 427 ret = -EINVAL; 431 428 goto pll_out; 432 429 } 430 + 431 + clk_disable_unprepare(twl6040->mclk); 433 432 break; 434 433 case TWL6040_SYSCLK_SEL_HPPLL: 435 434 /* high-performance PLL can provide only 19.2 MHz */ ··· 442 437 goto pll_out; 443 438 } 444 439 445 - if (twl6040->mclk != freq_in) { 440 + if (twl6040->mclk_rate != freq_in) { 446 441 hppllctl &= ~TWL6040_MCLK_MSK; 447 442 448 443 switch (freq_in) { ··· 473 468 goto pll_out; 474 469 } 475 470 471 + /* When switching to HPPLL, enable the mclk first */ 472 + if (pll_id != twl6040->pll) 473 + clk_prepare_enable(twl6040->mclk); 476 474 /* 477 475 * enable clock slicer to ensure input waveform is 478 476 * square ··· 491 483 lppllctl &= ~TWL6040_LPLLENA; 492 484 twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, 493 485 lppllctl); 486 + 487 + twl6040->mclk_rate = freq_in; 494 488 } 495 489 break; 496 490 default: ··· 501 491 goto pll_out; 502 492 } 503 493 504 - twl6040->sysclk = freq_out; 505 - twl6040->mclk = freq_in; 494 + twl6040->sysclk_rate = freq_out; 506 495 twl6040->pll = pll_id; 507 496 508 497 pll_out: ··· 521 512 522 513 unsigned int twl6040_get_sysclk(struct twl6040 *twl6040) 523 514 { 524 - return twl6040->sysclk; 515 + return twl6040->sysclk_rate; 525 516 } 526 517 EXPORT_SYMBOL(twl6040_get_sysclk); 527 518 ··· 664 655 if (IS_ERR(twl6040->clk32k)) { 665 656 if (PTR_ERR(twl6040->clk32k) == -EPROBE_DEFER) 666 657 return -EPROBE_DEFER; 667 - dev_info(&client->dev, "clk32k is not handled\n"); 658 + dev_dbg(&client->dev, "clk32k is not handled\n"); 668 659 twl6040->clk32k = NULL; 660 + } 661 + 662 + twl6040->mclk = devm_clk_get(&client->dev, "mclk"); 663 + if (IS_ERR(twl6040->mclk)) { 664 + if (PTR_ERR(twl6040->mclk) == -EPROBE_DEFER) 665 + return -EPROBE_DEFER; 666 + dev_dbg(&client->dev, "mclk is not handled\n"); 667 + twl6040->mclk = NULL; 669 668 } 670 669 671 670 twl6040->supplies[0].supply = "vio";
+85
include/linux/mfd/altera-a10sr.h
··· 1 + /* 2 + * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * You should have received a copy of the GNU General Public License along with 14 + * this program. If not, see <http://www.gnu.org/licenses/>. 15 + * 16 + * Declarations for Altera Arria10 MAX5 System Resource Chip 17 + * 18 + * Adapted from DA9052 19 + */ 20 + 21 + #ifndef __MFD_ALTERA_A10SR_H 22 + #define __MFD_ALTERA_A10SR_H 23 + 24 + #include <linux/completion.h> 25 + #include <linux/list.h> 26 + #include <linux/mfd/core.h> 27 + #include <linux/regmap.h> 28 + #include <linux/slab.h> 29 + 30 + /* Write registers are always on even addresses */ 31 + #define WRITE_REG_MASK 0xFE 32 + /* Odd registers are always on odd addresses */ 33 + #define READ_REG_MASK 0x01 34 + 35 + #define ALTR_A10SR_BITS_PER_REGISTER 8 36 + /* 37 + * To find the correct register, we divide the input GPIO by 38 + * the number of GPIO in each register. We then need to multiply 39 + * by 2 because the reads are at odd addresses. 40 + */ 41 + #define ALTR_A10SR_REG_OFFSET(X) (((X) / ALTR_A10SR_BITS_PER_REGISTER) << 1) 42 + #define ALTR_A10SR_REG_BIT(X) ((X) % ALTR_A10SR_BITS_PER_REGISTER) 43 + #define ALTR_A10SR_REG_BIT_CHG(X, Y) ((X) << ALTR_A10SR_REG_BIT(Y)) 44 + #define ALTR_A10SR_REG_BIT_MASK(X) (1 << ALTR_A10SR_REG_BIT(X)) 45 + 46 + /* Arria10 System Controller Register Defines */ 47 + #define ALTR_A10SR_NOP 0x00 /* No Change */ 48 + #define ALTR_A10SR_VERSION_READ 0x00 /* MAX5 Version Read */ 49 + 50 + #define ALTR_A10SR_LED_REG 0x02 /* LED - Upper 4 bits */ 51 + /* LED register Bit Definitions */ 52 + #define ALTR_A10SR_LED_VALID_SHIFT 4 /* LED - Upper 4 bits valid */ 53 + #define ALTR_A10SR_OUT_VALID_RANGE_LO ALTR_A10SR_LED_VALID_SHIFT 54 + #define ALTR_A10SR_OUT_VALID_RANGE_HI 7 55 + 56 + #define ALTR_A10SR_PBDSW_REG 0x04 /* PB & DIP SW - Input only */ 57 + #define ALTR_A10SR_PBDSW_IRQ_REG 0x06 /* PB & DIP SW Flag Clear */ 58 + /* Pushbutton & DIP Switch Bit Definitions */ 59 + #define ALTR_A10SR_IN_VALID_RANGE_LO 8 60 + #define ALTR_A10SR_IN_VALID_RANGE_HI 15 61 + 62 + #define ALTR_A10SR_PWR_GOOD1_REG 0x08 /* Power Good1 Read */ 63 + #define ALTR_A10SR_PWR_GOOD2_REG 0x0A /* Power Good2 Read */ 64 + #define ALTR_A10SR_PWR_GOOD3_REG 0x0C /* Power Good3 Read */ 65 + #define ALTR_A10SR_FMCAB_REG 0x0E /* FMCA/B & PCIe Pwr Enable */ 66 + #define ALTR_A10SR_HPS_RST_REG 0x10 /* HPS Reset */ 67 + #define ALTR_A10SR_USB_QSPI_REG 0x12 /* USB, BQSPI, FILE Reset */ 68 + #define ALTR_A10SR_SFPA_REG 0x14 /* SFPA Control Reg */ 69 + #define ALTR_A10SR_SFPB_REG 0x16 /* SFPB Control Reg */ 70 + #define ALTR_A10SR_I2C_M_REG 0x18 /* I2C Master Select */ 71 + #define ALTR_A10SR_WARM_RST_REG 0x1A /* HPS Warm Reset */ 72 + #define ALTR_A10SR_WR_KEY_REG 0x1C /* HPS Warm Reset Key */ 73 + #define ALTR_A10SR_PMBUS_REG 0x1E /* HPS PM Bus */ 74 + 75 + /** 76 + * struct altr_a10sr - Altera Max5 MFD device private data structure 77 + * @dev: : this device 78 + * @regmap: the regmap assigned to the parent device. 79 + */ 80 + struct altr_a10sr { 81 + struct device *dev; 82 + struct regmap *regmap; 83 + }; 84 + 85 + #endif /* __MFD_ALTERA_A10SR_H */
-6
include/linux/mfd/arizona/registers.h
··· 856 856 #define ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE 0xB38 857 857 #define ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE 0xB40 858 858 #define ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE 0xB48 859 - #define ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE 0xB60 860 - #define ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE 0xB68 861 - #define ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE 0xB30 862 - #define ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE 0xB38 863 - #define ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE 0xB40 864 - #define ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE 0xB48 865 859 #define ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE 0xB50 866 860 #define ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE 0xB58 867 861 #define ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE 0xB60
+17 -8
include/linux/mfd/hi655x-pmic.h
··· 34 34 #define PMU_VER_START 0x10 35 35 #define PMU_VER_END 0x38 36 36 37 - #define RESERVE_INT BIT(7) 38 - #define PWRON_D20R_INT BIT(6) 39 - #define PWRON_D20F_INT BIT(5) 40 - #define PWRON_D4SR_INT BIT(4) 41 - #define VSYS_6P0_D200UR_INT BIT(3) 42 - #define VSYS_UV_D3R_INT BIT(2) 43 - #define VSYS_2P5_R_INT BIT(1) 44 - #define OTMP_D1R_INT BIT(0) 37 + #define RESERVE_INT 7 38 + #define PWRON_D20R_INT 6 39 + #define PWRON_D20F_INT 5 40 + #define PWRON_D4SR_INT 4 41 + #define VSYS_6P0_D200UR_INT 3 42 + #define VSYS_UV_D3R_INT 2 43 + #define VSYS_2P5_R_INT 1 44 + #define OTMP_D1R_INT 0 45 + 46 + #define RESERVE_INT_MASK BIT(RESERVE_INT) 47 + #define PWRON_D20R_INT_MASK BIT(PWRON_D20R_INT) 48 + #define PWRON_D20F_INT_MASK BIT(PWRON_D20F_INT) 49 + #define PWRON_D4SR_INT_MASK BIT(PWRON_D4SR_INT) 50 + #define VSYS_6P0_D200UR_INT_MASK BIT(VSYS_6P0_D200UR_INT) 51 + #define VSYS_UV_D3R_INT_MASK BIT(VSYS_UV_D3R_INT) 52 + #define VSYS_2P5_R_INT_MASK BIT(VSYS_2P5_R_INT) 53 + #define OTMP_D1R_INT_MASK BIT(OTMP_D1R_INT) 45 54 46 55 struct hi655x_pmic { 47 56 struct resource *res;
+1 -21
include/linux/mfd/stmpe.h
··· 62 62 63 63 struct stmpe_variant_info; 64 64 struct stmpe_client_info; 65 + struct stmpe_platform_data; 65 66 66 67 /** 67 68 * struct stmpe - STMPE MFD structure ··· 117 116 extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); 118 117 119 118 #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) 120 - 121 - /** 122 - * struct stmpe_platform_data - STMPE platform data 123 - * @id: device id to distinguish between multiple STMPEs on the same board 124 - * @blocks: bitmask of blocks to enable (use STMPE_BLOCK_*) 125 - * @irq_trigger: IRQ trigger to use for the interrupt to the host 126 - * @autosleep: bool to enable/disable stmpe autosleep 127 - * @autosleep_timeout: inactivity timeout in milliseconds for autosleep 128 - * @irq_over_gpio: true if gpio is used to get irq 129 - * @irq_gpio: gpio number over which irq will be requested (significant only if 130 - * irq_over_gpio is true) 131 - */ 132 - struct stmpe_platform_data { 133 - int id; 134 - unsigned int blocks; 135 - unsigned int irq_trigger; 136 - bool autosleep; 137 - bool irq_over_gpio; 138 - int irq_gpio; 139 - int autosleep_timeout; 140 - }; 141 119 142 120 #endif
+1 -1
include/linux/mfd/ti_am335x_tscadc.h
··· 153 153 154 154 struct ti_tscadc_dev { 155 155 struct device *dev; 156 - struct regmap *regmap_tscadc; 156 + struct regmap *regmap; 157 157 void __iomem *tscadc_base; 158 158 int irq; 159 159 int used_cells; /* 1-2 */
+3 -2
include/linux/mfd/twl6040.h
··· 226 226 struct regmap_irq_chip_data *irq_data; 227 227 struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */ 228 228 struct clk *clk32k; 229 + struct clk *mclk; 229 230 struct mutex mutex; 230 231 struct mutex irq_mutex; 231 232 struct mfd_cell cells[TWL6040_CELLS]; ··· 238 237 239 238 /* PLL configuration */ 240 239 int pll; 241 - unsigned int sysclk; 242 - unsigned int mclk; 240 + unsigned int sysclk_rate; 241 + unsigned int mclk_rate; 243 242 244 243 unsigned int irq; 245 244 unsigned int irq_ready;