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

Merge tag 'mfd-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
"New Drivers:
- Add support for ROHM BD71828 PMICs and GPIOs
- Add support for Qualcomm Aqstic Audio Codecs WCD9340 and WCD9341

New Device Support:
- Add support for BD71828 to BD70528 RTC driver
- Add support for Intel's Jasper Lake to LPSS PCI

New Functionality:
- Add support for Power Key to ROHM BD71828
- Add support for Clocks to ROHM BD71828
- Add support for GPIOs to Dialog DA9062
- Add support for USB PD Notify to ChromiumOS EC
- Allow callers to specify args when requesting regmap lookup; syscon

Fix-ups:
- Improve error handling and sanity checking; atmel-hlcdc, dln2
- Device Tree support/documentation; bd71828, da9062, xylon,logicvc,
ab8500, max14577, atmel-usart
- Match devices using platform IDs; bd7xxxx
- Refactor BD718x7 regulator component; bd718x7-regulator
- Use standard interfaces/helpers; syscon, sm501
- Trivial (whitespace, spelling, etc); ab8500-core, Kconfig
- Remove unused code; db8500-prcmu, tqmx86
- Wait until boot has finished before accessing registers;
madera-core
- Provide missing register value defaults; cs47l15-tables
- Allow more time for hardware to reset; madera-core

Bug Fixes:
- Fix erroneous register values; rohm-bd70528
- Fix register volatility; axp20x, rn5t618
- Fix Kconfig dependencies; MFD_MAX77650
- Fix incorrect compatible string; da9062-core
- Fix syscon_regmap_lookup_by_phandle_args() stub; syscon"

* tag 'mfd-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (41 commits)
mfd: syscon: Fix syscon_regmap_lookup_by_phandle_args() dummy
mfd: wcd934x: Add support to wcd9340/wcd9341 codec
mfd: syscon: Add arguments support for syscon reference
mfd: rn5t618: Mark ADC control register volatile
dt-bindings: atmel-usart: Add microchip,sam9x60-{usart, dbgu}
dt-bindings: atmel-usart: Remove wildcard
mfd: cros_ec: Add cros-usbpd-notify subdevice
mfd: da9062: Fix watchdog compatible string
mfd: madera: Allow more time for hardware reset
mfd: cs47l15: Add missing register default
mfd: madera: Wait for boot done before accessing any other registers
mfd: Kconfig: Rename Samsung to lowercase
mfd: tqmx86: remove set but not used variable 'i2c_ien'
mfd: dbx500-prcmu: Drop DSI pll clock functions
mfd: dbx500-prcmu: Drop set_display_clocks()
mfd: max77650: Select REGMAP_IRQ in Kconfig
mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile
mfd: ab8500: Fix ab8500-clk typo
mfd: intel-lpss: Add Intel Jasper Lake PCI IDs
dt-bindings: mfd: max14577: Add reference to max14040_battery.txt descriptions
...

+2809 -415
+52
Documentation/devicetree/bindings/leds/rohm,bd71828-leds.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/rohm,bd71828-leds.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ROHM BD71828 Power Management Integrated Circuit LED driver 8 + 9 + maintainers: 10 + - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> 11 + 12 + description: | 13 + This module is part of the ROHM BD71828 MFD device. For more details 14 + see Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml. 15 + 16 + The LED controller is represented as a sub-node of the PMIC node on the device 17 + tree. 18 + 19 + The device has two LED outputs referred as GRNLED and AMBLED in data-sheet. 20 + 21 + select: false 22 + 23 + properties: 24 + compatible: 25 + const: rohm,bd71828-leds 26 + 27 + patternProperties: 28 + "^led-[1-2]$": 29 + type: object 30 + description: 31 + Properties for a single LED. 32 + properties: 33 + #allOf: 34 + #- $ref: "common.yaml#" 35 + rohm,led-compatible: 36 + description: LED identification string 37 + allOf: 38 + - $ref: "/schemas/types.yaml#/definitions/string" 39 + - enum: 40 + - bd71828-ambled 41 + - bd71828-grnled 42 + function: 43 + description: 44 + Purpose of LED as defined in dt-bindings/leds/common.h 45 + $ref: "/schemas/types.yaml#/definitions/string" 46 + color: 47 + description: 48 + LED colour as defined in dt-bindings/leds/common.h 49 + $ref: "/schemas/types.yaml#/definitions/uint32" 50 + 51 + required: 52 + - compatible
+5 -3
Documentation/devicetree/bindings/mfd/ab8500.txt
··· 1 1 * AB8500 Multi-Functional Device (MFD) 2 2 3 3 Required parent device properties: 4 - - compatible : contains "stericsson,ab8500"; 4 + - compatible : contains "stericsson,ab8500" or "stericsson,ab8505"; 5 5 - interrupts : contains the IRQ line for the AB8500 6 6 - interrupt-controller : describes the AB8500 as an Interrupt Controller (has its own domain) 7 7 - #interrupt-cells : should be 2, for 2-cell format ··· 49 49 : CH_WD_EXP : : Charger watchdog detected 50 50 ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter 51 51 SW_CONV_END : : 52 - ab8500-gpio : : : GPIO Controller 52 + ab8500-gpio : : : GPIO Controller (AB8500) 53 + ab8505-gpio : : : GPIO Controller (AB8505) 53 54 ab8500-ponkey : ONKEY_DBF : : Power-on Key 54 55 ONKEY_DBR : : 55 56 ab8500-pwm : : : Pulse Width Modulator 56 - ab8500-regulator : : : Regulators 57 + ab8500-regulator : : : Regulators (AB8500) 58 + ab8505-regulator : : : Regulators (AB8505) 57 59 ab8500-rtc : 60S : : Real Time Clock 58 60 : ALARM : : 59 61 ab8500-sysctrl : : : System Control
+7 -4
Documentation/devicetree/bindings/mfd/atmel-usart.txt
··· 1 1 * Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART) 2 2 3 3 Required properties for USART: 4 - - compatible: Should be "atmel,<chip>-usart" or "atmel,<chip>-dbgu" 5 - The compatible <chip> indicated will be the first SoC to support an 6 - additional mode or an USART new feature. 7 - For the dbgu UART, use "atmel,<chip>-dbgu", "atmel,<chip>-usart" 4 + - compatible: Should be one of the following: 5 + - "atmel,at91rm9200-usart" 6 + - "atmel,at91sam9260-usart" 7 + - "microchip,sam9x60-usart" 8 + - "atmel,at91rm9200-dbgu", "atmel,at91rm9200-usart" 9 + - "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart" 10 + - "microchip,sam9x60-dbgu", "microchip,sam9x60-usart" 8 11 - reg: Should contain registers location and length 9 12 - interrupts: Should contain interrupt 10 13 - clock-names: tuple listing input clock names.
+10
Documentation/devicetree/bindings/mfd/da9062.txt
··· 13 13 da9062-onkey : : On Key 14 14 da9062-watchdog : : Watchdog Timer 15 15 da9062-thermal : : Thermal 16 + da9062-gpio : : GPIOs 16 17 17 18 The DA9061 PMIC consists of: 18 19 ··· 38 37 39 38 See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for 40 39 further information on IRQ bindings. 40 + 41 + Optional properties: 42 + 43 + - gpio-controller : Marks the device as a gpio controller. 44 + - #gpio-cells : Should be two. The first cell is the pin number and the 45 + second cell is used to specify the gpio polarity. 46 + 47 + See Documentation/devicetree/bindings/gpio/gpio.txt for further information on 48 + GPIO bindings. 41 49 42 50 Sub-nodes: 43 51
+2
Documentation/devicetree/bindings/mfd/max14577.txt
··· 5 5 interfaced to host controller using I2C. 6 6 7 7 MAX77836 additionally contains PMIC (with two LDO regulators) and Fuel Gauge. 8 + For the description of Fuel Gauge low SOC alert interrupt see: 9 + ../power/supply/max17040_battery.txt 8 10 9 11 10 12 Required properties:
+193
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/rohm,bd71828-pmic.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ROHM BD71828 Power Management Integrated Circuit bindings 8 + 9 + maintainers: 10 + - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> 11 + 12 + description: | 13 + BD71828GW is a single-chip power management IC for battery-powered portable 14 + devices. The IC integrates 7 buck converters, 7 LDOs, and a 1500 mA 15 + single-cell linear charger. Also included is a Coulomb counter, a real-time 16 + clock (RTC), and a 32.768 kHz clock gate. 17 + 18 + properties: 19 + compatible: 20 + const: rohm,bd71828 21 + 22 + reg: 23 + description: 24 + I2C slave address. 25 + maxItems: 1 26 + 27 + interrupts: 28 + maxItems: 1 29 + 30 + gpio-controller: true 31 + 32 + "#gpio-cells": 33 + const: 2 34 + description: | 35 + The first cell is the pin number and the second cell is used to specify 36 + flags. See ../gpio/gpio.txt for more information. 37 + 38 + clocks: 39 + maxItems: 1 40 + 41 + "#clock-cells": 42 + const: 0 43 + 44 + rohm,charger-sense-resistor-ohms: 45 + minimum: 10000000 46 + maximum: 50000000 47 + description: | 48 + BD71827 and BD71828 have SAR ADC for measuring charging currents. 49 + External sense resistor (RSENSE in data sheet) should be used. If some 50 + other but 30MOhm resistor is used the resistance value should be given 51 + here in Ohms. 52 + 53 + regulators: 54 + $ref: ../regulator/rohm,bd71828-regulator.yaml 55 + description: 56 + List of child nodes that specify the regulators. 57 + 58 + leds: 59 + $ref: ../leds/rohm,bd71828-leds.yaml 60 + 61 + gpio-reserved-ranges: 62 + description: | 63 + Usage of BD71828 GPIO pins can be changed via OTP. This property can be 64 + used to mark the pins which should not be configured for GPIO. Please see 65 + the ../gpio/gpio.txt for more information. 66 + 67 + required: 68 + - compatible 69 + - reg 70 + - interrupts 71 + - clocks 72 + - "#clock-cells" 73 + - regulators 74 + - gpio-controller 75 + - "#gpio-cells" 76 + 77 + examples: 78 + - | 79 + #include <dt-bindings/interrupt-controller/irq.h> 80 + #include <dt-bindings/leds/common.h> 81 + i2c { 82 + #address-cells = <1>; 83 + #size-cells = <0>; 84 + pmic: pmic@4b { 85 + compatible = "rohm,bd71828"; 86 + reg = <0x4b>; 87 + 88 + interrupt-parent = <&gpio1>; 89 + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; 90 + 91 + clocks = <&osc 0>; 92 + #clock-cells = <0>; 93 + clock-output-names = "bd71828-32k-out"; 94 + 95 + gpio-controller; 96 + #gpio-cells = <2>; 97 + gpio-reserved-ranges = <0 1>, <2 1>; 98 + 99 + rohm,charger-sense-resistor-ohms = <10000000>; 100 + 101 + regulators { 102 + buck1: BUCK1 { 103 + regulator-name = "buck1"; 104 + regulator-min-microvolt = <500000>; 105 + regulator-max-microvolt = <2000000>; 106 + regulator-ramp-delay = <2500>; 107 + }; 108 + buck2: BUCK2 { 109 + regulator-name = "buck2"; 110 + regulator-min-microvolt = <500000>; 111 + regulator-max-microvolt = <2000000>; 112 + regulator-ramp-delay = <2500>; 113 + }; 114 + buck3: BUCK3 { 115 + regulator-name = "buck3"; 116 + regulator-min-microvolt = <1200000>; 117 + regulator-max-microvolt = <2000000>; 118 + }; 119 + buck4: BUCK4 { 120 + regulator-name = "buck4"; 121 + regulator-min-microvolt = <1000000>; 122 + regulator-max-microvolt = <1800000>; 123 + }; 124 + buck5: BUCK5 { 125 + regulator-name = "buck5"; 126 + regulator-min-microvolt = <2500000>; 127 + regulator-max-microvolt = <3300000>; 128 + }; 129 + buck6: BUCK6 { 130 + regulator-name = "buck6"; 131 + regulator-min-microvolt = <500000>; 132 + regulator-max-microvolt = <2000000>; 133 + regulator-ramp-delay = <2500>; 134 + }; 135 + buck7: BUCK7 { 136 + regulator-name = "buck7"; 137 + regulator-min-microvolt = <500000>; 138 + regulator-max-microvolt = <2000000>; 139 + regulator-ramp-delay = <2500>; 140 + }; 141 + ldo1: LDO1 { 142 + regulator-name = "ldo1"; 143 + regulator-min-microvolt = <800000>; 144 + regulator-max-microvolt = <3300000>; 145 + }; 146 + ldo2: LDO2 { 147 + regulator-name = "ldo2"; 148 + regulator-min-microvolt = <800000>; 149 + regulator-max-microvolt = <3300000>; 150 + }; 151 + ldo3: LDO3 { 152 + regulator-name = "ldo3"; 153 + regulator-min-microvolt = <800000>; 154 + regulator-max-microvolt = <3300000>; 155 + }; 156 + ldo4: LDO4 { 157 + regulator-name = "ldo4"; 158 + regulator-min-microvolt = <800000>; 159 + regulator-max-microvolt = <3300000>; 160 + }; 161 + ldo5: LDO5 { 162 + regulator-name = "ldo5"; 163 + regulator-min-microvolt = <800000>; 164 + regulator-max-microvolt = <3300000>; 165 + }; 166 + ldo6: LDO6 { 167 + regulator-name = "ldo6"; 168 + regulator-min-microvolt = <1800000>; 169 + regulator-max-microvolt = <1800000>; 170 + }; 171 + ldo7_reg: LDO7 { 172 + regulator-name = "ldo7"; 173 + regulator-min-microvolt = <800000>; 174 + regulator-max-microvolt = <3300000>; 175 + }; 176 + }; 177 + 178 + leds { 179 + compatible = "rohm,bd71828-leds"; 180 + 181 + led-1 { 182 + rohm,led-compatible = "bd71828-grnled"; 183 + function = LED_FUNCTION_INDICATOR; 184 + color = <LED_COLOR_ID_GREEN>; 185 + }; 186 + led-2 { 187 + rohm,led-compatible = "bd71828-ambled"; 188 + function = LED_FUNCTION_CHARGING; 189 + color = <LED_COLOR_ID_AMBER>; 190 + }; 191 + }; 192 + }; 193 + };
+3 -3
drivers/clk/Kconfig
··· 305 305 Support for Marvell MMP2 and MMP3 SoC clocks 306 306 307 307 config COMMON_CLK_BD718XX 308 - tristate "Clock driver for ROHM BD718x7 PMIC" 309 - depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528 308 + tristate "Clock driver for 32K clk gates on ROHM PMICs" 309 + depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528 || MFD_ROHM_BD71828 310 310 help 311 - This driver supports ROHM BD71837, ROHM BD71847 and 311 + This driver supports ROHM BD71837, ROHM BD71847, ROHM BD71828 and 312 312 ROHM BD70528 PMICs clock gates. 313 313 314 314 config COMMON_CLK_FIXED_MMIO
+39 -11
drivers/clk/clk-bd718x7.c
··· 7 7 #include <linux/err.h> 8 8 #include <linux/platform_device.h> 9 9 #include <linux/slab.h> 10 - #include <linux/mfd/rohm-bd718x7.h> 11 - #include <linux/mfd/rohm-bd70528.h> 10 + #include <linux/mfd/rohm-generic.h> 12 11 #include <linux/clk-provider.h> 13 12 #include <linux/clkdev.h> 14 13 #include <linux/regmap.h> 14 + 15 + /* clk control registers */ 16 + /* BD70528 */ 17 + #define BD70528_REG_OUT32K 0x2c 18 + /* BD71828 */ 19 + #define BD71828_REG_OUT32K 0x4B 20 + /* BD71837 and BD71847 */ 21 + #define BD718XX_REG_OUT32K 0x2E 22 + 23 + /* 24 + * BD71837, BD71847, BD70528 and BD71828 all use bit [0] to clk output control 25 + */ 26 + #define CLK_OUT_EN_MASK BIT(0) 27 + 15 28 16 29 struct bd718xx_clk { 17 30 struct clk_hw hw; ··· 34 21 struct rohm_regmap_dev *mfd; 35 22 }; 36 23 37 - static int bd71837_clk_set(struct clk_hw *hw, int status) 24 + static int bd71837_clk_set(struct bd718xx_clk *c, unsigned int status) 38 25 { 39 - struct bd718xx_clk *c = container_of(hw, struct bd718xx_clk, hw); 40 - 41 26 return regmap_update_bits(c->mfd->regmap, c->reg, c->mask, status); 42 27 } 43 28 ··· 44 33 int rv; 45 34 struct bd718xx_clk *c = container_of(hw, struct bd718xx_clk, hw); 46 35 47 - rv = bd71837_clk_set(hw, 0); 36 + rv = bd71837_clk_set(c, 0); 48 37 if (rv) 49 38 dev_dbg(&c->pdev->dev, "Failed to disable 32K clk (%d)\n", rv); 50 39 } 51 40 52 41 static int bd71837_clk_enable(struct clk_hw *hw) 53 42 { 54 - return bd71837_clk_set(hw, 1); 43 + struct bd718xx_clk *c = container_of(hw, struct bd718xx_clk, hw); 44 + 45 + return bd71837_clk_set(c, 0xffffffff); 55 46 } 56 47 57 48 static int bd71837_clk_is_enabled(struct clk_hw *hw) ··· 87 74 .name = "bd718xx-32k-out", 88 75 .ops = &bd71837_clk_ops, 89 76 }; 77 + enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; 90 78 91 79 c = devm_kzalloc(&pdev->dev, sizeof(*c), GFP_KERNEL); 92 80 if (!c) ··· 101 87 dev_err(&pdev->dev, "No parent clk found\n"); 102 88 return -EINVAL; 103 89 } 104 - switch (mfd->chip_type) { 90 + switch (chip) { 105 91 case ROHM_CHIP_TYPE_BD71837: 106 92 case ROHM_CHIP_TYPE_BD71847: 107 93 c->reg = BD718XX_REG_OUT32K; 108 - c->mask = BD718XX_OUT32K_EN; 94 + c->mask = CLK_OUT_EN_MASK; 95 + break; 96 + case ROHM_CHIP_TYPE_BD71828: 97 + c->reg = BD71828_REG_OUT32K; 98 + c->mask = CLK_OUT_EN_MASK; 109 99 break; 110 100 case ROHM_CHIP_TYPE_BD70528: 111 - c->reg = BD70528_REG_CLK_OUT; 112 - c->mask = BD70528_CLK_OUT_EN_MASK; 101 + c->reg = BD70528_REG_OUT32K; 102 + c->mask = CLK_OUT_EN_MASK; 113 103 break; 114 104 default: 115 105 dev_err(&pdev->dev, "Unknown clk chip\n"); ··· 139 121 return rval; 140 122 } 141 123 124 + static const struct platform_device_id bd718x7_clk_id[] = { 125 + { "bd71837-clk", ROHM_CHIP_TYPE_BD71837 }, 126 + { "bd71847-clk", ROHM_CHIP_TYPE_BD71847 }, 127 + { "bd70528-clk", ROHM_CHIP_TYPE_BD70528 }, 128 + { "bd71828-clk", ROHM_CHIP_TYPE_BD71828 }, 129 + { }, 130 + }; 131 + MODULE_DEVICE_TABLE(platform, bd718x7_clk_id); 132 + 142 133 static struct platform_driver bd71837_clk = { 143 134 .driver = { 144 135 .name = "bd718xx-clk", 145 136 }, 146 137 .probe = bd71837_clk_probe, 138 + .id_table = bd718x7_clk_id, 147 139 }; 148 140 149 141 module_platform_driver(bd71837_clk);
+12
drivers/gpio/Kconfig
··· 1035 1035 This driver can also be built as a module. If so, the module 1036 1036 will be called gpio-bd70528. 1037 1037 1038 + config GPIO_BD71828 1039 + tristate "ROHM BD71828 GPIO support" 1040 + depends on MFD_ROHM_BD71828 1041 + help 1042 + Support for GPIOs on ROHM BD71828 PMIC. There are three GPIOs 1043 + available on the ROHM PMIC in total. The GPIOs are limited to 1044 + outputs only and pins must be configured to GPIO outputs by 1045 + OTP. Enable this only if you want to use these pins as outputs. 1046 + 1047 + This driver can also be built as a module. If so, the module 1048 + will be called gpio-bd71828. 1049 + 1038 1050 config GPIO_BD9571MWV 1039 1051 tristate "ROHM BD9571 GPIO support" 1040 1052 depends on MFD_BD9571MWV
+1
drivers/gpio/Makefile
··· 37 37 obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o 38 38 obj-$(CONFIG_GPIO_BCM_XGS_IPROC) += gpio-xgs-iproc.o 39 39 obj-$(CONFIG_GPIO_BD70528) += gpio-bd70528.o 40 + obj-$(CONFIG_GPIO_BD71828) += gpio-bd71828.o 40 41 obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o 41 42 obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o 42 43 obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o
+159
drivers/gpio/gpio-bd71828.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // Copyright (C) 2018 ROHM Semiconductors 3 + 4 + #include <linux/gpio/driver.h> 5 + #include <linux/mfd/rohm-bd71828.h> 6 + #include <linux/module.h> 7 + #include <linux/platform_device.h> 8 + #include <linux/regmap.h> 9 + 10 + #define GPIO_OUT_REG(off) (BD71828_REG_GPIO_CTRL1 + (off)) 11 + #define HALL_GPIO_OFFSET 3 12 + 13 + /* 14 + * These defines can be removed when 15 + * "gpio: Add definition for GPIO direction" 16 + * (9208b1e77d6e8e9776f34f46ef4079ecac9c3c25 in GPIO tree) gets merged, 17 + */ 18 + #ifndef GPIO_LINE_DIRECTION_IN 19 + #define GPIO_LINE_DIRECTION_IN 1 20 + #define GPIO_LINE_DIRECTION_OUT 0 21 + #endif 22 + 23 + struct bd71828_gpio { 24 + struct rohm_regmap_dev chip; 25 + struct gpio_chip gpio; 26 + }; 27 + 28 + static void bd71828_gpio_set(struct gpio_chip *chip, unsigned int offset, 29 + int value) 30 + { 31 + int ret; 32 + struct bd71828_gpio *bdgpio = gpiochip_get_data(chip); 33 + u8 val = (value) ? BD71828_GPIO_OUT_HI : BD71828_GPIO_OUT_LO; 34 + 35 + /* 36 + * The HALL input pin can only be used as input. If this is the pin 37 + * we are dealing with - then we are done 38 + */ 39 + if (offset == HALL_GPIO_OFFSET) 40 + return; 41 + 42 + ret = regmap_update_bits(bdgpio->chip.regmap, GPIO_OUT_REG(offset), 43 + BD71828_GPIO_OUT_MASK, val); 44 + if (ret) 45 + dev_err(bdgpio->chip.dev, "Could not set gpio to %d\n", value); 46 + } 47 + 48 + static int bd71828_gpio_get(struct gpio_chip *chip, unsigned int offset) 49 + { 50 + int ret; 51 + unsigned int val; 52 + struct bd71828_gpio *bdgpio = gpiochip_get_data(chip); 53 + 54 + if (offset == HALL_GPIO_OFFSET) 55 + ret = regmap_read(bdgpio->chip.regmap, BD71828_REG_IO_STAT, 56 + &val); 57 + else 58 + ret = regmap_read(bdgpio->chip.regmap, GPIO_OUT_REG(offset), 59 + &val); 60 + if (!ret) 61 + ret = (val & BD71828_GPIO_OUT_MASK); 62 + 63 + return ret; 64 + } 65 + 66 + static int bd71828_gpio_set_config(struct gpio_chip *chip, unsigned int offset, 67 + unsigned long config) 68 + { 69 + struct bd71828_gpio *bdgpio = gpiochip_get_data(chip); 70 + 71 + if (offset == HALL_GPIO_OFFSET) 72 + return -ENOTSUPP; 73 + 74 + switch (pinconf_to_config_param(config)) { 75 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 76 + return regmap_update_bits(bdgpio->chip.regmap, 77 + GPIO_OUT_REG(offset), 78 + BD71828_GPIO_DRIVE_MASK, 79 + BD71828_GPIO_OPEN_DRAIN); 80 + case PIN_CONFIG_DRIVE_PUSH_PULL: 81 + return regmap_update_bits(bdgpio->chip.regmap, 82 + GPIO_OUT_REG(offset), 83 + BD71828_GPIO_DRIVE_MASK, 84 + BD71828_GPIO_PUSH_PULL); 85 + default: 86 + break; 87 + } 88 + return -ENOTSUPP; 89 + } 90 + 91 + static int bd71828_get_direction(struct gpio_chip *chip, unsigned int offset) 92 + { 93 + /* 94 + * Pin usage is selected by OTP data. We can't read it runtime. Hence 95 + * we trust that if the pin is not excluded by "gpio-reserved-ranges" 96 + * the OTP configuration is set to OUT. (Other pins but HALL input pin 97 + * on BD71828 can't really be used for general purpose input - input 98 + * states are used for specific cases like regulator control or 99 + * PMIC_ON_REQ. 100 + */ 101 + if (offset == HALL_GPIO_OFFSET) 102 + return GPIO_LINE_DIRECTION_IN; 103 + 104 + return GPIO_LINE_DIRECTION_OUT; 105 + } 106 + 107 + static int bd71828_probe(struct platform_device *pdev) 108 + { 109 + struct bd71828_gpio *bdgpio; 110 + struct rohm_regmap_dev *bd71828; 111 + 112 + bd71828 = dev_get_drvdata(pdev->dev.parent); 113 + if (!bd71828) { 114 + dev_err(&pdev->dev, "No MFD driver data\n"); 115 + return -EINVAL; 116 + } 117 + 118 + bdgpio = devm_kzalloc(&pdev->dev, sizeof(*bdgpio), 119 + GFP_KERNEL); 120 + if (!bdgpio) 121 + return -ENOMEM; 122 + 123 + bdgpio->chip.dev = &pdev->dev; 124 + bdgpio->gpio.parent = pdev->dev.parent; 125 + bdgpio->gpio.label = "bd71828-gpio"; 126 + bdgpio->gpio.owner = THIS_MODULE; 127 + bdgpio->gpio.get_direction = bd71828_get_direction; 128 + bdgpio->gpio.set_config = bd71828_gpio_set_config; 129 + bdgpio->gpio.can_sleep = true; 130 + bdgpio->gpio.get = bd71828_gpio_get; 131 + bdgpio->gpio.set = bd71828_gpio_set; 132 + bdgpio->gpio.base = -1; 133 + 134 + /* 135 + * See if we need some implementation to mark some PINs as 136 + * not controllable based on DT info or if core can handle 137 + * "gpio-reserved-ranges" and exclude them from control 138 + */ 139 + bdgpio->gpio.ngpio = 4; 140 + bdgpio->gpio.of_node = pdev->dev.parent->of_node; 141 + bdgpio->chip.regmap = bd71828->regmap; 142 + 143 + return devm_gpiochip_add_data(&pdev->dev, &bdgpio->gpio, 144 + bdgpio); 145 + } 146 + 147 + static struct platform_driver bd71828_gpio = { 148 + .driver = { 149 + .name = "bd71828-gpio" 150 + }, 151 + .probe = bd71828_probe, 152 + }; 153 + 154 + module_platform_driver(bd71828_gpio); 155 + 156 + MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>"); 157 + MODULE_DESCRIPTION("BD71828 voltage regulator driver"); 158 + MODULE_LICENSE("GPL"); 159 + MODULE_ALIAS("platform:bd71828-gpio");
+29 -1
drivers/mfd/Kconfig
··· 758 758 depends on OF || COMPILE_TEST 759 759 select MFD_CORE 760 760 select REGMAP_I2C 761 + select REGMAP_IRQ 761 762 help 762 763 Say Y here to add support for Maxim Semiconductor MAX77650 and 763 764 MAX77651 Power Management ICs. This is the core multifunction ··· 1066 1065 functionality of the device. 1067 1066 1068 1067 config MFD_SEC_CORE 1069 - tristate "SAMSUNG Electronics PMIC Series Support" 1068 + tristate "Samsung Electronics PMIC Series Support" 1070 1069 depends on I2C=y 1071 1070 select MFD_CORE 1072 1071 select REGMAP_I2C ··· 1907 1906 10 bits SAR ADC for battery temperature monitor and 1S battery 1908 1907 charger. 1909 1908 1909 + config MFD_ROHM_BD71828 1910 + tristate "ROHM BD71828 Power Management IC" 1911 + depends on I2C=y 1912 + depends on OF 1913 + select REGMAP_I2C 1914 + select REGMAP_IRQ 1915 + select MFD_CORE 1916 + help 1917 + Select this option to get support for the ROHM BD71828 Power 1918 + Management IC. BD71828GW is a single-chip power management IC for 1919 + battery-powered portable devices. The IC integrates 7 buck 1920 + converters, 7 LDOs, and a 1500 mA single-cell linear charger. 1921 + Also included is a Coulomb counter, a real-time clock (RTC), and 1922 + a 32.768 kHz clock gate. 1923 + 1910 1924 config MFD_STM32_LPTIMER 1911 1925 tristate "Support for STM32 Low-Power Timer" 1912 1926 depends on (ARCH_STM32 && OF) || COMPILE_TEST ··· 1975 1959 This driver provides common support for accessing the device, 1976 1960 additional drivers must be enabled in order to use the functionality 1977 1961 of the device. 1962 + 1963 + config MFD_WCD934X 1964 + tristate "Support for WCD9340/WCD9341 Codec" 1965 + depends on SLIMBUS 1966 + select REGMAP 1967 + select REGMAP_SLIMBUS 1968 + select REGMAP_IRQ 1969 + select MFD_CORE 1970 + help 1971 + Support for the Qualcomm WCD9340/WCD9341 Codec. 1972 + This driver provides common support WCD934x audio codec and its 1973 + associated Pin Controller, Soundwire Controller and Audio codec. 1978 1974 1979 1975 menu "Multimedia Capabilities Port drivers" 1980 1976 depends on ARCH_SA1100
+2
drivers/mfd/Makefile
··· 58 58 ifeq ($(CONFIG_MFD_CS47L24),y) 59 59 obj-$(CONFIG_MFD_ARIZONA) += cs47l24-tables.o 60 60 endif 61 + obj-$(CONFIG_MFD_WCD934X) += wcd934x.o 61 62 obj-$(CONFIG_MFD_WM8400) += wm8400-core.o 62 63 wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o 63 64 wm831x-objs += wm831x-auxadc.o ··· 253 252 obj-$(CONFIG_MFD_SC27XX_PMIC) += sprd-sc27xx-spi.o 254 253 obj-$(CONFIG_RAVE_SP_CORE) += rave-sp.o 255 254 obj-$(CONFIG_MFD_ROHM_BD70528) += rohm-bd70528.o 255 + obj-$(CONFIG_MFD_ROHM_BD71828) += rohm-bd71828.o 256 256 obj-$(CONFIG_MFD_ROHM_BD718XX) += rohm-bd718x7.o 257 257 obj-$(CONFIG_MFD_STMFX) += stmfx.o 258 258
+14 -4
drivers/mfd/ab8500-core.c
··· 631 631 NULL, NULL, 0, 0, "stericsson,ab8500-ext-regulator"), 632 632 OF_MFD_CELL("ab8500-regulator", 633 633 NULL, NULL, 0, 0, "stericsson,ab8500-regulator"), 634 - OF_MFD_CELL("abx500-clk", 635 - NULL, NULL, 0, 0, "stericsson,abx500-clk"), 634 + OF_MFD_CELL("ab8500-clk", 635 + NULL, NULL, 0, 0, "stericsson,ab8500-clk"), 636 636 OF_MFD_CELL("ab8500-gpadc", 637 637 NULL, NULL, 0, 0, "stericsson,ab8500-gpadc"), 638 638 OF_MFD_CELL("ab8500-rtc", ··· 718 718 #ifdef CONFIG_DEBUG_FS 719 719 { 720 720 .name = "ab8500-debug", 721 + .of_compatible = "stericsson,ab8500-debug", 721 722 }, 722 723 #endif 723 724 { 724 725 .name = "ab8500-sysctrl", 726 + .of_compatible = "stericsson,ab8500-sysctrl", 725 727 }, 726 728 { 727 729 .name = "ab8500-regulator", 730 + .of_compatible = "stericsson,ab8505-regulator", 728 731 }, 729 732 { 730 733 .name = "abx500-clk", 731 - .of_compatible = "stericsson,abx500-clk", 734 + .of_compatible = "stericsson,ab8500-clk", 732 735 }, 733 736 { 734 737 .name = "ab8500-gpadc", ··· 739 736 }, 740 737 { 741 738 .name = "ab8500-rtc", 739 + .of_compatible = "stericsson,ab8500-rtc", 742 740 }, 743 741 { 744 742 .name = "ab8500-acc-det", 743 + .of_compatible = "stericsson,ab8500-acc-det", 745 744 }, 746 745 { 747 746 .name = "ab8500-poweron-key", 747 + .of_compatible = "stericsson,ab8500-poweron-key", 748 748 }, 749 749 { 750 750 .name = "ab8500-pwm", 751 + .of_compatible = "stericsson,ab8500-pwm", 751 752 .id = 1, 752 753 }, 753 754 { 754 755 .name = "pinctrl-ab8505", 756 + .of_compatible = "stericsson,ab8505-gpio", 755 757 }, 756 758 { 757 759 .name = "ab8500-usb", 760 + .of_compatible = "stericsson,ab8500-usb", 758 761 }, 759 762 { 760 763 .name = "ab8500-codec", 764 + .of_compatible = "stericsson,ab8500-codec", 761 765 }, 762 766 { 763 767 .name = "ab-iddet", ··· 1286 1276 1287 1277 static const struct platform_device_id ab8500_id[] = { 1288 1278 { "ab8500-core", AB8500_VERSION_AB8500 }, 1289 - { "ab8505-i2c", AB8500_VERSION_AB8505 }, 1279 + { "ab8505-core", AB8500_VERSION_AB8505 }, 1290 1280 { "ab9540-i2c", AB8500_VERSION_AB9540 }, 1291 1281 { "ab8540-i2c", AB8500_VERSION_AB8540 }, 1292 1282 { }
+13 -3
drivers/mfd/atmel-hlcdc.c
··· 19 19 20 20 struct atmel_hlcdc_regmap { 21 21 void __iomem *regs; 22 + struct device *dev; 22 23 }; 23 24 24 25 static const struct mfd_cell atmel_hlcdc_cells[] = { ··· 40 39 41 40 if (reg <= ATMEL_HLCDC_DIS) { 42 41 u32 status; 42 + int ret; 43 43 44 - readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR, 45 - status, !(status & ATMEL_HLCDC_SIP), 46 - 1, 100); 44 + ret = readl_poll_timeout_atomic(hregmap->regs + ATMEL_HLCDC_SR, 45 + status, 46 + !(status & ATMEL_HLCDC_SIP), 47 + 1, 100); 48 + if (ret) { 49 + dev_err(hregmap->dev, 50 + "Timeout! Clock domain synchronization is in progress!\n"); 51 + return ret; 52 + } 47 53 } 48 54 49 55 writel(val, hregmap->regs + reg); ··· 97 89 hregmap->regs = devm_ioremap_resource(dev, res); 98 90 if (IS_ERR(hregmap->regs)) 99 91 return PTR_ERR(hregmap->regs); 92 + 93 + hregmap->dev = &pdev->dev; 100 94 101 95 hlcdc->irq = platform_get_irq(pdev, 0); 102 96 if (hlcdc->irq < 0)
+1 -1
drivers/mfd/axp20x.c
··· 126 126 static const struct regmap_range axp288_volatile_ranges[] = { 127 127 regmap_reg_range(AXP20X_PWR_INPUT_STATUS, AXP288_POWER_REASON), 128 128 regmap_reg_range(AXP288_BC_GLOBAL, AXP288_BC_GLOBAL), 129 - regmap_reg_range(AXP288_BC_DET_STAT, AXP288_BC_DET_STAT), 129 + regmap_reg_range(AXP288_BC_DET_STAT, AXP20X_VBUS_IPSOUT_MGMT), 130 130 regmap_reg_range(AXP20X_CHRG_BAK_CTRL, AXP20X_CHRG_BAK_CTRL), 131 131 regmap_reg_range(AXP20X_IRQ1_EN, AXP20X_IPSOUT_V_HIGH_L), 132 132 regmap_reg_range(AXP20X_TIMER_CTRL, AXP20X_TIMER_CTRL),
+22
drivers/mfd/cros_ec_dev.c
··· 5 5 * Copyright (C) 2014 Google, Inc. 6 6 */ 7 7 8 + #include <linux/kconfig.h> 8 9 #include <linux/mfd/core.h> 9 10 #include <linux/mfd/cros_ec.h> 10 11 #include <linux/module.h> ··· 86 85 static const struct mfd_cell cros_usbpd_charger_cells[] = { 87 86 { .name = "cros-usbpd-charger", }, 88 87 { .name = "cros-usbpd-logger", }, 88 + }; 89 + 90 + static const struct mfd_cell cros_usbpd_notify_cells[] = { 91 + { .name = "cros-usbpd-notify", }, 89 92 }; 90 93 91 94 static const struct cros_feature_to_cells cros_subdevices[] = { ··· 203 198 dev_err(ec->dev, 204 199 "failed to add %s subdevice: %d\n", 205 200 cros_subdevices[i].mfd_cells->name, 201 + retval); 202 + } 203 + } 204 + 205 + /* 206 + * The PD notifier driver cell is separate since it only needs to be 207 + * explicitly added on platforms that don't have the PD notifier ACPI 208 + * device entry defined. 209 + */ 210 + if (IS_ENABLED(CONFIG_OF)) { 211 + if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) { 212 + retval = mfd_add_hotplug_devices(ec->dev, 213 + cros_usbpd_notify_cells, 214 + ARRAY_SIZE(cros_usbpd_notify_cells)); 215 + if (retval) 216 + dev_err(ec->dev, 217 + "failed to add PD notify devices: %d\n", 206 218 retval); 207 219 } 208 220 }
+1
drivers/mfd/cs47l15-tables.c
··· 112 112 { 0x000001dd, 0x0011 }, /* R477 (0x1DD) - FLL AO Control 11 */ 113 113 { 0x00000218, 0x00e6 }, /* R536 (0x218) - Mic Bias Ctrl 1 */ 114 114 { 0x0000021c, 0x0222 }, /* R540 (0x21C) - Mic Bias Ctrl 5 */ 115 + { 0x00000293, 0x0080 }, /* R659 (0x293) - Accessory Detect Mode 1 */ 115 116 { 0x00000299, 0x0000 }, /* R665 (0x299) - Headphone Detect 0 */ 116 117 { 0x0000029b, 0x0000 }, /* R667 (0x29B) - Headphone Detect 1 */ 117 118 { 0x000002a2, 0x0010 }, /* R674 (0x2A2) - Mic Detect 1 Control 0 */
+16 -2
drivers/mfd/da9062-core.c
··· 233 233 DEFINE_RES_NAMED(DA9062_IRQ_ONKEY, 1, "ONKEY", IORESOURCE_IRQ), 234 234 }; 235 235 236 + static struct resource da9062_gpio_resources[] = { 237 + DEFINE_RES_NAMED(DA9062_IRQ_GPI0, 1, "GPI0", IORESOURCE_IRQ), 238 + DEFINE_RES_NAMED(DA9062_IRQ_GPI1, 1, "GPI1", IORESOURCE_IRQ), 239 + DEFINE_RES_NAMED(DA9062_IRQ_GPI2, 1, "GPI2", IORESOURCE_IRQ), 240 + DEFINE_RES_NAMED(DA9062_IRQ_GPI3, 1, "GPI3", IORESOURCE_IRQ), 241 + DEFINE_RES_NAMED(DA9062_IRQ_GPI4, 1, "GPI4", IORESOURCE_IRQ), 242 + }; 243 + 236 244 static const struct mfd_cell da9062_devs[] = { 237 245 { 238 246 .name = "da9062-core", ··· 256 248 .name = "da9062-watchdog", 257 249 .num_resources = ARRAY_SIZE(da9062_wdt_resources), 258 250 .resources = da9062_wdt_resources, 259 - .of_compatible = "dlg,da9062-wdt", 251 + .of_compatible = "dlg,da9062-watchdog", 260 252 }, 261 253 { 262 254 .name = "da9062-thermal", ··· 274 266 .name = "da9062-onkey", 275 267 .num_resources = ARRAY_SIZE(da9062_onkey_resources), 276 268 .resources = da9062_onkey_resources, 277 - .of_compatible = "dlg,da9062-onkey", 269 + .of_compatible = "dlg,da9062-onkey", 270 + }, 271 + { 272 + .name = "da9062-gpio", 273 + .num_resources = ARRAY_SIZE(da9062_gpio_resources), 274 + .resources = da9062_gpio_resources, 275 + .of_compatible = "dlg,da9062-gpio", 278 276 }, 279 277 }; 280 278
+20 -102
drivers/mfd/db8500-prcmu.c
··· 542 542 } 543 543 }; 544 544 545 - 546 - /* 547 - * Used by MCDE to setup all necessary PRCMU registers 548 - */ 549 - #define PRCMU_RESET_DSIPLL 0x00004000 550 - #define PRCMU_UNCLAMP_DSIPLL 0x00400800 551 - 552 - #define PRCMU_CLK_PLL_DIV_SHIFT 0 553 - #define PRCMU_CLK_PLL_SW_SHIFT 5 554 - #define PRCMU_CLK_38 (1 << 9) 555 - #define PRCMU_CLK_38_SRC (1 << 10) 556 - #define PRCMU_CLK_38_DIV (1 << 11) 557 - 558 - /* PLLDIV=12, PLLSW=4 (PLLDDR) */ 559 - #define PRCMU_DSI_CLOCK_SETTING 0x0000008C 560 - 561 - /* DPI 50000000 Hz */ 562 - #define PRCMU_DPI_CLOCK_SETTING ((1 << PRCMU_CLK_PLL_SW_SHIFT) | \ 563 - (16 << PRCMU_CLK_PLL_DIV_SHIFT)) 564 - #define PRCMU_DSI_LP_CLOCK_SETTING 0x00000E00 565 - 566 - /* D=101, N=1, R=4, SELDIV2=0 */ 567 - #define PRCMU_PLLDSI_FREQ_SETTING 0x00040165 568 - 569 - #define PRCMU_ENABLE_PLLDSI 0x00000001 570 - #define PRCMU_DISABLE_PLLDSI 0x00000000 571 - #define PRCMU_RELEASE_RESET_DSS 0x0000400C 572 - #define PRCMU_DSI_PLLOUT_SEL_SETTING 0x00000202 573 - /* ESC clk, div0=1, div1=1, div2=3 */ 574 - #define PRCMU_ENABLE_ESCAPE_CLOCK_DIV 0x07030101 575 - #define PRCMU_DISABLE_ESCAPE_CLOCK_DIV 0x00030101 576 - #define PRCMU_DSI_RESET_SW 0x00000007 577 - 578 - #define PRCMU_PLLDSI_LOCKP_LOCKED 0x3 579 - 580 - int db8500_prcmu_enable_dsipll(void) 581 - { 582 - int i; 583 - 584 - /* Clear DSIPLL_RESETN */ 585 - writel(PRCMU_RESET_DSIPLL, PRCM_APE_RESETN_CLR); 586 - /* Unclamp DSIPLL in/out */ 587 - writel(PRCMU_UNCLAMP_DSIPLL, PRCM_MMIP_LS_CLAMP_CLR); 588 - 589 - /* Set DSI PLL FREQ */ 590 - writel(PRCMU_PLLDSI_FREQ_SETTING, PRCM_PLLDSI_FREQ); 591 - writel(PRCMU_DSI_PLLOUT_SEL_SETTING, PRCM_DSI_PLLOUT_SEL); 592 - /* Enable Escape clocks */ 593 - writel(PRCMU_ENABLE_ESCAPE_CLOCK_DIV, PRCM_DSITVCLK_DIV); 594 - 595 - /* Start DSI PLL */ 596 - writel(PRCMU_ENABLE_PLLDSI, PRCM_PLLDSI_ENABLE); 597 - /* Reset DSI PLL */ 598 - writel(PRCMU_DSI_RESET_SW, PRCM_DSI_SW_RESET); 599 - for (i = 0; i < 10; i++) { 600 - if ((readl(PRCM_PLLDSI_LOCKP) & PRCMU_PLLDSI_LOCKP_LOCKED) 601 - == PRCMU_PLLDSI_LOCKP_LOCKED) 602 - break; 603 - udelay(100); 604 - } 605 - /* Set DSIPLL_RESETN */ 606 - writel(PRCMU_RESET_DSIPLL, PRCM_APE_RESETN_SET); 607 - return 0; 608 - } 609 - 610 - int db8500_prcmu_disable_dsipll(void) 611 - { 612 - /* Disable dsi pll */ 613 - writel(PRCMU_DISABLE_PLLDSI, PRCM_PLLDSI_ENABLE); 614 - /* Disable escapeclock */ 615 - writel(PRCMU_DISABLE_ESCAPE_CLOCK_DIV, PRCM_DSITVCLK_DIV); 616 - return 0; 617 - } 618 - 619 - int db8500_prcmu_set_display_clocks(void) 620 - { 621 - unsigned long flags; 622 - 623 - spin_lock_irqsave(&clk_mgt_lock, flags); 624 - 625 - /* Grab the HW semaphore. */ 626 - while ((readl(PRCM_SEM) & PRCM_SEM_PRCM_SEM) != 0) 627 - cpu_relax(); 628 - 629 - writel(PRCMU_DSI_CLOCK_SETTING, prcmu_base + PRCM_HDMICLK_MGT); 630 - writel(PRCMU_DSI_LP_CLOCK_SETTING, prcmu_base + PRCM_TVCLK_MGT); 631 - writel(PRCMU_DPI_CLOCK_SETTING, prcmu_base + PRCM_LCDCLK_MGT); 632 - 633 - /* Release the HW semaphore. */ 634 - writel(0, PRCM_SEM); 635 - 636 - spin_unlock_irqrestore(&clk_mgt_lock, flags); 637 - 638 - return 0; 639 - } 640 - 641 545 u32 db8500_prcmu_read(unsigned int reg) 642 546 { 643 547 return readl(prcmu_base + reg); ··· 2964 3060 static int db8500_prcmu_register_ab8500(struct device *parent) 2965 3061 { 2966 3062 struct device_node *np; 2967 - struct resource ab8500_resource; 3063 + struct resource ab850x_resource; 2968 3064 const struct mfd_cell ab8500_cell = { 2969 3065 .name = "ab8500-core", 2970 3066 .of_compatible = "stericsson,ab8500", 2971 3067 .id = AB8500_VERSION_AB8500, 2972 - .resources = &ab8500_resource, 3068 + .resources = &ab850x_resource, 2973 3069 .num_resources = 1, 2974 3070 }; 3071 + const struct mfd_cell ab8505_cell = { 3072 + .name = "ab8505-core", 3073 + .of_compatible = "stericsson,ab8505", 3074 + .id = AB8500_VERSION_AB8505, 3075 + .resources = &ab850x_resource, 3076 + .num_resources = 1, 3077 + }; 3078 + const struct mfd_cell *ab850x_cell; 2975 3079 2976 3080 if (!parent->of_node) 2977 3081 return -ENODEV; 2978 3082 2979 3083 /* Look up the device node, sneak the IRQ out of it */ 2980 3084 for_each_child_of_node(parent->of_node, np) { 2981 - if (of_device_is_compatible(np, ab8500_cell.of_compatible)) 3085 + if (of_device_is_compatible(np, ab8500_cell.of_compatible)) { 3086 + ab850x_cell = &ab8500_cell; 2982 3087 break; 3088 + } 3089 + if (of_device_is_compatible(np, ab8505_cell.of_compatible)) { 3090 + ab850x_cell = &ab8505_cell; 3091 + break; 3092 + } 2983 3093 } 2984 3094 if (!np) { 2985 - dev_info(parent, "could not find AB8500 node in the device tree\n"); 3095 + dev_info(parent, "could not find AB850X node in the device tree\n"); 2986 3096 return -ENODEV; 2987 3097 } 2988 - of_irq_to_resource_table(np, &ab8500_resource, 1); 3098 + of_irq_to_resource_table(np, &ab850x_resource, 1); 2989 3099 2990 - return mfd_add_devices(parent, 0, &ab8500_cell, 1, NULL, 0, NULL); 3100 + return mfd_add_devices(parent, 0, ab850x_cell, 1, NULL, 0, NULL); 2991 3101 } 2992 3102 2993 3103 /**
+11 -2
drivers/mfd/dln2.c
··· 722 722 const struct usb_device_id *usb_id) 723 723 { 724 724 struct usb_host_interface *hostif = interface->cur_altsetting; 725 + struct usb_endpoint_descriptor *epin; 726 + struct usb_endpoint_descriptor *epout; 725 727 struct device *dev = &interface->dev; 726 728 struct dln2_dev *dln2; 727 729 int ret; ··· 733 731 hostif->desc.bNumEndpoints < 2) 734 732 return -ENODEV; 735 733 734 + epin = &hostif->endpoint[0].desc; 735 + epout = &hostif->endpoint[1].desc; 736 + if (!usb_endpoint_is_bulk_out(epout)) 737 + return -ENODEV; 738 + if (!usb_endpoint_is_bulk_in(epin)) 739 + return -ENODEV; 740 + 736 741 dln2 = kzalloc(sizeof(*dln2), GFP_KERNEL); 737 742 if (!dln2) 738 743 return -ENOMEM; 739 744 740 - dln2->ep_out = hostif->endpoint[0].desc.bEndpointAddress; 741 - dln2->ep_in = hostif->endpoint[1].desc.bEndpointAddress; 745 + dln2->ep_out = epout->bEndpointAddress; 746 + dln2->ep_in = epin->bEndpointAddress; 742 747 dln2->usb_dev = usb_get_dev(interface_to_usbdev(interface)); 743 748 dln2->interface = interface; 744 749 usb_set_intfdata(interface, dln2);
+13
drivers/mfd/intel-lpss-pci.c
··· 240 240 { PCI_VDEVICE(INTEL, 0x4b79), (kernel_ulong_t)&bxt_i2c_info }, 241 241 { PCI_VDEVICE(INTEL, 0x4b7a), (kernel_ulong_t)&bxt_i2c_info }, 242 242 { PCI_VDEVICE(INTEL, 0x4b7b), (kernel_ulong_t)&bxt_i2c_info }, 243 + /* JSL */ 244 + { PCI_VDEVICE(INTEL, 0x4da8), (kernel_ulong_t)&spt_uart_info }, 245 + { PCI_VDEVICE(INTEL, 0x4da9), (kernel_ulong_t)&spt_uart_info }, 246 + { PCI_VDEVICE(INTEL, 0x4daa), (kernel_ulong_t)&spt_info }, 247 + { PCI_VDEVICE(INTEL, 0x4dab), (kernel_ulong_t)&spt_info }, 248 + { PCI_VDEVICE(INTEL, 0x4daf), (kernel_ulong_t)&spt_uart_info }, 249 + { PCI_VDEVICE(INTEL, 0x4dc5), (kernel_ulong_t)&bxt_i2c_info }, 250 + { PCI_VDEVICE(INTEL, 0x4dc6), (kernel_ulong_t)&bxt_i2c_info }, 251 + { PCI_VDEVICE(INTEL, 0x4de8), (kernel_ulong_t)&bxt_i2c_info }, 252 + { PCI_VDEVICE(INTEL, 0x4de9), (kernel_ulong_t)&bxt_i2c_info }, 253 + { PCI_VDEVICE(INTEL, 0x4dea), (kernel_ulong_t)&bxt_i2c_info }, 254 + { PCI_VDEVICE(INTEL, 0x4deb), (kernel_ulong_t)&bxt_i2c_info }, 255 + { PCI_VDEVICE(INTEL, 0x4dfb), (kernel_ulong_t)&spt_info }, 243 256 /* APL */ 244 257 { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&apl_i2c_info }, 245 258 { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&apl_i2c_info },
+23 -10
drivers/mfd/madera-core.c
··· 35 35 36 36 #define MADERA_32KZ_MCLK2 1 37 37 38 + #define MADERA_RESET_MIN_US 2000 39 + #define MADERA_RESET_MAX_US 3000 40 + 38 41 static const char * const madera_core_supplies[] = { 39 42 "AVDD", 40 43 "DBVDD1", ··· 202 199 #define MADERA_BOOT_POLL_INTERVAL_USEC 5000 203 200 #define MADERA_BOOT_POLL_TIMEOUT_USEC 25000 204 201 205 - static int madera_wait_for_boot(struct madera *madera) 202 + static int madera_wait_for_boot_noack(struct madera *madera) 206 203 { 207 204 ktime_t timeout; 208 205 unsigned int val = 0; ··· 229 226 ret = -ETIMEDOUT; 230 227 } 231 228 229 + return ret; 230 + } 231 + 232 + static int madera_wait_for_boot(struct madera *madera) 233 + { 234 + int ret = madera_wait_for_boot_noack(madera); 235 + 232 236 /* 233 237 * BOOT_DONE defaults to unmasked on boot so we must ack it. 234 238 * Do this even after a timeout to avoid interrupt storms. ··· 259 249 } 260 250 261 251 /* Allow time for internal clocks to startup after reset */ 262 - usleep_range(1000, 2000); 252 + usleep_range(MADERA_RESET_MIN_US, MADERA_RESET_MAX_US); 263 253 264 254 return 0; 265 255 } 266 256 267 257 static void madera_enable_hard_reset(struct madera *madera) 268 258 { 269 - if (!madera->pdata.reset) 270 - return; 271 - 272 259 /* 273 260 * There are many existing out-of-tree users of these codecs that we 274 261 * can't break so preserve the expected behaviour of setting the line ··· 276 269 277 270 static void madera_disable_hard_reset(struct madera *madera) 278 271 { 279 - if (!madera->pdata.reset) 280 - return; 281 - 282 272 gpiod_set_raw_value_cansleep(madera->pdata.reset, 1); 283 - usleep_range(1000, 2000); 273 + 274 + usleep_range(MADERA_RESET_MIN_US, MADERA_RESET_MAX_US); 284 275 } 285 276 286 277 static int __maybe_unused madera_runtime_resume(struct device *dev) ··· 296 291 297 292 regcache_cache_only(madera->regmap, false); 298 293 regcache_cache_only(madera->regmap_32bit, false); 294 + 295 + usleep_range(MADERA_RESET_MIN_US, MADERA_RESET_MAX_US); 299 296 300 297 ret = madera_wait_for_boot(madera); 301 298 if (ret) ··· 552 545 regcache_cache_only(madera->regmap, false); 553 546 regcache_cache_only(madera->regmap_32bit, false); 554 547 548 + ret = madera_wait_for_boot_noack(madera); 549 + if (ret) { 550 + dev_err(madera->dev, "Device failed initial boot: %d\n", ret); 551 + goto err_reset; 552 + } 553 + 555 554 /* 556 555 * Now we can power up and verify that this is a chip we know about 557 556 * before we start doing any writes to its registers. ··· 663 650 664 651 ret = madera_wait_for_boot(madera); 665 652 if (ret) { 666 - dev_err(madera->dev, "Device failed initial boot: %d\n", ret); 653 + dev_err(madera->dev, "Failed to clear boot done: %d\n", ret); 667 654 goto err_reset; 668 655 } 669 656
+1
drivers/mfd/rn5t618.c
··· 26 26 case RN5T618_WATCHDOGCNT: 27 27 case RN5T618_DCIRQ: 28 28 case RN5T618_ILIMDATAH ... RN5T618_AIN0DATAL: 29 + case RN5T618_ADCCNT3: 29 30 case RN5T618_IR_ADC1 ... RN5T618_IR_ADC3: 30 31 case RN5T618_IR_GPR: 31 32 case RN5T618_IR_GPF:
+1 -2
drivers/mfd/rohm-bd70528.c
··· 48 48 * We use BD71837 driver to drive the clock block. Only differences to 49 49 * BD70528 clock gate are the register address and mask. 50 50 */ 51 - { .name = "bd718xx-clk", }, 51 + { .name = "bd70528-clk", }, 52 52 { .name = "bd70528-wdt", }, 53 53 { 54 54 .name = "bd70528-power", ··· 236 236 237 237 dev_set_drvdata(&i2c->dev, &bd70528->chip); 238 238 239 - bd70528->chip.chip_type = ROHM_CHIP_TYPE_BD70528; 240 239 bd70528->chip.regmap = devm_regmap_init_i2c(i2c, &bd70528_regmap); 241 240 if (IS_ERR(bd70528->chip.regmap)) { 242 241 dev_err(&i2c->dev, "Failed to initialize Regmap\n");
+344
drivers/mfd/rohm-bd71828.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // 3 + // Copyright (C) 2019 ROHM Semiconductors 4 + // 5 + // ROHM BD71828 PMIC driver 6 + 7 + #include <linux/gpio_keys.h> 8 + #include <linux/i2c.h> 9 + #include <linux/input.h> 10 + #include <linux/interrupt.h> 11 + #include <linux/ioport.h> 12 + #include <linux/irq.h> 13 + #include <linux/mfd/core.h> 14 + #include <linux/mfd/rohm-bd71828.h> 15 + #include <linux/module.h> 16 + #include <linux/of_device.h> 17 + #include <linux/regmap.h> 18 + #include <linux/types.h> 19 + 20 + static struct gpio_keys_button button = { 21 + .code = KEY_POWER, 22 + .gpio = -1, 23 + .type = EV_KEY, 24 + }; 25 + 26 + static struct gpio_keys_platform_data bd71828_powerkey_data = { 27 + .buttons = &button, 28 + .nbuttons = 1, 29 + .name = "bd71828-pwrkey", 30 + }; 31 + 32 + static const struct resource rtc_irqs[] = { 33 + DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"), 34 + DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC1, "bd71828-rtc-alm-1"), 35 + DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC2, "bd71828-rtc-alm-2"), 36 + }; 37 + 38 + static struct mfd_cell bd71828_mfd_cells[] = { 39 + { .name = "bd71828-pmic", }, 40 + { .name = "bd71828-gpio", }, 41 + { .name = "bd71828-led", .of_compatible = "rohm,bd71828-leds" }, 42 + /* 43 + * We use BD71837 driver to drive the clock block. Only differences to 44 + * BD70528 clock gate are the register address and mask. 45 + */ 46 + { .name = "bd71828-clk", }, 47 + { .name = "bd71827-power", }, 48 + { 49 + .name = "bd71828-rtc", 50 + .resources = rtc_irqs, 51 + .num_resources = ARRAY_SIZE(rtc_irqs), 52 + }, { 53 + .name = "gpio-keys", 54 + .platform_data = &bd71828_powerkey_data, 55 + .pdata_size = sizeof(bd71828_powerkey_data), 56 + }, 57 + }; 58 + 59 + static const struct regmap_range volatile_ranges[] = { 60 + { 61 + .range_min = BD71828_REG_PS_CTRL_1, 62 + .range_max = BD71828_REG_PS_CTRL_1, 63 + }, { 64 + .range_min = BD71828_REG_PS_CTRL_3, 65 + .range_max = BD71828_REG_PS_CTRL_3, 66 + }, { 67 + .range_min = BD71828_REG_RTC_SEC, 68 + .range_max = BD71828_REG_RTC_YEAR, 69 + }, { 70 + /* 71 + * For now make all charger registers volatile because many 72 + * needs to be and because the charger block is not that 73 + * performance critical. 74 + */ 75 + .range_min = BD71828_REG_CHG_STATE, 76 + .range_max = BD71828_REG_CHG_FULL, 77 + }, { 78 + .range_min = BD71828_REG_INT_MAIN, 79 + .range_max = BD71828_REG_IO_STAT, 80 + }, 81 + }; 82 + 83 + static const struct regmap_access_table volatile_regs = { 84 + .yes_ranges = &volatile_ranges[0], 85 + .n_yes_ranges = ARRAY_SIZE(volatile_ranges), 86 + }; 87 + 88 + static struct regmap_config bd71828_regmap = { 89 + .reg_bits = 8, 90 + .val_bits = 8, 91 + .volatile_table = &volatile_regs, 92 + .max_register = BD71828_MAX_REGISTER, 93 + .cache_type = REGCACHE_RBTREE, 94 + }; 95 + 96 + /* 97 + * Mapping of main IRQ register bits to sub-IRQ register offsets so that we can 98 + * access corect sub-IRQ registers based on bits that are set in main IRQ 99 + * register. 100 + */ 101 + 102 + static unsigned int bit0_offsets[] = {11}; /* RTC IRQ */ 103 + static unsigned int bit1_offsets[] = {10}; /* TEMP IRQ */ 104 + static unsigned int bit2_offsets[] = {6, 7, 8, 9}; /* BAT MON IRQ */ 105 + static unsigned int bit3_offsets[] = {5}; /* BAT IRQ */ 106 + static unsigned int bit4_offsets[] = {4}; /* CHG IRQ */ 107 + static unsigned int bit5_offsets[] = {3}; /* VSYS IRQ */ 108 + static unsigned int bit6_offsets[] = {1, 2}; /* DCIN IRQ */ 109 + static unsigned int bit7_offsets[] = {0}; /* BUCK IRQ */ 110 + 111 + static struct regmap_irq_sub_irq_map bd71828_sub_irq_offsets[] = { 112 + REGMAP_IRQ_MAIN_REG_OFFSET(bit0_offsets), 113 + REGMAP_IRQ_MAIN_REG_OFFSET(bit1_offsets), 114 + REGMAP_IRQ_MAIN_REG_OFFSET(bit2_offsets), 115 + REGMAP_IRQ_MAIN_REG_OFFSET(bit3_offsets), 116 + REGMAP_IRQ_MAIN_REG_OFFSET(bit4_offsets), 117 + REGMAP_IRQ_MAIN_REG_OFFSET(bit5_offsets), 118 + REGMAP_IRQ_MAIN_REG_OFFSET(bit6_offsets), 119 + REGMAP_IRQ_MAIN_REG_OFFSET(bit7_offsets), 120 + }; 121 + 122 + static struct regmap_irq bd71828_irqs[] = { 123 + REGMAP_IRQ_REG(BD71828_INT_BUCK1_OCP, 0, BD71828_INT_BUCK1_OCP_MASK), 124 + REGMAP_IRQ_REG(BD71828_INT_BUCK2_OCP, 0, BD71828_INT_BUCK2_OCP_MASK), 125 + REGMAP_IRQ_REG(BD71828_INT_BUCK3_OCP, 0, BD71828_INT_BUCK3_OCP_MASK), 126 + REGMAP_IRQ_REG(BD71828_INT_BUCK4_OCP, 0, BD71828_INT_BUCK4_OCP_MASK), 127 + REGMAP_IRQ_REG(BD71828_INT_BUCK5_OCP, 0, BD71828_INT_BUCK5_OCP_MASK), 128 + REGMAP_IRQ_REG(BD71828_INT_BUCK6_OCP, 0, BD71828_INT_BUCK6_OCP_MASK), 129 + REGMAP_IRQ_REG(BD71828_INT_BUCK7_OCP, 0, BD71828_INT_BUCK7_OCP_MASK), 130 + REGMAP_IRQ_REG(BD71828_INT_PGFAULT, 0, BD71828_INT_PGFAULT_MASK), 131 + /* DCIN1 interrupts */ 132 + REGMAP_IRQ_REG(BD71828_INT_DCIN_DET, 1, BD71828_INT_DCIN_DET_MASK), 133 + REGMAP_IRQ_REG(BD71828_INT_DCIN_RMV, 1, BD71828_INT_DCIN_RMV_MASK), 134 + REGMAP_IRQ_REG(BD71828_INT_CLPS_OUT, 1, BD71828_INT_CLPS_OUT_MASK), 135 + REGMAP_IRQ_REG(BD71828_INT_CLPS_IN, 1, BD71828_INT_CLPS_IN_MASK), 136 + /* DCIN2 interrupts */ 137 + REGMAP_IRQ_REG(BD71828_INT_DCIN_MON_RES, 2, 138 + BD71828_INT_DCIN_MON_RES_MASK), 139 + REGMAP_IRQ_REG(BD71828_INT_DCIN_MON_DET, 2, 140 + BD71828_INT_DCIN_MON_DET_MASK), 141 + REGMAP_IRQ_REG(BD71828_INT_LONGPUSH, 2, BD71828_INT_LONGPUSH_MASK), 142 + REGMAP_IRQ_REG(BD71828_INT_MIDPUSH, 2, BD71828_INT_MIDPUSH_MASK), 143 + REGMAP_IRQ_REG(BD71828_INT_SHORTPUSH, 2, BD71828_INT_SHORTPUSH_MASK), 144 + REGMAP_IRQ_REG(BD71828_INT_PUSH, 2, BD71828_INT_PUSH_MASK), 145 + REGMAP_IRQ_REG(BD71828_INT_WDOG, 2, BD71828_INT_WDOG_MASK), 146 + REGMAP_IRQ_REG(BD71828_INT_SWRESET, 2, BD71828_INT_SWRESET_MASK), 147 + /* Vsys */ 148 + REGMAP_IRQ_REG(BD71828_INT_VSYS_UV_RES, 3, 149 + BD71828_INT_VSYS_UV_RES_MASK), 150 + REGMAP_IRQ_REG(BD71828_INT_VSYS_UV_DET, 3, 151 + BD71828_INT_VSYS_UV_DET_MASK), 152 + REGMAP_IRQ_REG(BD71828_INT_VSYS_LOW_RES, 3, 153 + BD71828_INT_VSYS_LOW_RES_MASK), 154 + REGMAP_IRQ_REG(BD71828_INT_VSYS_LOW_DET, 3, 155 + BD71828_INT_VSYS_LOW_DET_MASK), 156 + REGMAP_IRQ_REG(BD71828_INT_VSYS_HALL_IN, 3, 157 + BD71828_INT_VSYS_HALL_IN_MASK), 158 + REGMAP_IRQ_REG(BD71828_INT_VSYS_HALL_TOGGLE, 3, 159 + BD71828_INT_VSYS_HALL_TOGGLE_MASK), 160 + REGMAP_IRQ_REG(BD71828_INT_VSYS_MON_RES, 3, 161 + BD71828_INT_VSYS_MON_RES_MASK), 162 + REGMAP_IRQ_REG(BD71828_INT_VSYS_MON_DET, 3, 163 + BD71828_INT_VSYS_MON_DET_MASK), 164 + /* Charger */ 165 + REGMAP_IRQ_REG(BD71828_INT_CHG_DCIN_ILIM, 4, 166 + BD71828_INT_CHG_DCIN_ILIM_MASK), 167 + REGMAP_IRQ_REG(BD71828_INT_CHG_TOPOFF_TO_DONE, 4, 168 + BD71828_INT_CHG_TOPOFF_TO_DONE_MASK), 169 + REGMAP_IRQ_REG(BD71828_INT_CHG_WDG_TEMP, 4, 170 + BD71828_INT_CHG_WDG_TEMP_MASK), 171 + REGMAP_IRQ_REG(BD71828_INT_CHG_WDG_TIME, 4, 172 + BD71828_INT_CHG_WDG_TIME_MASK), 173 + REGMAP_IRQ_REG(BD71828_INT_CHG_RECHARGE_RES, 4, 174 + BD71828_INT_CHG_RECHARGE_RES_MASK), 175 + REGMAP_IRQ_REG(BD71828_INT_CHG_RECHARGE_DET, 4, 176 + BD71828_INT_CHG_RECHARGE_DET_MASK), 177 + REGMAP_IRQ_REG(BD71828_INT_CHG_RANGED_TEMP_TRANSITION, 4, 178 + BD71828_INT_CHG_RANGED_TEMP_TRANSITION_MASK), 179 + REGMAP_IRQ_REG(BD71828_INT_CHG_STATE_TRANSITION, 4, 180 + BD71828_INT_CHG_STATE_TRANSITION_MASK), 181 + /* Battery */ 182 + REGMAP_IRQ_REG(BD71828_INT_BAT_TEMP_NORMAL, 5, 183 + BD71828_INT_BAT_TEMP_NORMAL_MASK), 184 + REGMAP_IRQ_REG(BD71828_INT_BAT_TEMP_ERANGE, 5, 185 + BD71828_INT_BAT_TEMP_ERANGE_MASK), 186 + REGMAP_IRQ_REG(BD71828_INT_BAT_TEMP_WARN, 5, 187 + BD71828_INT_BAT_TEMP_WARN_MASK), 188 + REGMAP_IRQ_REG(BD71828_INT_BAT_REMOVED, 5, 189 + BD71828_INT_BAT_REMOVED_MASK), 190 + REGMAP_IRQ_REG(BD71828_INT_BAT_DETECTED, 5, 191 + BD71828_INT_BAT_DETECTED_MASK), 192 + REGMAP_IRQ_REG(BD71828_INT_THERM_REMOVED, 5, 193 + BD71828_INT_THERM_REMOVED_MASK), 194 + REGMAP_IRQ_REG(BD71828_INT_THERM_DETECTED, 5, 195 + BD71828_INT_THERM_DETECTED_MASK), 196 + /* Battery Mon 1 */ 197 + REGMAP_IRQ_REG(BD71828_INT_BAT_DEAD, 6, BD71828_INT_BAT_DEAD_MASK), 198 + REGMAP_IRQ_REG(BD71828_INT_BAT_SHORTC_RES, 6, 199 + BD71828_INT_BAT_SHORTC_RES_MASK), 200 + REGMAP_IRQ_REG(BD71828_INT_BAT_SHORTC_DET, 6, 201 + BD71828_INT_BAT_SHORTC_DET_MASK), 202 + REGMAP_IRQ_REG(BD71828_INT_BAT_LOW_VOLT_RES, 6, 203 + BD71828_INT_BAT_LOW_VOLT_RES_MASK), 204 + REGMAP_IRQ_REG(BD71828_INT_BAT_LOW_VOLT_DET, 6, 205 + BD71828_INT_BAT_LOW_VOLT_DET_MASK), 206 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_VOLT_RES, 6, 207 + BD71828_INT_BAT_OVER_VOLT_RES_MASK), 208 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_VOLT_DET, 6, 209 + BD71828_INT_BAT_OVER_VOLT_DET_MASK), 210 + /* Battery Mon 2 */ 211 + REGMAP_IRQ_REG(BD71828_INT_BAT_MON_RES, 7, 212 + BD71828_INT_BAT_MON_RES_MASK), 213 + REGMAP_IRQ_REG(BD71828_INT_BAT_MON_DET, 7, 214 + BD71828_INT_BAT_MON_DET_MASK), 215 + /* Battery Mon 3 (Coulomb counter) */ 216 + REGMAP_IRQ_REG(BD71828_INT_BAT_CC_MON1, 8, 217 + BD71828_INT_BAT_CC_MON1_MASK), 218 + REGMAP_IRQ_REG(BD71828_INT_BAT_CC_MON2, 8, 219 + BD71828_INT_BAT_CC_MON2_MASK), 220 + REGMAP_IRQ_REG(BD71828_INT_BAT_CC_MON3, 8, 221 + BD71828_INT_BAT_CC_MON3_MASK), 222 + /* Battery Mon 4 */ 223 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_1_RES, 9, 224 + BD71828_INT_BAT_OVER_CURR_1_RES_MASK), 225 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_1_DET, 9, 226 + BD71828_INT_BAT_OVER_CURR_1_DET_MASK), 227 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_2_RES, 9, 228 + BD71828_INT_BAT_OVER_CURR_2_RES_MASK), 229 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_2_DET, 9, 230 + BD71828_INT_BAT_OVER_CURR_2_DET_MASK), 231 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_3_RES, 9, 232 + BD71828_INT_BAT_OVER_CURR_3_RES_MASK), 233 + REGMAP_IRQ_REG(BD71828_INT_BAT_OVER_CURR_3_DET, 9, 234 + BD71828_INT_BAT_OVER_CURR_3_DET_MASK), 235 + /* Temperature */ 236 + REGMAP_IRQ_REG(BD71828_INT_TEMP_BAT_LOW_RES, 10, 237 + BD71828_INT_TEMP_BAT_LOW_RES_MASK), 238 + REGMAP_IRQ_REG(BD71828_INT_TEMP_BAT_LOW_DET, 10, 239 + BD71828_INT_TEMP_BAT_LOW_DET_MASK), 240 + REGMAP_IRQ_REG(BD71828_INT_TEMP_BAT_HI_RES, 10, 241 + BD71828_INT_TEMP_BAT_HI_RES_MASK), 242 + REGMAP_IRQ_REG(BD71828_INT_TEMP_BAT_HI_DET, 10, 243 + BD71828_INT_TEMP_BAT_HI_DET_MASK), 244 + REGMAP_IRQ_REG(BD71828_INT_TEMP_CHIP_OVER_125_RES, 10, 245 + BD71828_INT_TEMP_CHIP_OVER_125_RES_MASK), 246 + REGMAP_IRQ_REG(BD71828_INT_TEMP_CHIP_OVER_125_DET, 10, 247 + BD71828_INT_TEMP_CHIP_OVER_125_DET_MASK), 248 + REGMAP_IRQ_REG(BD71828_INT_TEMP_CHIP_OVER_VF_DET, 10, 249 + BD71828_INT_TEMP_CHIP_OVER_VF_DET_MASK), 250 + REGMAP_IRQ_REG(BD71828_INT_TEMP_CHIP_OVER_VF_RES, 10, 251 + BD71828_INT_TEMP_CHIP_OVER_VF_RES_MASK), 252 + /* RTC Alarm */ 253 + REGMAP_IRQ_REG(BD71828_INT_RTC0, 11, BD71828_INT_RTC0_MASK), 254 + REGMAP_IRQ_REG(BD71828_INT_RTC1, 11, BD71828_INT_RTC1_MASK), 255 + REGMAP_IRQ_REG(BD71828_INT_RTC2, 11, BD71828_INT_RTC2_MASK), 256 + }; 257 + 258 + static struct regmap_irq_chip bd71828_irq_chip = { 259 + .name = "bd71828_irq", 260 + .main_status = BD71828_REG_INT_MAIN, 261 + .irqs = &bd71828_irqs[0], 262 + .num_irqs = ARRAY_SIZE(bd71828_irqs), 263 + .status_base = BD71828_REG_INT_BUCK, 264 + .mask_base = BD71828_REG_INT_MASK_BUCK, 265 + .ack_base = BD71828_REG_INT_BUCK, 266 + .mask_invert = true, 267 + .init_ack_masked = true, 268 + .num_regs = 12, 269 + .num_main_regs = 1, 270 + .sub_reg_offsets = &bd71828_sub_irq_offsets[0], 271 + .num_main_status_bits = 8, 272 + .irq_reg_stride = 1, 273 + }; 274 + 275 + static int bd71828_i2c_probe(struct i2c_client *i2c) 276 + { 277 + struct rohm_regmap_dev *chip; 278 + struct regmap_irq_chip_data *irq_data; 279 + int ret; 280 + 281 + if (!i2c->irq) { 282 + dev_err(&i2c->dev, "No IRQ configured\n"); 283 + return -EINVAL; 284 + } 285 + 286 + chip = devm_kzalloc(&i2c->dev, sizeof(*chip), GFP_KERNEL); 287 + if (!chip) 288 + return -ENOMEM; 289 + 290 + dev_set_drvdata(&i2c->dev, chip); 291 + 292 + chip->regmap = devm_regmap_init_i2c(i2c, &bd71828_regmap); 293 + if (IS_ERR(chip->regmap)) { 294 + dev_err(&i2c->dev, "Failed to initialize Regmap\n"); 295 + return PTR_ERR(chip->regmap); 296 + } 297 + 298 + ret = devm_regmap_add_irq_chip(&i2c->dev, chip->regmap, 299 + i2c->irq, IRQF_ONESHOT, 0, 300 + &bd71828_irq_chip, &irq_data); 301 + if (ret) { 302 + dev_err(&i2c->dev, "Failed to add IRQ chip\n"); 303 + return ret; 304 + } 305 + 306 + dev_dbg(&i2c->dev, "Registered %d IRQs for chip\n", 307 + bd71828_irq_chip.num_irqs); 308 + 309 + ret = regmap_irq_get_virq(irq_data, BD71828_INT_SHORTPUSH); 310 + if (ret < 0) { 311 + dev_err(&i2c->dev, "Failed to get the power-key IRQ\n"); 312 + return ret; 313 + } 314 + 315 + button.irq = ret; 316 + 317 + ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, 318 + bd71828_mfd_cells, 319 + ARRAY_SIZE(bd71828_mfd_cells), NULL, 0, 320 + regmap_irq_get_domain(irq_data)); 321 + if (ret) 322 + dev_err(&i2c->dev, "Failed to create subdevices\n"); 323 + 324 + return ret; 325 + } 326 + 327 + static const struct of_device_id bd71828_of_match[] = { 328 + { .compatible = "rohm,bd71828", }, 329 + { }, 330 + }; 331 + MODULE_DEVICE_TABLE(of, bd71828_of_match); 332 + 333 + static struct i2c_driver bd71828_drv = { 334 + .driver = { 335 + .name = "rohm-bd71828", 336 + .of_match_table = bd71828_of_match, 337 + }, 338 + .probe_new = &bd71828_i2c_probe, 339 + }; 340 + module_i2c_driver(bd71828_drv); 341 + 342 + MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>"); 343 + MODULE_DESCRIPTION("ROHM BD71828 Power Management IC driver"); 344 + MODULE_LICENSE("GPL");
+36 -7
drivers/mfd/rohm-bd718x7.c
··· 30 30 .name = "bd718xx-pwrkey", 31 31 }; 32 32 33 - static struct mfd_cell bd718xx_mfd_cells[] = { 33 + static struct mfd_cell bd71837_mfd_cells[] = { 34 34 { 35 35 .name = "gpio-keys", 36 36 .platform_data = &bd718xx_powerkey_data, 37 37 .pdata_size = sizeof(bd718xx_powerkey_data), 38 38 }, 39 - { .name = "bd718xx-clk", }, 40 - { .name = "bd718xx-pmic", }, 39 + { .name = "bd71837-clk", }, 40 + { .name = "bd71837-pmic", }, 41 + }; 42 + 43 + static struct mfd_cell bd71847_mfd_cells[] = { 44 + { 45 + .name = "gpio-keys", 46 + .platform_data = &bd718xx_powerkey_data, 47 + .pdata_size = sizeof(bd718xx_powerkey_data), 48 + }, 49 + { .name = "bd71847-clk", }, 50 + { .name = "bd71847-pmic", }, 41 51 }; 42 52 43 53 static const struct regmap_irq bd718xx_irqs[] = { ··· 134 124 { 135 125 struct bd718xx *bd718xx; 136 126 int ret; 127 + unsigned int chip_type; 128 + struct mfd_cell *mfd; 129 + int cells; 137 130 138 131 if (!i2c->irq) { 139 132 dev_err(&i2c->dev, "No IRQ configured\n"); ··· 149 136 return -ENOMEM; 150 137 151 138 bd718xx->chip_irq = i2c->irq; 152 - bd718xx->chip.chip_type = (unsigned int)(uintptr_t) 153 - of_device_get_match_data(&i2c->dev); 139 + chip_type = (unsigned int)(uintptr_t) 140 + of_device_get_match_data(&i2c->dev); 141 + switch (chip_type) { 142 + case ROHM_CHIP_TYPE_BD71837: 143 + mfd = bd71837_mfd_cells; 144 + cells = ARRAY_SIZE(bd71837_mfd_cells); 145 + break; 146 + case ROHM_CHIP_TYPE_BD71847: 147 + mfd = bd71847_mfd_cells; 148 + cells = ARRAY_SIZE(bd71847_mfd_cells); 149 + break; 150 + default: 151 + dev_err(&i2c->dev, "Unknown device type"); 152 + return -EINVAL; 153 + } 154 154 bd718xx->chip.dev = &i2c->dev; 155 155 dev_set_drvdata(&i2c->dev, bd718xx); 156 156 ··· 196 170 button.irq = ret; 197 171 198 172 ret = devm_mfd_add_devices(bd718xx->chip.dev, PLATFORM_DEVID_AUTO, 199 - bd718xx_mfd_cells, 200 - ARRAY_SIZE(bd718xx_mfd_cells), NULL, 0, 173 + mfd, cells, NULL, 0, 201 174 regmap_irq_get_domain(bd718xx->irq_data)); 202 175 if (ret) 203 176 dev_err(&i2c->dev, "Failed to create subdevices\n"); ··· 211 186 }, 212 187 { 213 188 .compatible = "rohm,bd71847", 189 + .data = (void *)ROHM_CHIP_TYPE_BD71847, 190 + }, 191 + { 192 + .compatible = "rohm,bd71850", 214 193 .data = (void *)ROHM_CHIP_TYPE_BD71847, 215 194 }, 216 195 { }
+7 -12
drivers/mfd/sm501.c
··· 1086 1086 iounmap(gpio->regs); 1087 1087 1088 1088 err_claimed: 1089 - release_resource(gpio->regs_res); 1090 - kfree(gpio->regs_res); 1089 + release_mem_region(iobase, 0x20); 1091 1090 1092 1091 return ret; 1093 1092 } ··· 1094 1095 static void sm501_gpio_remove(struct sm501_devdata *sm) 1095 1096 { 1096 1097 struct sm501_gpio *gpio = &sm->gpio; 1098 + resource_size_t iobase = sm->io_res->start + SM501_GPIO; 1097 1099 1098 1100 if (!sm->gpio.registered) 1099 1101 return; ··· 1103 1103 gpiochip_remove(&gpio->high.gpio); 1104 1104 1105 1105 iounmap(gpio->regs); 1106 - release_resource(gpio->regs_res); 1107 - kfree(gpio->regs_res); 1106 + release_mem_region(iobase, 0x20); 1108 1107 } 1109 1108 1110 1109 static inline int sm501_gpio_isregistered(struct sm501_devdata *sm) ··· 1426 1427 return sm501_init_dev(sm); 1427 1428 1428 1429 err_claim: 1429 - release_resource(sm->regs_claim); 1430 - kfree(sm->regs_claim); 1430 + release_mem_region(sm->io_res->start, 0x100); 1431 1431 err_res: 1432 1432 kfree(sm); 1433 1433 err1: ··· 1635 1637 return 0; 1636 1638 1637 1639 err4: 1638 - release_resource(sm->regs_claim); 1639 - kfree(sm->regs_claim); 1640 + release_mem_region(sm->io_res->start, 0x100); 1640 1641 err3: 1641 1642 pci_disable_device(dev); 1642 1643 err2: ··· 1670 1673 sm501_dev_remove(sm); 1671 1674 iounmap(sm->regs); 1672 1675 1673 - release_resource(sm->regs_claim); 1674 - kfree(sm->regs_claim); 1676 + release_mem_region(sm->io_res->start, 0x100); 1675 1677 1676 1678 pci_disable_device(dev); 1677 1679 } ··· 1682 1686 sm501_dev_remove(sm); 1683 1687 iounmap(sm->regs); 1684 1688 1685 - release_resource(sm->regs_claim); 1686 - kfree(sm->regs_claim); 1689 + release_mem_region(sm->io_res->start, 0x100); 1687 1690 1688 1691 return 0; 1689 1692 }
+30 -1
drivers/mfd/syscon.c
··· 224 224 } 225 225 EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle); 226 226 227 + struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np, 228 + const char *property, 229 + int arg_count, 230 + unsigned int *out_args) 231 + { 232 + struct device_node *syscon_np; 233 + struct of_phandle_args args; 234 + struct regmap *regmap; 235 + unsigned int index; 236 + int rc; 237 + 238 + rc = of_parse_phandle_with_fixed_args(np, property, arg_count, 239 + 0, &args); 240 + if (rc) 241 + return ERR_PTR(rc); 242 + 243 + syscon_np = args.np; 244 + if (!syscon_np) 245 + return ERR_PTR(-ENODEV); 246 + 247 + regmap = syscon_node_to_regmap(syscon_np); 248 + for (index = 0; index < arg_count; index++) 249 + out_args[index] = args.args[index]; 250 + of_node_put(syscon_np); 251 + 252 + return regmap; 253 + } 254 + EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_args); 255 + 227 256 static int syscon_probe(struct platform_device *pdev) 228 257 { 229 258 struct device *dev = &pdev->dev; ··· 274 245 if (!base) 275 246 return -ENOMEM; 276 247 277 - syscon_config.max_register = res->end - res->start - 3; 248 + syscon_config.max_register = resource_size(res) - 4; 278 249 if (pdata) 279 250 syscon_config.name = pdata->label; 280 251 syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
+1 -2
drivers/mfd/tqmx86.c
··· 158 158 159 159 static int tqmx86_probe(struct platform_device *pdev) 160 160 { 161 - u8 board_id, rev, i2c_det, i2c_ien, io_ext_int_val; 161 + u8 board_id, rev, i2c_det, io_ext_int_val; 162 162 struct device *dev = &pdev->dev; 163 163 u8 gpio_irq_cfg, readback; 164 164 const char *board_name; ··· 196 196 board_name, board_id, rev >> 4, rev & 0xf); 197 197 198 198 i2c_det = ioread8(io_base + TQMX86_REG_I2C_DETECT); 199 - i2c_ien = ioread8(io_base + TQMX86_REG_I2C_INT_EN); 200 199 201 200 if (gpio_irq_cfg) { 202 201 io_ext_int_val =
+306
drivers/mfd/wcd934x.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (c) 2019, Linaro Limited 3 + 4 + #include <linux/clk.h> 5 + #include <linux/gpio.h> 6 + #include <linux/interrupt.h> 7 + #include <linux/kernel.h> 8 + #include <linux/mfd/core.h> 9 + #include <linux/mfd/wcd934x/registers.h> 10 + #include <linux/mfd/wcd934x/wcd934x.h> 11 + #include <linux/module.h> 12 + #include <linux/of_gpio.h> 13 + #include <linux/of.h> 14 + #include <linux/of_irq.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/regmap.h> 17 + #include <linux/regulator/consumer.h> 18 + #include <linux/slimbus.h> 19 + 20 + static const struct mfd_cell wcd934x_devices[] = { 21 + { 22 + .name = "wcd934x-codec", 23 + }, { 24 + .name = "wcd934x-gpio", 25 + .of_compatible = "qcom,wcd9340-gpio", 26 + }, { 27 + .name = "wcd934x-soundwire", 28 + .of_compatible = "qcom,soundwire-v1.3.0", 29 + }, 30 + }; 31 + 32 + static const struct regmap_irq wcd934x_irqs[] = { 33 + [WCD934X_IRQ_SLIMBUS] = { 34 + .reg_offset = 0, 35 + .mask = BIT(0), 36 + .type = { 37 + .type_reg_offset = 0, 38 + .types_supported = IRQ_TYPE_EDGE_BOTH, 39 + .type_reg_mask = BIT(0), 40 + .type_level_low_val = BIT(0), 41 + .type_level_high_val = BIT(0), 42 + .type_falling_val = 0, 43 + .type_rising_val = 0, 44 + }, 45 + }, 46 + [WCD934X_IRQ_SOUNDWIRE] = { 47 + .reg_offset = 2, 48 + .mask = BIT(4), 49 + .type = { 50 + .type_reg_offset = 2, 51 + .types_supported = IRQ_TYPE_EDGE_BOTH, 52 + .type_reg_mask = BIT(4), 53 + .type_level_low_val = BIT(4), 54 + .type_level_high_val = BIT(4), 55 + .type_falling_val = 0, 56 + .type_rising_val = 0, 57 + }, 58 + }, 59 + }; 60 + 61 + static const struct regmap_irq_chip wcd934x_regmap_irq_chip = { 62 + .name = "wcd934x_irq", 63 + .status_base = WCD934X_INTR_PIN1_STATUS0, 64 + .mask_base = WCD934X_INTR_PIN1_MASK0, 65 + .ack_base = WCD934X_INTR_PIN1_CLEAR0, 66 + .type_base = WCD934X_INTR_LEVEL0, 67 + .num_type_reg = 4, 68 + .type_in_mask = false, 69 + .num_regs = 4, 70 + .irqs = wcd934x_irqs, 71 + .num_irqs = ARRAY_SIZE(wcd934x_irqs), 72 + }; 73 + 74 + static bool wcd934x_is_volatile_register(struct device *dev, unsigned int reg) 75 + { 76 + switch (reg) { 77 + case WCD934X_INTR_PIN1_STATUS0...WCD934X_INTR_PIN2_CLEAR3: 78 + case WCD934X_SWR_AHB_BRIDGE_RD_DATA_0: 79 + case WCD934X_SWR_AHB_BRIDGE_RD_DATA_1: 80 + case WCD934X_SWR_AHB_BRIDGE_RD_DATA_2: 81 + case WCD934X_SWR_AHB_BRIDGE_RD_DATA_3: 82 + case WCD934X_SWR_AHB_BRIDGE_ACCESS_STATUS: 83 + case WCD934X_ANA_MBHC_RESULT_3: 84 + case WCD934X_ANA_MBHC_RESULT_2: 85 + case WCD934X_ANA_MBHC_RESULT_1: 86 + case WCD934X_ANA_MBHC_MECH: 87 + case WCD934X_ANA_MBHC_ELECT: 88 + case WCD934X_ANA_MBHC_ZDET: 89 + case WCD934X_ANA_MICB2: 90 + case WCD934X_ANA_RCO: 91 + case WCD934X_ANA_BIAS: 92 + return true; 93 + default: 94 + return false; 95 + } 96 + }; 97 + 98 + static const struct regmap_range_cfg wcd934x_ranges[] = { 99 + { .name = "WCD934X", 100 + .range_min = 0x0, 101 + .range_max = WCD934X_MAX_REGISTER, 102 + .selector_reg = WCD934X_SEL_REGISTER, 103 + .selector_mask = WCD934X_SEL_MASK, 104 + .selector_shift = WCD934X_SEL_SHIFT, 105 + .window_start = WCD934X_WINDOW_START, 106 + .window_len = WCD934X_WINDOW_LENGTH, 107 + }, 108 + }; 109 + 110 + static struct regmap_config wcd934x_regmap_config = { 111 + .reg_bits = 16, 112 + .val_bits = 8, 113 + .cache_type = REGCACHE_RBTREE, 114 + .max_register = 0xffff, 115 + .can_multi_write = true, 116 + .ranges = wcd934x_ranges, 117 + .num_ranges = ARRAY_SIZE(wcd934x_ranges), 118 + .volatile_reg = wcd934x_is_volatile_register, 119 + }; 120 + 121 + static int wcd934x_bring_up(struct wcd934x_ddata *ddata) 122 + { 123 + struct regmap *regmap = ddata->regmap; 124 + u16 id_minor, id_major; 125 + int ret; 126 + 127 + ret = regmap_bulk_read(regmap, WCD934X_CHIP_TIER_CTRL_CHIP_ID_BYTE0, 128 + (u8 *)&id_minor, sizeof(u16)); 129 + if (ret) 130 + return ret; 131 + 132 + ret = regmap_bulk_read(regmap, WCD934X_CHIP_TIER_CTRL_CHIP_ID_BYTE2, 133 + (u8 *)&id_major, sizeof(u16)); 134 + if (ret) 135 + return ret; 136 + 137 + dev_info(ddata->dev, "WCD934x chip id major 0x%x, minor 0x%x\n", 138 + id_major, id_minor); 139 + 140 + regmap_write(regmap, WCD934X_CODEC_RPM_RST_CTL, 0x01); 141 + regmap_write(regmap, WCD934X_SIDO_NEW_VOUT_A_STARTUP, 0x19); 142 + regmap_write(regmap, WCD934X_SIDO_NEW_VOUT_D_STARTUP, 0x15); 143 + /* Add 1msec delay for VOUT to settle */ 144 + usleep_range(1000, 1100); 145 + regmap_write(regmap, WCD934X_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x5); 146 + regmap_write(regmap, WCD934X_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x7); 147 + regmap_write(regmap, WCD934X_CODEC_RPM_RST_CTL, 0x3); 148 + regmap_write(regmap, WCD934X_CODEC_RPM_RST_CTL, 0x7); 149 + regmap_write(regmap, WCD934X_CODEC_RPM_PWR_CDC_DIG_HM_CTL, 0x3); 150 + 151 + return 0; 152 + } 153 + 154 + static int wcd934x_slim_status_up(struct slim_device *sdev) 155 + { 156 + struct device *dev = &sdev->dev; 157 + struct wcd934x_ddata *ddata; 158 + int ret; 159 + 160 + ddata = dev_get_drvdata(dev); 161 + 162 + ddata->regmap = regmap_init_slimbus(sdev, &wcd934x_regmap_config); 163 + if (IS_ERR(ddata->regmap)) { 164 + dev_err(dev, "Error allocating slim regmap\n"); 165 + return PTR_ERR(ddata->regmap); 166 + } 167 + 168 + ret = wcd934x_bring_up(ddata); 169 + if (ret) { 170 + dev_err(dev, "Failed to bring up WCD934X: err = %d\n", ret); 171 + return ret; 172 + } 173 + 174 + ret = devm_regmap_add_irq_chip(dev, ddata->regmap, ddata->irq, 175 + IRQF_TRIGGER_HIGH, 0, 176 + &wcd934x_regmap_irq_chip, 177 + &ddata->irq_data); 178 + if (ret) { 179 + dev_err(dev, "Failed to add IRQ chip: err = %d\n", ret); 180 + return ret; 181 + } 182 + 183 + ret = mfd_add_devices(dev, PLATFORM_DEVID_AUTO, wcd934x_devices, 184 + ARRAY_SIZE(wcd934x_devices), NULL, 0, NULL); 185 + if (ret) { 186 + dev_err(dev, "Failed to add child devices: err = %d\n", 187 + ret); 188 + return ret; 189 + } 190 + 191 + return ret; 192 + } 193 + 194 + static int wcd934x_slim_status(struct slim_device *sdev, 195 + enum slim_device_status status) 196 + { 197 + switch (status) { 198 + case SLIM_DEVICE_STATUS_UP: 199 + return wcd934x_slim_status_up(sdev); 200 + case SLIM_DEVICE_STATUS_DOWN: 201 + mfd_remove_devices(&sdev->dev); 202 + break; 203 + default: 204 + return -EINVAL; 205 + } 206 + 207 + return 0; 208 + } 209 + 210 + static int wcd934x_slim_probe(struct slim_device *sdev) 211 + { 212 + struct device *dev = &sdev->dev; 213 + struct device_node *np = dev->of_node; 214 + struct wcd934x_ddata *ddata; 215 + int reset_gpio, ret; 216 + 217 + ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); 218 + if (!ddata) 219 + return -ENOMEM; 220 + 221 + ddata->irq = of_irq_get(np, 0); 222 + if (ddata->irq < 0) { 223 + if (ddata->irq != -EPROBE_DEFER) 224 + dev_err(ddata->dev, "Failed to get IRQ: err = %d\n", 225 + ddata->irq); 226 + return ddata->irq; 227 + } 228 + 229 + reset_gpio = of_get_named_gpio(np, "reset-gpios", 0); 230 + if (reset_gpio < 0) { 231 + dev_err(dev, "Failed to get reset gpio: err = %d\n", 232 + reset_gpio); 233 + return reset_gpio; 234 + } 235 + 236 + ddata->extclk = devm_clk_get(dev, "extclk"); 237 + if (IS_ERR(ddata->extclk)) { 238 + dev_err(dev, "Failed to get extclk"); 239 + return PTR_ERR(ddata->extclk); 240 + } 241 + 242 + ddata->supplies[0].supply = "vdd-buck"; 243 + ddata->supplies[1].supply = "vdd-buck-sido"; 244 + ddata->supplies[2].supply = "vdd-tx"; 245 + ddata->supplies[3].supply = "vdd-rx"; 246 + ddata->supplies[4].supply = "vdd-io"; 247 + 248 + ret = regulator_bulk_get(dev, WCD934X_MAX_SUPPLY, ddata->supplies); 249 + if (ret) { 250 + dev_err(dev, "Failed to get supplies: err = %d\n", ret); 251 + return ret; 252 + } 253 + 254 + ret = regulator_bulk_enable(WCD934X_MAX_SUPPLY, ddata->supplies); 255 + if (ret) { 256 + dev_err(dev, "Failed to enable supplies: err = %d\n", ret); 257 + return ret; 258 + } 259 + 260 + /* 261 + * For WCD934X, it takes about 600us for the Vout_A and 262 + * Vout_D to be ready after BUCK_SIDO is powered up. 263 + * SYS_RST_N shouldn't be pulled high during this time 264 + */ 265 + usleep_range(600, 650); 266 + gpio_direction_output(reset_gpio, 0); 267 + msleep(20); 268 + gpio_set_value(reset_gpio, 1); 269 + msleep(20); 270 + 271 + ddata->dev = dev; 272 + dev_set_drvdata(dev, ddata); 273 + 274 + return 0; 275 + } 276 + 277 + static void wcd934x_slim_remove(struct slim_device *sdev) 278 + { 279 + struct wcd934x_ddata *ddata = dev_get_drvdata(&sdev->dev); 280 + 281 + regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies); 282 + mfd_remove_devices(&sdev->dev); 283 + kfree(ddata); 284 + } 285 + 286 + static const struct slim_device_id wcd934x_slim_id[] = { 287 + { SLIM_MANF_ID_QCOM, SLIM_PROD_CODE_WCD9340, 288 + SLIM_DEV_IDX_WCD9340, SLIM_DEV_INSTANCE_ID_WCD9340 }, 289 + {} 290 + }; 291 + 292 + static struct slim_driver wcd934x_slim_driver = { 293 + .driver = { 294 + .name = "wcd934x-slim", 295 + }, 296 + .probe = wcd934x_slim_probe, 297 + .remove = wcd934x_slim_remove, 298 + .device_status = wcd934x_slim_status, 299 + .id_table = wcd934x_slim_id, 300 + }; 301 + 302 + module_slim_driver(wcd934x_slim_driver); 303 + MODULE_DESCRIPTION("WCD934X slim driver"); 304 + MODULE_LICENSE("GPL v2"); 305 + MODULE_ALIAS("slim:217:250:*"); 306 + MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org>");
+4
drivers/regulator/Kconfig
··· 209 209 config REGULATOR_BD718XX 210 210 tristate "ROHM BD71837 Power Regulator" 211 211 depends on MFD_ROHM_BD718XX 212 + select REGULATOR_ROHM 212 213 help 213 214 This driver supports voltage regulators on ROHM BD71837 PMIC. 214 215 This will enable support for the software controllable buck ··· 823 822 help 824 823 Say y here to support the regulators found on Ricoh RN5T567, 825 824 RN5T618 or RC5T619 PMIC. 825 + 826 + config REGULATOR_ROHM 827 + tristate 826 828 827 829 config REGULATOR_RT5033 828 830 tristate "Richtek RT5033 Regulators"
+1
drivers/regulator/Makefile
··· 102 102 obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o 103 103 obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o 104 104 obj-$(CONFIG_REGULATOR_RN5T618) += rn5t618-regulator.o 105 + obj-$(CONFIG_REGULATOR_ROHM) += rohm-regulator.o 105 106 obj-$(CONFIG_REGULATOR_RT5033) += rt5033-regulator.o 106 107 obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o 107 108 obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
+65 -129
drivers/regulator/bd718x7-regulator.c
··· 318 318 }; 319 319 struct bd718xx_regulator_data { 320 320 struct regulator_desc desc; 321 + const struct rohm_dvs_config dvs; 321 322 const struct reg_init init; 322 323 const struct reg_init *additional_inits; 323 324 int additional_init_amnt; ··· 350 349 }, 351 350 }; 352 351 353 - #define NUM_DVS_BUCKS 4 354 - 355 - struct of_dvs_setting { 356 - const char *prop; 357 - unsigned int reg; 358 - }; 359 - 360 - static int set_dvs_levels(const struct of_dvs_setting *dvs, 361 - struct device_node *np, 362 - const struct regulator_desc *desc, 363 - struct regmap *regmap) 364 - { 365 - int ret, i; 366 - unsigned int uv; 367 - 368 - ret = of_property_read_u32(np, dvs->prop, &uv); 369 - if (ret) { 370 - if (ret != -EINVAL) 371 - return ret; 372 - return 0; 373 - } 374 - 375 - for (i = 0; i < desc->n_voltages; i++) { 376 - ret = regulator_desc_list_voltage_linear_range(desc, i); 377 - if (ret < 0) 378 - continue; 379 - if (ret == uv) { 380 - i <<= ffs(desc->vsel_mask) - 1; 381 - ret = regmap_update_bits(regmap, dvs->reg, 382 - DVS_BUCK_RUN_MASK, i); 383 - break; 384 - } 385 - } 386 - return ret; 387 - } 388 - 389 - static int buck4_set_hw_dvs_levels(struct device_node *np, 352 + static int buck_set_hw_dvs_levels(struct device_node *np, 390 353 const struct regulator_desc *desc, 391 354 struct regulator_config *cfg) 392 355 { 393 - int ret, i; 394 - const struct of_dvs_setting dvs[] = { 395 - { 396 - .prop = "rohm,dvs-run-voltage", 397 - .reg = BD71837_REG_BUCK4_VOLT_RUN, 398 - }, 399 - }; 356 + struct bd718xx_regulator_data *data; 400 357 401 - for (i = 0; i < ARRAY_SIZE(dvs); i++) { 402 - ret = set_dvs_levels(&dvs[i], np, desc, cfg->regmap); 403 - if (ret) 404 - break; 405 - } 406 - return ret; 407 - } 408 - static int buck3_set_hw_dvs_levels(struct device_node *np, 409 - const struct regulator_desc *desc, 410 - struct regulator_config *cfg) 411 - { 412 - int ret, i; 413 - const struct of_dvs_setting dvs[] = { 414 - { 415 - .prop = "rohm,dvs-run-voltage", 416 - .reg = BD71837_REG_BUCK3_VOLT_RUN, 417 - }, 418 - }; 358 + data = container_of(desc, struct bd718xx_regulator_data, desc); 419 359 420 - for (i = 0; i < ARRAY_SIZE(dvs); i++) { 421 - ret = set_dvs_levels(&dvs[i], np, desc, cfg->regmap); 422 - if (ret) 423 - break; 424 - } 425 - return ret; 426 - } 427 - 428 - static int buck2_set_hw_dvs_levels(struct device_node *np, 429 - const struct regulator_desc *desc, 430 - struct regulator_config *cfg) 431 - { 432 - int ret, i; 433 - const struct of_dvs_setting dvs[] = { 434 - { 435 - .prop = "rohm,dvs-run-voltage", 436 - .reg = BD718XX_REG_BUCK2_VOLT_RUN, 437 - }, 438 - { 439 - .prop = "rohm,dvs-idle-voltage", 440 - .reg = BD718XX_REG_BUCK2_VOLT_IDLE, 441 - }, 442 - }; 443 - 444 - 445 - 446 - for (i = 0; i < ARRAY_SIZE(dvs); i++) { 447 - ret = set_dvs_levels(&dvs[i], np, desc, cfg->regmap); 448 - if (ret) 449 - break; 450 - } 451 - return ret; 452 - } 453 - 454 - static int buck1_set_hw_dvs_levels(struct device_node *np, 455 - const struct regulator_desc *desc, 456 - struct regulator_config *cfg) 457 - { 458 - int ret, i; 459 - const struct of_dvs_setting dvs[] = { 460 - { 461 - .prop = "rohm,dvs-run-voltage", 462 - .reg = BD718XX_REG_BUCK1_VOLT_RUN, 463 - }, 464 - { 465 - .prop = "rohm,dvs-idle-voltage", 466 - .reg = BD718XX_REG_BUCK1_VOLT_IDLE, 467 - }, 468 - { 469 - .prop = "rohm,dvs-suspend-voltage", 470 - .reg = BD718XX_REG_BUCK1_VOLT_SUSP, 471 - }, 472 - }; 473 - 474 - for (i = 0; i < ARRAY_SIZE(dvs); i++) { 475 - ret = set_dvs_levels(&dvs[i], np, desc, cfg->regmap); 476 - if (ret) 477 - break; 478 - } 479 - return ret; 360 + return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap); 480 361 } 481 362 482 363 static const struct bd718xx_regulator_data bd71847_regulators[] = { ··· 379 496 .enable_reg = BD718XX_REG_BUCK1_CTRL, 380 497 .enable_mask = BD718XX_BUCK_EN, 381 498 .owner = THIS_MODULE, 382 - .of_parse_cb = buck1_set_hw_dvs_levels, 499 + .of_parse_cb = buck_set_hw_dvs_levels, 500 + }, 501 + .dvs = { 502 + .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE | 503 + ROHM_DVS_LEVEL_SUSPEND, 504 + .run_reg = BD718XX_REG_BUCK1_VOLT_RUN, 505 + .run_mask = DVS_BUCK_RUN_MASK, 506 + .idle_reg = BD718XX_REG_BUCK1_VOLT_IDLE, 507 + .idle_mask = DVS_BUCK_RUN_MASK, 508 + .suspend_reg = BD718XX_REG_BUCK1_VOLT_SUSP, 509 + .suspend_mask = DVS_BUCK_RUN_MASK, 383 510 }, 384 511 .init = { 385 512 .reg = BD718XX_REG_BUCK1_CTRL, ··· 413 520 .enable_reg = BD718XX_REG_BUCK2_CTRL, 414 521 .enable_mask = BD718XX_BUCK_EN, 415 522 .owner = THIS_MODULE, 416 - .of_parse_cb = buck2_set_hw_dvs_levels, 523 + .of_parse_cb = buck_set_hw_dvs_levels, 524 + }, 525 + .dvs = { 526 + .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE, 527 + .run_reg = BD718XX_REG_BUCK2_VOLT_RUN, 528 + .run_mask = DVS_BUCK_RUN_MASK, 529 + .idle_reg = BD718XX_REG_BUCK2_VOLT_IDLE, 530 + .idle_mask = DVS_BUCK_RUN_MASK, 417 531 }, 418 532 .init = { 419 533 .reg = BD718XX_REG_BUCK2_CTRL, ··· 692 792 .enable_reg = BD718XX_REG_BUCK1_CTRL, 693 793 .enable_mask = BD718XX_BUCK_EN, 694 794 .owner = THIS_MODULE, 695 - .of_parse_cb = buck1_set_hw_dvs_levels, 795 + .of_parse_cb = buck_set_hw_dvs_levels, 796 + }, 797 + .dvs = { 798 + .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE | 799 + ROHM_DVS_LEVEL_SUSPEND, 800 + .run_reg = BD718XX_REG_BUCK1_VOLT_RUN, 801 + .run_mask = DVS_BUCK_RUN_MASK, 802 + .idle_reg = BD718XX_REG_BUCK1_VOLT_IDLE, 803 + .idle_mask = DVS_BUCK_RUN_MASK, 804 + .suspend_reg = BD718XX_REG_BUCK1_VOLT_SUSP, 805 + .suspend_mask = DVS_BUCK_RUN_MASK, 696 806 }, 697 807 .init = { 698 808 .reg = BD718XX_REG_BUCK1_CTRL, ··· 726 816 .enable_reg = BD718XX_REG_BUCK2_CTRL, 727 817 .enable_mask = BD718XX_BUCK_EN, 728 818 .owner = THIS_MODULE, 729 - .of_parse_cb = buck2_set_hw_dvs_levels, 819 + .of_parse_cb = buck_set_hw_dvs_levels, 820 + }, 821 + .dvs = { 822 + .level_map = ROHM_DVS_LEVEL_RUN | ROHM_DVS_LEVEL_IDLE, 823 + .run_reg = BD718XX_REG_BUCK2_VOLT_RUN, 824 + .run_mask = DVS_BUCK_RUN_MASK, 825 + .idle_reg = BD718XX_REG_BUCK2_VOLT_IDLE, 826 + .idle_mask = DVS_BUCK_RUN_MASK, 730 827 }, 731 828 .init = { 732 829 .reg = BD718XX_REG_BUCK2_CTRL, ··· 757 840 .enable_reg = BD71837_REG_BUCK3_CTRL, 758 841 .enable_mask = BD718XX_BUCK_EN, 759 842 .owner = THIS_MODULE, 760 - .of_parse_cb = buck3_set_hw_dvs_levels, 843 + .of_parse_cb = buck_set_hw_dvs_levels, 844 + }, 845 + .dvs = { 846 + .level_map = ROHM_DVS_LEVEL_RUN, 847 + .run_reg = BD71837_REG_BUCK3_VOLT_RUN, 848 + .run_mask = DVS_BUCK_RUN_MASK, 761 849 }, 762 850 .init = { 763 851 .reg = BD71837_REG_BUCK3_CTRL, ··· 786 864 .enable_reg = BD71837_REG_BUCK4_CTRL, 787 865 .enable_mask = BD718XX_BUCK_EN, 788 866 .owner = THIS_MODULE, 789 - .of_parse_cb = buck4_set_hw_dvs_levels, 867 + .of_parse_cb = buck_set_hw_dvs_levels, 868 + }, 869 + .dvs = { 870 + .level_map = ROHM_DVS_LEVEL_RUN, 871 + .run_reg = BD71837_REG_BUCK4_VOLT_RUN, 872 + .run_mask = DVS_BUCK_RUN_MASK, 790 873 }, 791 874 .init = { 792 875 .reg = BD71837_REG_BUCK4_CTRL, ··· 1077 1150 bool use_snvs; 1078 1151 const struct bd718xx_regulator_data *reg_data; 1079 1152 unsigned int num_reg_data; 1153 + enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; 1080 1154 1081 1155 mfd = dev_get_drvdata(pdev->dev.parent); 1082 1156 if (!mfd) { ··· 1086 1158 goto err; 1087 1159 } 1088 1160 1089 - switch (mfd->chip.chip_type) { 1161 + switch (chip) { 1090 1162 case ROHM_CHIP_TYPE_BD71837: 1091 1163 reg_data = bd71837_regulators; 1092 1164 num_reg_data = ARRAY_SIZE(bd71837_regulators); ··· 1203 1275 return err; 1204 1276 } 1205 1277 1278 + static const struct platform_device_id bd718x7_pmic_id[] = { 1279 + { "bd71837-pmic", ROHM_CHIP_TYPE_BD71837 }, 1280 + { "bd71847-pmic", ROHM_CHIP_TYPE_BD71847 }, 1281 + { }, 1282 + }; 1283 + MODULE_DEVICE_TABLE(platform, bd718x7_pmic_id); 1284 + 1206 1285 static struct platform_driver bd718xx_regulator = { 1207 1286 .driver = { 1208 1287 .name = "bd718xx-pmic", 1209 1288 }, 1210 1289 .probe = bd718xx_probe, 1290 + .id_table = bd718x7_pmic_id, 1211 1291 }; 1212 1292 1213 1293 module_platform_driver(bd718xx_regulator);
+95
drivers/regulator/rohm-regulator.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (C) 2020 ROHM Semiconductors 3 + 4 + #include <linux/errno.h> 5 + #include <linux/mfd/rohm-generic.h> 6 + #include <linux/module.h> 7 + #include <linux/of.h> 8 + #include <linux/regmap.h> 9 + #include <linux/regulator/driver.h> 10 + 11 + static int set_dvs_level(const struct regulator_desc *desc, 12 + struct device_node *np, struct regmap *regmap, 13 + char *prop, unsigned int reg, unsigned int mask, 14 + unsigned int omask, unsigned int oreg) 15 + { 16 + int ret, i; 17 + uint32_t uv; 18 + 19 + ret = of_property_read_u32(np, prop, &uv); 20 + if (ret) { 21 + if (ret != -EINVAL) 22 + return ret; 23 + return 0; 24 + } 25 + 26 + if (uv == 0) { 27 + if (omask) 28 + return regmap_update_bits(regmap, oreg, omask, 0); 29 + } 30 + for (i = 0; i < desc->n_voltages; i++) { 31 + ret = regulator_desc_list_voltage_linear_range(desc, i); 32 + if (ret < 0) 33 + continue; 34 + if (ret == uv) { 35 + i <<= ffs(desc->vsel_mask) - 1; 36 + ret = regmap_update_bits(regmap, reg, mask, i); 37 + if (omask && !ret) 38 + ret = regmap_update_bits(regmap, oreg, omask, 39 + omask); 40 + break; 41 + } 42 + } 43 + return ret; 44 + } 45 + 46 + int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, 47 + struct device_node *np, 48 + const struct regulator_desc *desc, 49 + struct regmap *regmap) 50 + { 51 + int i, ret = 0; 52 + char *prop; 53 + unsigned int reg, mask, omask, oreg = desc->enable_reg; 54 + 55 + for (i = 0; i < ROHM_DVS_LEVEL_MAX && !ret; i++) { 56 + if (dvs->level_map & (1 << i)) { 57 + switch (i + 1) { 58 + case ROHM_DVS_LEVEL_RUN: 59 + prop = "rohm,dvs-run-voltage"; 60 + reg = dvs->run_reg; 61 + mask = dvs->run_mask; 62 + omask = dvs->run_on_mask; 63 + break; 64 + case ROHM_DVS_LEVEL_IDLE: 65 + prop = "rohm,dvs-idle-voltage"; 66 + reg = dvs->idle_reg; 67 + mask = dvs->idle_mask; 68 + omask = dvs->idle_on_mask; 69 + break; 70 + case ROHM_DVS_LEVEL_SUSPEND: 71 + prop = "rohm,dvs-suspend-voltage"; 72 + reg = dvs->suspend_reg; 73 + mask = dvs->suspend_mask; 74 + omask = dvs->suspend_on_mask; 75 + break; 76 + case ROHM_DVS_LEVEL_LPSR: 77 + prop = "rohm,dvs-lpsr-voltage"; 78 + reg = dvs->lpsr_reg; 79 + mask = dvs->lpsr_mask; 80 + omask = dvs->lpsr_on_mask; 81 + break; 82 + default: 83 + return -EINVAL; 84 + } 85 + ret = set_dvs_level(desc, np, regmap, prop, reg, mask, 86 + omask, oreg); 87 + } 88 + } 89 + return ret; 90 + } 91 + EXPORT_SYMBOL(rohm_regulator_set_dvs_levels); 92 + 93 + MODULE_LICENSE("GPL v2"); 94 + MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>"); 95 + MODULE_DESCRIPTION("Generic helpers for ROHM PMIC regulator drivers");
+2 -1
drivers/rtc/Kconfig
··· 498 498 help 499 499 If you say Y here you will get support for the 500 500 watchdog timer in the ST M41T60 and M41T80 RTC chips series. 501 + 501 502 config RTC_DRV_BD70528 502 503 tristate "ROHM BD70528 PMIC RTC" 503 504 depends on MFD_ROHM_BD70528 && (BD70528_WATCHDOG || !BD70528_WATCHDOG) 504 505 help 505 506 If you say Y here you will get support for the RTC 506 - on ROHM BD70528 Power Management IC. 507 + block on ROHM BD70528 and BD71828 Power Management IC. 507 508 508 509 This driver can also be built as a module. If so, the module 509 510 will be called rtc-bd70528.
+179 -41
drivers/rtc/rtc-bd70528.c
··· 6 6 7 7 #include <linux/bcd.h> 8 8 #include <linux/mfd/rohm-bd70528.h> 9 + #include <linux/mfd/rohm-bd71828.h> 9 10 #include <linux/module.h> 10 11 #include <linux/of.h> 11 12 #include <linux/platform_device.h> ··· 16 15 /* 17 16 * We read regs RTC_SEC => RTC_YEAR 18 17 * this struct is ordered according to chip registers. 19 - * Keep it u8 only to avoid padding issues. 18 + * Keep it u8 only (or packed) to avoid padding issues. 20 19 */ 21 20 struct bd70528_rtc_day { 22 21 u8 sec; ··· 37 36 u8 ctrl; 38 37 } __packed; 39 38 39 + struct bd71828_rtc_alm { 40 + struct bd70528_rtc_data alm0; 41 + struct bd70528_rtc_data alm1; 42 + u8 alm_mask; 43 + u8 alm1_mask; 44 + } __packed; 45 + 40 46 struct bd70528_rtc_alm { 41 47 struct bd70528_rtc_data data; 42 48 u8 alm_mask; ··· 51 43 } __packed; 52 44 53 45 struct bd70528_rtc { 54 - struct rohm_regmap_dev *mfd; 46 + struct rohm_regmap_dev *parent; 55 47 struct device *dev; 48 + u8 reg_time_start; 49 + bool has_rtc_timers; 56 50 }; 57 51 58 52 static int bd70528_set_wake(struct rohm_regmap_dev *bd70528, ··· 133 123 { 134 124 int ret; 135 125 136 - ret = bd70528_wdt_set(r->mfd, new_state & BD70528_WDT_STATE_BIT, 126 + ret = bd70528_wdt_set(r->parent, new_state & BD70528_WDT_STATE_BIT, 137 127 old_state); 138 128 if (ret) { 139 129 dev_err(r->dev, 140 130 "Failed to disable WDG for RTC setting (%d)\n", ret); 141 131 return ret; 142 132 } 143 - ret = bd70528_set_elapsed_tmr(r->mfd, 133 + ret = bd70528_set_elapsed_tmr(r->parent, 144 134 new_state & BD70528_ELAPSED_STATE_BIT, 145 135 old_state); 146 136 if (ret) { ··· 148 138 "Failed to disable 'elapsed timer' for RTC setting\n"); 149 139 return ret; 150 140 } 151 - ret = bd70528_set_wake(r->mfd, new_state & BD70528_WAKE_STATE_BIT, 141 + ret = bd70528_set_wake(r->parent, new_state & BD70528_WAKE_STATE_BIT, 152 142 old_state); 153 143 if (ret) { 154 144 dev_err(r->dev, ··· 162 152 static int bd70528_re_enable_rtc_based_timers(struct bd70528_rtc *r, 163 153 int old_state) 164 154 { 155 + if (!r->has_rtc_timers) 156 + return 0; 157 + 165 158 return bd70528_set_rtc_based_timers(r, old_state, NULL); 166 159 } 167 160 168 161 static int bd70528_disable_rtc_based_timers(struct bd70528_rtc *r, 169 162 int *old_state) 170 163 { 164 + if (!r->has_rtc_timers) 165 + return 0; 166 + 171 167 return bd70528_set_rtc_based_timers(r, 0, old_state); 172 168 } 173 169 ··· 229 213 t->tm_wday = bcd2bin(r->week & BD70528_MASK_RTC_WEEK); 230 214 } 231 215 216 + static int bd71828_set_alarm(struct device *dev, struct rtc_wkalrm *a) 217 + { 218 + int ret; 219 + struct bd71828_rtc_alm alm; 220 + struct bd70528_rtc *r = dev_get_drvdata(dev); 221 + struct rohm_regmap_dev *parent = r->parent; 222 + 223 + ret = regmap_bulk_read(parent->regmap, BD71828_REG_RTC_ALM_START, 224 + &alm, sizeof(alm)); 225 + if (ret) { 226 + dev_err(dev, "Failed to read alarm regs\n"); 227 + return ret; 228 + } 229 + 230 + tm2rtc(&a->time, &alm.alm0); 231 + 232 + if (!a->enabled) 233 + alm.alm_mask &= ~BD70528_MASK_ALM_EN; 234 + else 235 + alm.alm_mask |= BD70528_MASK_ALM_EN; 236 + 237 + ret = regmap_bulk_write(parent->regmap, BD71828_REG_RTC_ALM_START, 238 + &alm, sizeof(alm)); 239 + if (ret) 240 + dev_err(dev, "Failed to set alarm time\n"); 241 + 242 + return ret; 243 + 244 + } 245 + 232 246 static int bd70528_set_alarm(struct device *dev, struct rtc_wkalrm *a) 233 247 { 234 248 struct bd70528_rtc_wake wake; 235 249 struct bd70528_rtc_alm alm; 236 250 int ret; 237 251 struct bd70528_rtc *r = dev_get_drvdata(dev); 238 - struct rohm_regmap_dev *bd70528 = r->mfd; 252 + struct rohm_regmap_dev *parent = r->parent; 239 253 240 - ret = regmap_bulk_read(bd70528->regmap, BD70528_REG_RTC_WAKE_START, 254 + ret = regmap_bulk_read(parent->regmap, BD70528_REG_RTC_WAKE_START, 241 255 &wake, sizeof(wake)); 242 256 if (ret) { 243 257 dev_err(dev, "Failed to read wake regs\n"); 244 258 return ret; 245 259 } 246 260 247 - ret = regmap_bulk_read(bd70528->regmap, BD70528_REG_RTC_ALM_START, 261 + ret = regmap_bulk_read(parent->regmap, BD70528_REG_RTC_ALM_START, 248 262 &alm, sizeof(alm)); 249 263 if (ret) { 250 264 dev_err(dev, "Failed to read alarm regs\n"); ··· 292 246 wake.ctrl &= ~BD70528_MASK_WAKE_EN; 293 247 } 294 248 295 - ret = regmap_bulk_write(bd70528->regmap, 249 + ret = regmap_bulk_write(parent->regmap, 296 250 BD70528_REG_RTC_WAKE_START, &wake, 297 251 sizeof(wake)); 298 252 if (ret) { 299 253 dev_err(dev, "Failed to set wake time\n"); 300 254 return ret; 301 255 } 302 - ret = regmap_bulk_write(bd70528->regmap, BD70528_REG_RTC_ALM_START, 256 + ret = regmap_bulk_write(parent->regmap, BD70528_REG_RTC_ALM_START, 303 257 &alm, sizeof(alm)); 304 258 if (ret) 305 259 dev_err(dev, "Failed to set alarm time\n"); ··· 307 261 return ret; 308 262 } 309 263 264 + static int bd71828_read_alarm(struct device *dev, struct rtc_wkalrm *a) 265 + { 266 + int ret; 267 + struct bd71828_rtc_alm alm; 268 + struct bd70528_rtc *r = dev_get_drvdata(dev); 269 + struct rohm_regmap_dev *parent = r->parent; 270 + 271 + ret = regmap_bulk_read(parent->regmap, BD71828_REG_RTC_ALM_START, 272 + &alm, sizeof(alm)); 273 + if (ret) { 274 + dev_err(dev, "Failed to read alarm regs\n"); 275 + return ret; 276 + } 277 + 278 + rtc2tm(&alm.alm0, &a->time); 279 + a->time.tm_mday = -1; 280 + a->time.tm_mon = -1; 281 + a->time.tm_year = -1; 282 + a->enabled = !!(alm.alm_mask & BD70528_MASK_ALM_EN); 283 + a->pending = 0; 284 + 285 + return 0; 286 + } 287 + 310 288 static int bd70528_read_alarm(struct device *dev, struct rtc_wkalrm *a) 311 289 { 312 290 struct bd70528_rtc_alm alm; 313 291 int ret; 314 292 struct bd70528_rtc *r = dev_get_drvdata(dev); 315 - struct rohm_regmap_dev *bd70528 = r->mfd; 293 + struct rohm_regmap_dev *parent = r->parent; 316 294 317 - ret = regmap_bulk_read(bd70528->regmap, BD70528_REG_RTC_ALM_START, 295 + ret = regmap_bulk_read(parent->regmap, BD70528_REG_RTC_ALM_START, 318 296 &alm, sizeof(alm)); 319 297 if (ret) { 320 298 dev_err(dev, "Failed to read alarm regs\n"); ··· 360 290 int ret, tmpret, old_states; 361 291 struct bd70528_rtc_data rtc_data; 362 292 struct bd70528_rtc *r = dev_get_drvdata(dev); 363 - struct rohm_regmap_dev *bd70528 = r->mfd; 293 + struct rohm_regmap_dev *parent = r->parent; 364 294 365 295 ret = bd70528_disable_rtc_based_timers(r, &old_states); 366 296 if (ret) 367 297 return ret; 368 298 369 - tmpret = regmap_bulk_read(bd70528->regmap, 370 - BD70528_REG_RTC_START, &rtc_data, 299 + tmpret = regmap_bulk_read(parent->regmap, 300 + r->reg_time_start, &rtc_data, 371 301 sizeof(rtc_data)); 372 302 if (tmpret) { 373 303 dev_err(dev, "Failed to read RTC time registers\n"); ··· 375 305 } 376 306 tm2rtc(t, &rtc_data); 377 307 378 - tmpret = regmap_bulk_write(bd70528->regmap, 379 - BD70528_REG_RTC_START, &rtc_data, 308 + tmpret = regmap_bulk_write(parent->regmap, 309 + r->reg_time_start, &rtc_data, 380 310 sizeof(rtc_data)); 381 311 if (tmpret) { 382 312 dev_err(dev, "Failed to set RTC time\n"); ··· 391 321 return ret; 392 322 } 393 323 324 + static int bd71828_set_time(struct device *dev, struct rtc_time *t) 325 + { 326 + return bd70528_set_time_locked(dev, t); 327 + } 328 + 394 329 static int bd70528_set_time(struct device *dev, struct rtc_time *t) 395 330 { 396 331 int ret; 397 332 struct bd70528_rtc *r = dev_get_drvdata(dev); 398 333 399 - bd70528_wdt_lock(r->mfd); 334 + bd70528_wdt_lock(r->parent); 400 335 ret = bd70528_set_time_locked(dev, t); 401 - bd70528_wdt_unlock(r->mfd); 336 + bd70528_wdt_unlock(r->parent); 402 337 return ret; 403 338 } 404 339 405 340 static int bd70528_get_time(struct device *dev, struct rtc_time *t) 406 341 { 407 342 struct bd70528_rtc *r = dev_get_drvdata(dev); 408 - struct rohm_regmap_dev *bd70528 = r->mfd; 343 + struct rohm_regmap_dev *parent = r->parent; 409 344 struct bd70528_rtc_data rtc_data; 410 345 int ret; 411 346 412 347 /* read the RTC date and time registers all at once */ 413 - ret = regmap_bulk_read(bd70528->regmap, 414 - BD70528_REG_RTC_START, &rtc_data, 348 + ret = regmap_bulk_read(parent->regmap, 349 + r->reg_time_start, &rtc_data, 415 350 sizeof(rtc_data)); 416 351 if (ret) { 417 352 dev_err(dev, "Failed to read RTC time (err %d)\n", ret); ··· 437 362 if (enabled) 438 363 enableval = 0; 439 364 440 - bd70528_wdt_lock(r->mfd); 441 - ret = bd70528_set_wake(r->mfd, enabled, NULL); 365 + bd70528_wdt_lock(r->parent); 366 + ret = bd70528_set_wake(r->parent, enabled, NULL); 442 367 if (ret) { 443 368 dev_err(dev, "Failed to change wake state\n"); 444 369 goto out_unlock; 445 370 } 446 - ret = regmap_update_bits(r->mfd->regmap, BD70528_REG_RTC_ALM_MASK, 371 + ret = regmap_update_bits(r->parent->regmap, BD70528_REG_RTC_ALM_MASK, 447 372 BD70528_MASK_ALM_EN, enableval); 448 373 if (ret) 449 374 dev_err(dev, "Failed to change alarm state\n"); 450 375 451 376 out_unlock: 452 - bd70528_wdt_unlock(r->mfd); 377 + bd70528_wdt_unlock(r->parent); 378 + return ret; 379 + } 380 + 381 + static int bd71828_alm_enable(struct device *dev, unsigned int enabled) 382 + { 383 + int ret; 384 + struct bd70528_rtc *r = dev_get_drvdata(dev); 385 + unsigned int enableval = BD70528_MASK_ALM_EN; 386 + 387 + if (!enabled) 388 + enableval = 0; 389 + 390 + ret = regmap_update_bits(r->parent->regmap, BD71828_REG_RTC_ALM0_MASK, 391 + BD70528_MASK_ALM_EN, enableval); 392 + if (ret) 393 + dev_err(dev, "Failed to change alarm state\n"); 394 + 453 395 return ret; 454 396 } 455 397 ··· 476 384 .read_alarm = bd70528_read_alarm, 477 385 .set_alarm = bd70528_set_alarm, 478 386 .alarm_irq_enable = bd70528_alm_enable, 387 + }; 388 + 389 + static const struct rtc_class_ops bd71828_rtc_ops = { 390 + .read_time = bd70528_get_time, 391 + .set_time = bd71828_set_time, 392 + .read_alarm = bd71828_read_alarm, 393 + .set_alarm = bd71828_set_alarm, 394 + .alarm_irq_enable = bd71828_alm_enable, 479 395 }; 480 396 481 397 static irqreturn_t alm_hndlr(int irq, void *data) ··· 497 397 static int bd70528_probe(struct platform_device *pdev) 498 398 { 499 399 struct bd70528_rtc *bd_rtc; 500 - struct rohm_regmap_dev *mfd; 400 + const struct rtc_class_ops *rtc_ops; 401 + struct rohm_regmap_dev *parent; 402 + const char *irq_name; 501 403 int ret; 502 404 struct rtc_device *rtc; 503 405 int irq; 504 406 unsigned int hr; 407 + bool enable_main_irq = false; 408 + u8 hour_reg; 409 + enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; 505 410 506 - mfd = dev_get_drvdata(pdev->dev.parent); 507 - if (!mfd) { 411 + parent = dev_get_drvdata(pdev->dev.parent); 412 + if (!parent) { 508 413 dev_err(&pdev->dev, "No MFD driver data\n"); 509 414 return -EINVAL; 510 415 } ··· 517 412 if (!bd_rtc) 518 413 return -ENOMEM; 519 414 520 - bd_rtc->mfd = mfd; 415 + bd_rtc->parent = parent; 521 416 bd_rtc->dev = &pdev->dev; 522 417 523 - irq = platform_get_irq_byname(pdev, "bd70528-rtc-alm"); 524 - if (irq < 0) 418 + switch (chip) { 419 + case ROHM_CHIP_TYPE_BD70528: 420 + irq_name = "bd70528-rtc-alm"; 421 + bd_rtc->has_rtc_timers = true; 422 + bd_rtc->reg_time_start = BD70528_REG_RTC_START; 423 + hour_reg = BD70528_REG_RTC_HOUR; 424 + enable_main_irq = true; 425 + rtc_ops = &bd70528_rtc_ops; 426 + break; 427 + case ROHM_CHIP_TYPE_BD71828: 428 + irq_name = "bd71828-rtc-alm-0"; 429 + bd_rtc->reg_time_start = BD71828_REG_RTC_START; 430 + hour_reg = BD71828_REG_RTC_HOUR; 431 + rtc_ops = &bd71828_rtc_ops; 432 + break; 433 + default: 434 + dev_err(&pdev->dev, "Unknown chip\n"); 435 + return -ENOENT; 436 + } 437 + 438 + irq = platform_get_irq_byname(pdev, irq_name); 439 + 440 + if (irq < 0) { 441 + dev_err(&pdev->dev, "Failed to get irq\n"); 525 442 return irq; 443 + } 526 444 527 445 platform_set_drvdata(pdev, bd_rtc); 528 446 529 - ret = regmap_read(mfd->regmap, BD70528_REG_RTC_HOUR, &hr); 447 + ret = regmap_read(parent->regmap, hour_reg, &hr); 530 448 531 449 if (ret) { 532 450 dev_err(&pdev->dev, "Failed to reag RTC clock\n"); ··· 559 431 if (!(hr & BD70528_MASK_RTC_HOUR_24H)) { 560 432 struct rtc_time t; 561 433 562 - ret = bd70528_get_time(&pdev->dev, &t); 434 + ret = rtc_ops->read_time(&pdev->dev, &t); 563 435 564 436 if (!ret) 565 - ret = bd70528_set_time(&pdev->dev, &t); 437 + ret = rtc_ops->set_time(&pdev->dev, &t); 566 438 567 439 if (ret) { 568 440 dev_err(&pdev->dev, ··· 582 454 583 455 rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; 584 456 rtc->range_max = RTC_TIMESTAMP_END_2099; 585 - rtc->ops = &bd70528_rtc_ops; 457 + rtc->ops = rtc_ops; 586 458 587 459 /* Request alarm IRQ prior to registerig the RTC */ 588 460 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, &alm_hndlr, ··· 596 468 * leave them enabled as irq-controller should disable irqs 597 469 * from sub-registers when IRQ is disabled or freed. 598 470 */ 599 - ret = regmap_update_bits(mfd->regmap, 471 + if (enable_main_irq) { 472 + ret = regmap_update_bits(parent->regmap, 600 473 BD70528_REG_INT_MAIN_MASK, 601 474 BD70528_INT_RTC_MASK, 0); 602 - if (ret) { 603 - dev_err(&pdev->dev, "Failed to enable RTC interrupts\n"); 604 - return ret; 475 + if (ret) { 476 + dev_err(&pdev->dev, "Failed to enable RTC interrupts\n"); 477 + return ret; 478 + } 605 479 } 606 480 607 481 return rtc_register_device(rtc); 608 482 } 483 + 484 + static const struct platform_device_id bd718x7_rtc_id[] = { 485 + { "bd70528-rtc", ROHM_CHIP_TYPE_BD70528 }, 486 + { "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 }, 487 + { }, 488 + }; 489 + MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id); 609 490 610 491 static struct platform_driver bd70528_rtc = { 611 492 .driver = { 612 493 .name = "bd70528-rtc" 613 494 }, 614 495 .probe = bd70528_probe, 496 + .id_table = bd718x7_rtc_id, 615 497 }; 616 498 617 499 module_platform_driver(bd70528_rtc); 618 500 619 501 MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>"); 620 - MODULE_DESCRIPTION("BD70528 RTC driver"); 502 + MODULE_DESCRIPTION("ROHM BD70528 and BD71828 PMIC RTC driver"); 621 503 MODULE_LICENSE("GPL"); 622 504 MODULE_ALIAS("platform:bd70528-rtc");
-18
include/linux/mfd/db8500-prcmu.h
··· 525 525 void db8500_prcmu_enable_wakeups(u32 wakeups); 526 526 int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); 527 527 int db8500_prcmu_request_clock(u8 clock, bool enable); 528 - int db8500_prcmu_set_display_clocks(void); 529 - int db8500_prcmu_disable_dsipll(void); 530 - int db8500_prcmu_enable_dsipll(void); 531 528 void db8500_prcmu_config_abb_event_readout(u32 abb_events); 532 529 void db8500_prcmu_get_abb_event_buffer(void __iomem **buf); 533 530 int db8500_prcmu_config_esram0_deep_sleep(u8 state); ··· 675 678 } 676 679 677 680 static inline int db8500_prcmu_request_clock(u8 clock, bool enable) 678 - { 679 - return 0; 680 - } 681 - 682 - static inline int db8500_prcmu_set_display_clocks(void) 683 - { 684 - return 0; 685 - } 686 - 687 - static inline int db8500_prcmu_disable_dsipll(void) 688 - { 689 - return 0; 690 - } 691 - 692 - static inline int db8500_prcmu_enable_dsipll(void) 693 681 { 694 682 return 0; 695 683 }
-30
include/linux/mfd/dbx500-prcmu.h
··· 321 321 return db8500_prcmu_is_ac_wake_requested(); 322 322 } 323 323 324 - static inline int prcmu_set_display_clocks(void) 325 - { 326 - return db8500_prcmu_set_display_clocks(); 327 - } 328 - 329 - static inline int prcmu_disable_dsipll(void) 330 - { 331 - return db8500_prcmu_disable_dsipll(); 332 - } 333 - 334 - static inline int prcmu_enable_dsipll(void) 335 - { 336 - return db8500_prcmu_enable_dsipll(); 337 - } 338 - 339 324 static inline int prcmu_config_esram0_deep_sleep(u8 state) 340 325 { 341 326 return db8500_prcmu_config_esram0_deep_sleep(state); ··· 494 509 static inline bool prcmu_is_ac_wake_requested(void) 495 510 { 496 511 return false; 497 - } 498 - 499 - static inline int prcmu_set_display_clocks(void) 500 - { 501 - return 0; 502 - } 503 - 504 - static inline int prcmu_disable_dsipll(void) 505 - { 506 - return 0; 507 - } 508 - 509 - static inline int prcmu_enable_dsipll(void) 510 - { 511 - return 0; 512 512 } 513 513 514 514 static inline int prcmu_config_esram0_deep_sleep(u8 state)
+1 -18
include/linux/mfd/rohm-bd70528.h
··· 7 7 #include <linux/bits.h> 8 8 #include <linux/device.h> 9 9 #include <linux/mfd/rohm-generic.h> 10 + #include <linux/mfd/rohm-shared.h> 10 11 #include <linux/regmap.h> 11 12 12 13 enum { ··· 89 88 #define BD70528_REG_GPIO2_OUT 0x50 90 89 #define BD70528_REG_GPIO3_OUT 0x52 91 90 #define BD70528_REG_GPIO4_OUT 0x54 92 - 93 - /* clk control */ 94 - 95 - #define BD70528_REG_CLK_OUT 0x2c 96 91 97 92 /* RTC */ 98 93 ··· 306 309 307 310 #define BD70528_GPIO_IN_STATE_BASE 1 308 311 309 - #define BD70528_CLK_OUT_EN_MASK 0x1 310 - 311 312 /* RTC masks to mask out reserved bits */ 312 - 313 - #define BD70528_MASK_RTC_SEC 0x7f 314 - #define BD70528_MASK_RTC_MINUTE 0x7f 315 - #define BD70528_MASK_RTC_HOUR_24H 0x80 316 - #define BD70528_MASK_RTC_HOUR_PM 0x20 317 - #define BD70528_MASK_RTC_HOUR 0x1f 318 - #define BD70528_MASK_RTC_DAY 0x3f 319 - #define BD70528_MASK_RTC_WEEK 0x07 320 - #define BD70528_MASK_RTC_MONTH 0x1f 321 - #define BD70528_MASK_RTC_YEAR 0xff 322 - #define BD70528_MASK_RTC_COUNT_L 0x7f 323 313 324 314 #define BD70528_MASK_ELAPSED_TIMER_EN 0x1 325 315 /* Mask second, min and hour fields ··· 316 332 * wake-up we limit ALM to 24H and only 317 333 * unmask sec, min and hour 318 334 */ 319 - #define BD70528_MASK_ALM_EN 0x7 320 335 #define BD70528_MASK_WAKE_EN 0x1 321 336 322 337 /* WDT masks */
+423
include/linux/mfd/rohm-bd71828.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* Copyright (C) 2019 ROHM Semiconductors */ 3 + 4 + #ifndef __LINUX_MFD_BD71828_H__ 5 + #define __LINUX_MFD_BD71828_H__ 6 + 7 + #include <linux/mfd/rohm-generic.h> 8 + #include <linux/mfd/rohm-shared.h> 9 + 10 + /* Regulator IDs */ 11 + enum { 12 + BD71828_BUCK1, 13 + BD71828_BUCK2, 14 + BD71828_BUCK3, 15 + BD71828_BUCK4, 16 + BD71828_BUCK5, 17 + BD71828_BUCK6, 18 + BD71828_BUCK7, 19 + BD71828_LDO1, 20 + BD71828_LDO2, 21 + BD71828_LDO3, 22 + BD71828_LDO4, 23 + BD71828_LDO5, 24 + BD71828_LDO6, 25 + BD71828_LDO_SNVS, 26 + BD71828_REGULATOR_AMOUNT, 27 + }; 28 + 29 + #define BD71828_BUCK1267_VOLTS 0xEF 30 + #define BD71828_BUCK3_VOLTS 0x10 31 + #define BD71828_BUCK4_VOLTS 0x20 32 + #define BD71828_BUCK5_VOLTS 0x10 33 + #define BD71828_LDO_VOLTS 0x32 34 + /* LDO6 is fixed 1.8V voltage */ 35 + #define BD71828_LDO_6_VOLTAGE 1800000 36 + 37 + /* Registers and masks*/ 38 + 39 + /* MODE control */ 40 + #define BD71828_REG_PS_CTRL_1 0x04 41 + #define BD71828_REG_PS_CTRL_2 0x05 42 + #define BD71828_REG_PS_CTRL_3 0x06 43 + 44 + //#define BD71828_REG_SWRESET 0x06 45 + #define BD71828_MASK_RUN_LVL_CTRL 0x30 46 + 47 + /* Regulator control masks */ 48 + 49 + #define BD71828_MASK_RAMP_DELAY 0x6 50 + 51 + #define BD71828_MASK_RUN_EN 0x08 52 + #define BD71828_MASK_SUSP_EN 0x04 53 + #define BD71828_MASK_IDLE_EN 0x02 54 + #define BD71828_MASK_LPSR_EN 0x01 55 + 56 + #define BD71828_MASK_RUN0_EN 0x01 57 + #define BD71828_MASK_RUN1_EN 0x02 58 + #define BD71828_MASK_RUN2_EN 0x04 59 + #define BD71828_MASK_RUN3_EN 0x08 60 + 61 + #define BD71828_MASK_DVS_BUCK1_CTRL 0x10 62 + #define BD71828_DVS_BUCK1_CTRL_I2C 0 63 + #define BD71828_DVS_BUCK1_USE_RUNLVL 0x10 64 + 65 + #define BD71828_MASK_DVS_BUCK2_CTRL 0x20 66 + #define BD71828_DVS_BUCK2_CTRL_I2C 0 67 + #define BD71828_DVS_BUCK2_USE_RUNLVL 0x20 68 + 69 + #define BD71828_MASK_DVS_BUCK6_CTRL 0x40 70 + #define BD71828_DVS_BUCK6_CTRL_I2C 0 71 + #define BD71828_DVS_BUCK6_USE_RUNLVL 0x40 72 + 73 + #define BD71828_MASK_DVS_BUCK7_CTRL 0x80 74 + #define BD71828_DVS_BUCK7_CTRL_I2C 0 75 + #define BD71828_DVS_BUCK7_USE_RUNLVL 0x80 76 + 77 + #define BD71828_MASK_BUCK1267_VOLT 0xff 78 + #define BD71828_MASK_BUCK3_VOLT 0x1f 79 + #define BD71828_MASK_BUCK4_VOLT 0x3f 80 + #define BD71828_MASK_BUCK5_VOLT 0x1f 81 + #define BD71828_MASK_LDO_VOLT 0x3f 82 + 83 + /* Regulator control regs */ 84 + #define BD71828_REG_BUCK1_EN 0x08 85 + #define BD71828_REG_BUCK1_CTRL 0x09 86 + #define BD71828_REG_BUCK1_MODE 0x0a 87 + #define BD71828_REG_BUCK1_IDLE_VOLT 0x0b 88 + #define BD71828_REG_BUCK1_SUSP_VOLT 0x0c 89 + #define BD71828_REG_BUCK1_VOLT 0x0d 90 + 91 + #define BD71828_REG_BUCK2_EN 0x12 92 + #define BD71828_REG_BUCK2_CTRL 0x13 93 + #define BD71828_REG_BUCK2_MODE 0x14 94 + #define BD71828_REG_BUCK2_IDLE_VOLT 0x15 95 + #define BD71828_REG_BUCK2_SUSP_VOLT 0x16 96 + #define BD71828_REG_BUCK2_VOLT 0x17 97 + 98 + #define BD71828_REG_BUCK3_EN 0x1c 99 + #define BD71828_REG_BUCK3_MODE 0x1d 100 + #define BD71828_REG_BUCK3_VOLT 0x1e 101 + 102 + #define BD71828_REG_BUCK4_EN 0x1f 103 + #define BD71828_REG_BUCK4_MODE 0x20 104 + #define BD71828_REG_BUCK4_VOLT 0x21 105 + 106 + #define BD71828_REG_BUCK5_EN 0x22 107 + #define BD71828_REG_BUCK5_MODE 0x23 108 + #define BD71828_REG_BUCK5_VOLT 0x24 109 + 110 + #define BD71828_REG_BUCK6_EN 0x25 111 + #define BD71828_REG_BUCK6_CTRL 0x26 112 + #define BD71828_REG_BUCK6_MODE 0x27 113 + #define BD71828_REG_BUCK6_IDLE_VOLT 0x28 114 + #define BD71828_REG_BUCK6_SUSP_VOLT 0x29 115 + #define BD71828_REG_BUCK6_VOLT 0x2a 116 + 117 + #define BD71828_REG_BUCK7_EN 0x2f 118 + #define BD71828_REG_BUCK7_CTRL 0x30 119 + #define BD71828_REG_BUCK7_MODE 0x31 120 + #define BD71828_REG_BUCK7_IDLE_VOLT 0x32 121 + #define BD71828_REG_BUCK7_SUSP_VOLT 0x33 122 + #define BD71828_REG_BUCK7_VOLT 0x34 123 + 124 + #define BD71828_REG_LDO1_EN 0x39 125 + #define BD71828_REG_LDO1_VOLT 0x3a 126 + #define BD71828_REG_LDO2_EN 0x3b 127 + #define BD71828_REG_LDO2_VOLT 0x3c 128 + #define BD71828_REG_LDO3_EN 0x3d 129 + #define BD71828_REG_LDO3_VOLT 0x3e 130 + #define BD71828_REG_LDO4_EN 0x3f 131 + #define BD71828_REG_LDO4_VOLT 0x40 132 + #define BD71828_REG_LDO5_EN 0x41 133 + #define BD71828_REG_LDO5_VOLT 0x43 134 + #define BD71828_REG_LDO5_VOLT_OPT 0x42 135 + #define BD71828_REG_LDO6_EN 0x44 136 + //#define BD71828_REG_LDO6_VOLT 0x4 137 + #define BD71828_REG_LDO7_EN 0x45 138 + #define BD71828_REG_LDO7_VOLT 0x46 139 + 140 + /* GPIO */ 141 + 142 + #define BD71828_GPIO_DRIVE_MASK 0x2 143 + #define BD71828_GPIO_OPEN_DRAIN 0x0 144 + #define BD71828_GPIO_PUSH_PULL 0x2 145 + #define BD71828_GPIO_OUT_HI 0x1 146 + #define BD71828_GPIO_OUT_LO 0x0 147 + #define BD71828_GPIO_OUT_MASK 0x1 148 + 149 + #define BD71828_REG_GPIO_CTRL1 0x47 150 + #define BD71828_REG_GPIO_CTRL2 0x48 151 + #define BD71828_REG_GPIO_CTRL3 0x49 152 + #define BD71828_REG_IO_STAT 0xed 153 + 154 + /* RTC */ 155 + #define BD71828_REG_RTC_SEC 0x4c 156 + #define BD71828_REG_RTC_MINUTE 0x4d 157 + #define BD71828_REG_RTC_HOUR 0x4e 158 + #define BD71828_REG_RTC_WEEK 0x4f 159 + #define BD71828_REG_RTC_DAY 0x50 160 + #define BD71828_REG_RTC_MONTH 0x51 161 + #define BD71828_REG_RTC_YEAR 0x52 162 + 163 + #define BD71828_REG_RTC_ALM0_SEC 0x53 164 + #define BD71828_REG_RTC_ALM_START BD71828_REG_RTC_ALM0_SEC 165 + #define BD71828_REG_RTC_ALM0_MINUTE 0x54 166 + #define BD71828_REG_RTC_ALM0_HOUR 0x55 167 + #define BD71828_REG_RTC_ALM0_WEEK 0x56 168 + #define BD71828_REG_RTC_ALM0_DAY 0x57 169 + #define BD71828_REG_RTC_ALM0_MONTH 0x58 170 + #define BD71828_REG_RTC_ALM0_YEAR 0x59 171 + #define BD71828_REG_RTC_ALM0_MASK 0x61 172 + 173 + #define BD71828_REG_RTC_ALM1_SEC 0x5a 174 + #define BD71828_REG_RTC_ALM1_MINUTE 0x5b 175 + #define BD71828_REG_RTC_ALM1_HOUR 0x5c 176 + #define BD71828_REG_RTC_ALM1_WEEK 0x5d 177 + #define BD71828_REG_RTC_ALM1_DAY 0x5e 178 + #define BD71828_REG_RTC_ALM1_MONTH 0x5f 179 + #define BD71828_REG_RTC_ALM1_YEAR 0x60 180 + #define BD71828_REG_RTC_ALM1_MASK 0x62 181 + 182 + #define BD71828_REG_RTC_ALM2 0x63 183 + #define BD71828_REG_RTC_START BD71828_REG_RTC_SEC 184 + 185 + /* Charger/Battey */ 186 + #define BD71828_REG_CHG_STATE 0x65 187 + #define BD71828_REG_CHG_FULL 0xd2 188 + 189 + /* LEDs */ 190 + #define BD71828_REG_LED_CTRL 0x4A 191 + #define BD71828_MASK_LED_AMBER 0x80 192 + #define BD71828_MASK_LED_GREEN 0x40 193 + #define BD71828_LED_ON 0xff 194 + #define BD71828_LED_OFF 0x0 195 + 196 + /* IRQ registers */ 197 + #define BD71828_REG_INT_MASK_BUCK 0xd3 198 + #define BD71828_REG_INT_MASK_DCIN1 0xd4 199 + #define BD71828_REG_INT_MASK_DCIN2 0xd5 200 + #define BD71828_REG_INT_MASK_VSYS 0xd6 201 + #define BD71828_REG_INT_MASK_CHG 0xd7 202 + #define BD71828_REG_INT_MASK_BAT 0xd8 203 + #define BD71828_REG_INT_MASK_BAT_MON1 0xd9 204 + #define BD71828_REG_INT_MASK_BAT_MON2 0xda 205 + #define BD71828_REG_INT_MASK_BAT_MON3 0xdb 206 + #define BD71828_REG_INT_MASK_BAT_MON4 0xdc 207 + #define BD71828_REG_INT_MASK_TEMP 0xdd 208 + #define BD71828_REG_INT_MASK_RTC 0xde 209 + 210 + #define BD71828_REG_INT_MAIN 0xdf 211 + #define BD71828_REG_INT_BUCK 0xe0 212 + #define BD71828_REG_INT_DCIN1 0xe1 213 + #define BD71828_REG_INT_DCIN2 0xe2 214 + #define BD71828_REG_INT_VSYS 0xe3 215 + #define BD71828_REG_INT_CHG 0xe4 216 + #define BD71828_REG_INT_BAT 0xe5 217 + #define BD71828_REG_INT_BAT_MON1 0xe6 218 + #define BD71828_REG_INT_BAT_MON2 0xe7 219 + #define BD71828_REG_INT_BAT_MON3 0xe8 220 + #define BD71828_REG_INT_BAT_MON4 0xe9 221 + #define BD71828_REG_INT_TEMP 0xea 222 + #define BD71828_REG_INT_RTC 0xeb 223 + #define BD71828_REG_INT_UPDATE 0xec 224 + 225 + #define BD71828_MAX_REGISTER BD71828_REG_IO_STAT 226 + 227 + /* Masks for main IRQ register bits */ 228 + enum { 229 + BD71828_INT_BUCK, 230 + #define BD71828_INT_BUCK_MASK BIT(BD71828_INT_BUCK) 231 + BD71828_INT_DCIN, 232 + #define BD71828_INT_DCIN_MASK BIT(BD71828_INT_DCIN) 233 + BD71828_INT_VSYS, 234 + #define BD71828_INT_VSYS_MASK BIT(BD71828_INT_VSYS) 235 + BD71828_INT_CHG, 236 + #define BD71828_INT_CHG_MASK BIT(BD71828_INT_CHG) 237 + BD71828_INT_BAT, 238 + #define BD71828_INT_BAT_MASK BIT(BD71828_INT_BAT) 239 + BD71828_INT_BAT_MON, 240 + #define BD71828_INT_BAT_MON_MASK BIT(BD71828_INT_BAT_MON) 241 + BD71828_INT_TEMP, 242 + #define BD71828_INT_TEMP_MASK BIT(BD71828_INT_TEMP) 243 + BD71828_INT_RTC, 244 + #define BD71828_INT_RTC_MASK BIT(BD71828_INT_RTC) 245 + }; 246 + 247 + /* Interrupts */ 248 + enum { 249 + /* BUCK reg interrupts */ 250 + BD71828_INT_BUCK1_OCP, 251 + BD71828_INT_BUCK2_OCP, 252 + BD71828_INT_BUCK3_OCP, 253 + BD71828_INT_BUCK4_OCP, 254 + BD71828_INT_BUCK5_OCP, 255 + BD71828_INT_BUCK6_OCP, 256 + BD71828_INT_BUCK7_OCP, 257 + BD71828_INT_PGFAULT, 258 + /* DCIN1 interrupts */ 259 + BD71828_INT_DCIN_DET, 260 + BD71828_INT_DCIN_RMV, 261 + BD71828_INT_CLPS_OUT, 262 + BD71828_INT_CLPS_IN, 263 + /* DCIN2 interrupts */ 264 + BD71828_INT_DCIN_MON_RES, 265 + BD71828_INT_DCIN_MON_DET, 266 + BD71828_INT_LONGPUSH, 267 + BD71828_INT_MIDPUSH, 268 + BD71828_INT_SHORTPUSH, 269 + BD71828_INT_PUSH, 270 + BD71828_INT_WDOG, 271 + BD71828_INT_SWRESET, 272 + /* Vsys */ 273 + BD71828_INT_VSYS_UV_RES, 274 + BD71828_INT_VSYS_UV_DET, 275 + BD71828_INT_VSYS_LOW_RES, 276 + BD71828_INT_VSYS_LOW_DET, 277 + BD71828_INT_VSYS_HALL_IN, 278 + BD71828_INT_VSYS_HALL_TOGGLE, 279 + BD71828_INT_VSYS_MON_RES, 280 + BD71828_INT_VSYS_MON_DET, 281 + /* Charger */ 282 + BD71828_INT_CHG_DCIN_ILIM, 283 + BD71828_INT_CHG_TOPOFF_TO_DONE, 284 + BD71828_INT_CHG_WDG_TEMP, 285 + BD71828_INT_CHG_WDG_TIME, 286 + BD71828_INT_CHG_RECHARGE_RES, 287 + BD71828_INT_CHG_RECHARGE_DET, 288 + BD71828_INT_CHG_RANGED_TEMP_TRANSITION, 289 + BD71828_INT_CHG_STATE_TRANSITION, 290 + /* Battery */ 291 + BD71828_INT_BAT_TEMP_NORMAL, 292 + BD71828_INT_BAT_TEMP_ERANGE, 293 + BD71828_INT_BAT_TEMP_WARN, 294 + BD71828_INT_BAT_REMOVED, 295 + BD71828_INT_BAT_DETECTED, 296 + BD71828_INT_THERM_REMOVED, 297 + BD71828_INT_THERM_DETECTED, 298 + /* Battery Mon 1 */ 299 + BD71828_INT_BAT_DEAD, 300 + BD71828_INT_BAT_SHORTC_RES, 301 + BD71828_INT_BAT_SHORTC_DET, 302 + BD71828_INT_BAT_LOW_VOLT_RES, 303 + BD71828_INT_BAT_LOW_VOLT_DET, 304 + BD71828_INT_BAT_OVER_VOLT_RES, 305 + BD71828_INT_BAT_OVER_VOLT_DET, 306 + /* Battery Mon 2 */ 307 + BD71828_INT_BAT_MON_RES, 308 + BD71828_INT_BAT_MON_DET, 309 + /* Battery Mon 3 (Coulomb counter) */ 310 + BD71828_INT_BAT_CC_MON1, 311 + BD71828_INT_BAT_CC_MON2, 312 + BD71828_INT_BAT_CC_MON3, 313 + /* Battery Mon 4 */ 314 + BD71828_INT_BAT_OVER_CURR_1_RES, 315 + BD71828_INT_BAT_OVER_CURR_1_DET, 316 + BD71828_INT_BAT_OVER_CURR_2_RES, 317 + BD71828_INT_BAT_OVER_CURR_2_DET, 318 + BD71828_INT_BAT_OVER_CURR_3_RES, 319 + BD71828_INT_BAT_OVER_CURR_3_DET, 320 + /* Temperature */ 321 + BD71828_INT_TEMP_BAT_LOW_RES, 322 + BD71828_INT_TEMP_BAT_LOW_DET, 323 + BD71828_INT_TEMP_BAT_HI_RES, 324 + BD71828_INT_TEMP_BAT_HI_DET, 325 + BD71828_INT_TEMP_CHIP_OVER_125_RES, 326 + BD71828_INT_TEMP_CHIP_OVER_125_DET, 327 + BD71828_INT_TEMP_CHIP_OVER_VF_DET, 328 + BD71828_INT_TEMP_CHIP_OVER_VF_RES, 329 + /* RTC Alarm */ 330 + BD71828_INT_RTC0, 331 + BD71828_INT_RTC1, 332 + BD71828_INT_RTC2, 333 + }; 334 + 335 + #define BD71828_INT_BUCK1_OCP_MASK 0x1 336 + #define BD71828_INT_BUCK2_OCP_MASK 0x2 337 + #define BD71828_INT_BUCK3_OCP_MASK 0x4 338 + #define BD71828_INT_BUCK4_OCP_MASK 0x8 339 + #define BD71828_INT_BUCK5_OCP_MASK 0x10 340 + #define BD71828_INT_BUCK6_OCP_MASK 0x20 341 + #define BD71828_INT_BUCK7_OCP_MASK 0x40 342 + #define BD71828_INT_PGFAULT_MASK 0x80 343 + 344 + #define BD71828_INT_DCIN_DET_MASK 0x1 345 + #define BD71828_INT_DCIN_RMV_MASK 0x2 346 + #define BD71828_INT_CLPS_OUT_MASK 0x4 347 + #define BD71828_INT_CLPS_IN_MASK 0x8 348 + /* DCIN2 interrupts */ 349 + #define BD71828_INT_DCIN_MON_RES_MASK 0x1 350 + #define BD71828_INT_DCIN_MON_DET_MASK 0x2 351 + #define BD71828_INT_LONGPUSH_MASK 0x4 352 + #define BD71828_INT_MIDPUSH_MASK 0x8 353 + #define BD71828_INT_SHORTPUSH_MASK 0x10 354 + #define BD71828_INT_PUSH_MASK 0x20 355 + #define BD71828_INT_WDOG_MASK 0x40 356 + #define BD71828_INT_SWRESET_MASK 0x80 357 + /* Vsys */ 358 + #define BD71828_INT_VSYS_UV_RES_MASK 0x1 359 + #define BD71828_INT_VSYS_UV_DET_MASK 0x2 360 + #define BD71828_INT_VSYS_LOW_RES_MASK 0x4 361 + #define BD71828_INT_VSYS_LOW_DET_MASK 0x8 362 + #define BD71828_INT_VSYS_HALL_IN_MASK 0x10 363 + #define BD71828_INT_VSYS_HALL_TOGGLE_MASK 0x20 364 + #define BD71828_INT_VSYS_MON_RES_MASK 0x40 365 + #define BD71828_INT_VSYS_MON_DET_MASK 0x80 366 + /* Charger */ 367 + #define BD71828_INT_CHG_DCIN_ILIM_MASK 0x1 368 + #define BD71828_INT_CHG_TOPOFF_TO_DONE_MASK 0x2 369 + #define BD71828_INT_CHG_WDG_TEMP_MASK 0x4 370 + #define BD71828_INT_CHG_WDG_TIME_MASK 0x8 371 + #define BD71828_INT_CHG_RECHARGE_RES_MASK 0x10 372 + #define BD71828_INT_CHG_RECHARGE_DET_MASK 0x20 373 + #define BD71828_INT_CHG_RANGED_TEMP_TRANSITION_MASK 0x40 374 + #define BD71828_INT_CHG_STATE_TRANSITION_MASK 0x80 375 + /* Battery */ 376 + #define BD71828_INT_BAT_TEMP_NORMAL_MASK 0x1 377 + #define BD71828_INT_BAT_TEMP_ERANGE_MASK 0x2 378 + #define BD71828_INT_BAT_TEMP_WARN_MASK 0x4 379 + #define BD71828_INT_BAT_REMOVED_MASK 0x10 380 + #define BD71828_INT_BAT_DETECTED_MASK 0x20 381 + #define BD71828_INT_THERM_REMOVED_MASK 0x40 382 + #define BD71828_INT_THERM_DETECTED_MASK 0x80 383 + /* Battery Mon 1 */ 384 + #define BD71828_INT_BAT_DEAD_MASK 0x2 385 + #define BD71828_INT_BAT_SHORTC_RES_MASK 0x4 386 + #define BD71828_INT_BAT_SHORTC_DET_MASK 0x8 387 + #define BD71828_INT_BAT_LOW_VOLT_RES_MASK 0x10 388 + #define BD71828_INT_BAT_LOW_VOLT_DET_MASK 0x20 389 + #define BD71828_INT_BAT_OVER_VOLT_RES_MASK 0x40 390 + #define BD71828_INT_BAT_OVER_VOLT_DET_MASK 0x80 391 + /* Battery Mon 2 */ 392 + #define BD71828_INT_BAT_MON_RES_MASK 0x1 393 + #define BD71828_INT_BAT_MON_DET_MASK 0x2 394 + /* Battery Mon 3 (Coulomb counter) */ 395 + #define BD71828_INT_BAT_CC_MON1_MASK 0x1 396 + #define BD71828_INT_BAT_CC_MON2_MASK 0x2 397 + #define BD71828_INT_BAT_CC_MON3_MASK 0x4 398 + /* Battery Mon 4 */ 399 + #define BD71828_INT_BAT_OVER_CURR_1_RES_MASK 0x1 400 + #define BD71828_INT_BAT_OVER_CURR_1_DET_MASK 0x2 401 + #define BD71828_INT_BAT_OVER_CURR_2_RES_MASK 0x4 402 + #define BD71828_INT_BAT_OVER_CURR_2_DET_MASK 0x8 403 + #define BD71828_INT_BAT_OVER_CURR_3_RES_MASK 0x10 404 + #define BD71828_INT_BAT_OVER_CURR_3_DET_MASK 0x20 405 + /* Temperature */ 406 + #define BD71828_INT_TEMP_BAT_LOW_RES_MASK 0x1 407 + #define BD71828_INT_TEMP_BAT_LOW_DET_MASK 0x2 408 + #define BD71828_INT_TEMP_BAT_HI_RES_MASK 0x4 409 + #define BD71828_INT_TEMP_BAT_HI_DET_MASK 0x8 410 + #define BD71828_INT_TEMP_CHIP_OVER_125_RES_MASK 0x10 411 + #define BD71828_INT_TEMP_CHIP_OVER_125_DET_MASK 0x20 412 + #define BD71828_INT_TEMP_CHIP_OVER_VF_RES_MASK 0x40 413 + #define BD71828_INT_TEMP_CHIP_OVER_VF_DET_MASK 0x80 414 + /* RTC Alarm */ 415 + #define BD71828_INT_RTC0_MASK 0x1 416 + #define BD71828_INT_RTC1_MASK 0x2 417 + #define BD71828_INT_RTC2_MASK 0x4 418 + 419 + #define BD71828_OUT_TYPE_MASK 0x2 420 + #define BD71828_OUT_TYPE_OPEN_DRAIN 0x0 421 + #define BD71828_OUT_TYPE_CMOS 0x2 422 + 423 + #endif /* __LINUX_MFD_BD71828_H__ */
-6
include/linux/mfd/rohm-bd718x7.h
··· 191 191 #define IRQ_ON_REQ 0x02 192 192 #define IRQ_STBY_REQ 0x01 193 193 194 - /* BD718XX_REG_OUT32K bits */ 195 - #define BD718XX_OUT32K_EN 0x01 196 - 197 - /* BD7183XX gated clock rate */ 198 - #define BD718XX_CLK_RATE 32768 199 - 200 194 /* ROHM BD718XX irqs */ 201 195 enum { 202 196 BD718XX_INT_STBY_REQ,
+68 -2
include/linux/mfd/rohm-generic.h
··· 4 4 #ifndef __LINUX_MFD_ROHM_H__ 5 5 #define __LINUX_MFD_ROHM_H__ 6 6 7 - enum { 7 + #include <linux/regmap.h> 8 + #include <linux/regulator/driver.h> 9 + 10 + enum rohm_chip_type { 8 11 ROHM_CHIP_TYPE_BD71837 = 0, 9 12 ROHM_CHIP_TYPE_BD71847, 10 13 ROHM_CHIP_TYPE_BD70528, 14 + ROHM_CHIP_TYPE_BD71828, 11 15 ROHM_CHIP_TYPE_AMOUNT 12 16 }; 13 17 14 18 struct rohm_regmap_dev { 15 - unsigned int chip_type; 16 19 struct device *dev; 17 20 struct regmap *regmap; 18 21 }; 22 + 23 + enum { 24 + ROHM_DVS_LEVEL_UNKNOWN, 25 + ROHM_DVS_LEVEL_RUN, 26 + ROHM_DVS_LEVEL_IDLE, 27 + ROHM_DVS_LEVEL_SUSPEND, 28 + ROHM_DVS_LEVEL_LPSR, 29 + ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR, 30 + }; 31 + 32 + /** 33 + * struct rohm_dvs_config - dynamic voltage scaling register descriptions 34 + * 35 + * @level_map: bitmap representing supported run-levels for this 36 + * regulator 37 + * @run_reg: register address for regulator config at 'run' state 38 + * @run_mask: value mask for regulator voltages at 'run' state 39 + * @run_on_mask: enable mask for regulator at 'run' state 40 + * @idle_reg: register address for regulator config at 'idle' state 41 + * @idle_mask: value mask for regulator voltages at 'idle' state 42 + * @idle_on_mask: enable mask for regulator at 'idle' state 43 + * @suspend_reg: register address for regulator config at 'suspend' state 44 + * @suspend_mask: value mask for regulator voltages at 'suspend' state 45 + * @suspend_on_mask: enable mask for regulator at 'suspend' state 46 + * @lpsr_reg: register address for regulator config at 'lpsr' state 47 + * @lpsr_mask: value mask for regulator voltages at 'lpsr' state 48 + * @lpsr_on_mask: enable mask for regulator at 'lpsr' state 49 + * 50 + * Description of ROHM PMICs voltage configuration registers for different 51 + * system states. This is used to correctly configure the PMIC at startup 52 + * based on values read from DT. 53 + */ 54 + struct rohm_dvs_config { 55 + uint64_t level_map; 56 + unsigned int run_reg; 57 + unsigned int run_mask; 58 + unsigned int run_on_mask; 59 + unsigned int idle_reg; 60 + unsigned int idle_mask; 61 + unsigned int idle_on_mask; 62 + unsigned int suspend_reg; 63 + unsigned int suspend_mask; 64 + unsigned int suspend_on_mask; 65 + unsigned int lpsr_reg; 66 + unsigned int lpsr_mask; 67 + unsigned int lpsr_on_mask; 68 + }; 69 + 70 + #if IS_ENABLED(CONFIG_REGULATOR_ROHM) 71 + int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, 72 + struct device_node *np, 73 + const struct regulator_desc *desc, 74 + struct regmap *regmap); 75 + 76 + #else 77 + static inline int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, 78 + struct device_node *np, 79 + const struct regulator_desc *desc, 80 + struct regmap *regmap) 81 + { 82 + return 0; 83 + } 84 + #endif 19 85 20 86 #endif
+21
include/linux/mfd/rohm-shared.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* Copyright (C) 2020 ROHM Semiconductors */ 3 + 4 + 5 + #ifndef __LINUX_MFD_ROHM_SHARED_H__ 6 + #define __LINUX_MFD_ROHM_SHARED_H__ 7 + 8 + /* RTC definitions shared between BD70528 and BD71828 */ 9 + 10 + #define BD70528_MASK_RTC_SEC 0x7f 11 + #define BD70528_MASK_RTC_MINUTE 0x7f 12 + #define BD70528_MASK_RTC_HOUR_24H 0x80 13 + #define BD70528_MASK_RTC_HOUR_PM 0x20 14 + #define BD70528_MASK_RTC_HOUR 0x3f 15 + #define BD70528_MASK_RTC_DAY 0x3f 16 + #define BD70528_MASK_RTC_WEEK 0x07 17 + #define BD70528_MASK_RTC_MONTH 0x1f 18 + #define BD70528_MASK_RTC_YEAR 0xff 19 + #define BD70528_MASK_ALM_EN 0x7 20 + 21 + #endif /* __LINUX_MFD_ROHM_SHARED_H__ */
+14
include/linux/mfd/syscon.h
··· 23 23 extern struct regmap *syscon_regmap_lookup_by_phandle( 24 24 struct device_node *np, 25 25 const char *property); 26 + extern struct regmap *syscon_regmap_lookup_by_phandle_args( 27 + struct device_node *np, 28 + const char *property, 29 + int arg_count, 30 + unsigned int *out_args); 26 31 #else 27 32 static inline struct regmap *device_node_to_regmap(struct device_node *np) 28 33 { ··· 47 42 static inline struct regmap *syscon_regmap_lookup_by_phandle( 48 43 struct device_node *np, 49 44 const char *property) 45 + { 46 + return ERR_PTR(-ENOTSUPP); 47 + } 48 + 49 + static inline struct regmap *syscon_regmap_lookup_by_phandle_args( 50 + struct device_node *np, 51 + const char *property, 52 + int arg_count, 53 + unsigned int *out_args) 50 54 { 51 55 return ERR_PTR(-ENOTSUPP); 52 56 }
+531
include/linux/mfd/wcd934x/registers.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef _WCD934X_REGISTERS_H 4 + #define _WCD934X_REGISTERS_H 5 + 6 + #define WCD934X_CODEC_RPM_CLK_GATE 0x0002 7 + #define WCD934X_CODEC_RPM_CLK_GATE_MASK GENMASK(1, 0) 8 + #define WCD934X_CODEC_RPM_CLK_MCLK_CFG 0x0003 9 + #define WCD934X_CODEC_RPM_CLK_MCLK_CFG_9P6MHZ BIT(0) 10 + #define WCD934X_CODEC_RPM_CLK_MCLK_CFG_12P288MHZ BIT(1) 11 + #define WCD934X_CODEC_RPM_CLK_MCLK_CFG_MCLK_MASK GENMASK(1, 0) 12 + #define WCD934X_CODEC_RPM_RST_CTL 0x0009 13 + #define WCD934X_CODEC_RPM_PWR_CDC_DIG_HM_CTL 0x0011 14 + #define WCD934X_CHIP_TIER_CTRL_CHIP_ID_BYTE0 0x0021 15 + #define WCD934X_CHIP_TIER_CTRL_CHIP_ID_BYTE2 0x0023 16 + #define WCD934X_CHIP_TIER_CTRL_EFUSE_CTL 0x0025 17 + #define WCD934X_EFUSE_SENSE_STATE_MASK GENMASK(4, 1) 18 + #define WCD934X_EFUSE_SENSE_STATE_DEF 0x10 19 + #define WCD934X_EFUSE_SENSE_EN_MASK BIT(0) 20 + #define WCD934X_EFUSE_SENSE_ENABLE BIT(0) 21 + #define WCD934X_CHIP_TIER_CTRL_EFUSE_VAL_OUT14 0x0037 22 + #define WCD934X_CHIP_TIER_CTRL_EFUSE_VAL_OUT15 0x0038 23 + #define WCD934X_CHIP_TIER_CTRL_EFUSE_STATUS 0x0039 24 + #define WCD934X_DATA_HUB_SB_TX10_INP_CFG 0x006b 25 + #define WCD934X_DATA_HUB_SB_TX11_INP_CFG 0x006c 26 + #define WCD934X_DATA_HUB_SB_TX13_INP_CFG 0x006e 27 + #define WCD934X_CPE_FLL_CONFIG_CTL_2 0x0111 28 + #define WCD934X_CPE_SS_CPARMAD_BUFRDY_INT_PERIOD 0x0213 29 + #define WCD934X_CPE_SS_SVA_CFG 0x0214 30 + #define WCD934X_CPE_SS_DMIC0_CTL 0x0218 31 + #define WCD934X_CPE_SS_DMIC1_CTL 0x0219 32 + #define WCD934X_DMIC_RATE_MASK GENMASK(3, 1) 33 + #define WCD934X_CPE_SS_DMIC2_CTL 0x021a 34 + #define WCD934X_CPE_SS_DMIC_CFG 0x021b 35 + #define WCD934X_CPE_SS_DMIC_CFG 0x021b 36 + #define WCD934X_CPE_SS_CPAR_CFG 0x021c 37 + #define WCD934X_INTR_PIN1_MASK0 0x0409 38 + #define WCD934X_INTR_PIN1_STATUS0 0x0411 39 + #define WCD934X_INTR_PIN1_CLEAR0 0x0419 40 + #define WCD934X_INTR_PIN2_CLEAR3 0x0434 41 + #define WCD934X_INTR_LEVEL0 0x0461 42 + /* INTR_REG 0 */ 43 + #define WCD934X_IRQ_SLIMBUS 0 44 + #define WCD934X_IRQ_MISC 1 45 + #define WCD934X_IRQ_HPH_PA_OCPL_FAULT 2 46 + #define WCD934X_IRQ_HPH_PA_OCPR_FAULT 3 47 + #define WCD934X_IRQ_EAR_PA_OCP_FAULT 4 48 + #define WCD934X_IRQ_HPH_PA_CNPL_COMPLETE 5 49 + #define WCD934X_IRQ_HPH_PA_CNPR_COMPLETE 6 50 + #define WCD934X_IRQ_EAR_PA_CNP_COMPLETE 7 51 + /* INTR_REG 1 */ 52 + #define WCD934X_IRQ_MBHC_SW_DET 8 53 + #define WCD934X_IRQ_MBHC_ELECT_INS_REM_DET 9 54 + #define WCD934X_IRQ_MBHC_BUTTON_PRESS_DET 10 55 + #define WCD934X_IRQ_MBHC_BUTTON_RELEASE_DET 11 56 + #define WCD934X_IRQ_MBHC_ELECT_INS_REM_LEG_DET 12 57 + #define WCD934X_IRQ_RESERVED_0 13 58 + #define WCD934X_IRQ_RESERVED_1 14 59 + #define WCD934X_IRQ_RESERVED_2 15 60 + /* INTR_REG 2 */ 61 + #define WCD934X_IRQ_LINE_PA1_CNP_COMPLETE 16 62 + #define WCD934X_IRQ_LINE_PA2_CNP_COMPLETE 17 63 + #define WCD934X_IRQ_SLNQ_ANALOG_ERROR 18 64 + #define WCD934X_IRQ_RESERVED_3 19 65 + #define WCD934X_IRQ_SOUNDWIRE 20 66 + #define WCD934X_IRQ_VDD_DIG_RAMP_COMPLETE 21 67 + #define WCD934X_IRQ_RCO_ERROR 22 68 + #define WCD934X_IRQ_CPE_ERROR 23 69 + /* INTR_REG 3 */ 70 + #define WCD934X_IRQ_MAD_AUDIO 24 71 + #define WCD934X_IRQ_MAD_BEACON 25 72 + #define WCD934X_IRQ_MAD_ULTRASOUND 26 73 + #define WCD934X_IRQ_VBAT_ATTACK 27 74 + #define WCD934X_IRQ_VBAT_RESTORE 28 75 + #define WCD934X_IRQ_CPE1_INTR 29 76 + #define WCD934X_IRQ_RESERVED_4 30 77 + #define WCD934X_IRQ_SLNQ_DIGITAL 31 78 + #define WCD934X_NUM_IRQS 32 79 + #define WCD934X_ANA_BIAS 0x0601 80 + #define WCD934X_ANA_BIAS_EN_MASK BIT(7) 81 + #define WCD934X_ANA_BIAS_EN BIT(7) 82 + #define WCD934X_ANA_PRECHRG_EN_MASK BIT(6) 83 + #define WCD934X_ANA_PRECHRG_EN BIT(6) 84 + #define WCD934X_ANA_PRECHRG_MODE_MASK BIT(5) 85 + #define WCD934X_ANA_PRECHRG_MODE_AUTO BIT(5) 86 + #define WCD934X_ANA_RCO 0x0603 87 + #define WCD934X_ANA_RCO_BG_EN_MASK BIT(7) 88 + #define WCD934X_ANA_RCO_BG_ENABLE BIT(7) 89 + #define WCD934X_ANA_BUCK_CTL 0x0606 90 + #define WCD934X_ANA_BUCK_HI_ACCU_PRE_ENX_MASK GENMASK(1, 0) 91 + #define WCD934X_ANA_BUCK_PRE_EN2_MASK BIT(0) 92 + #define WCD934X_ANA_BUCK_PRE_EN2_ENABLE BIT(0) 93 + #define WCD934X_ANA_BUCK_PRE_EN1_MASK BIT(1) 94 + #define WCD934X_ANA_BUCK_PRE_EN1_ENABLE BIT(1) 95 + #define WCD934X_ANA_BUCK_HI_ACCU_EN_MASK BIT(2) 96 + #define WCD934X_ANA_BUCK_HI_ACCU_ENABLE BIT(2) 97 + #define WCD934X_ANA_RX_SUPPLIES 0x0608 98 + #define WCD934X_ANA_HPH 0x0609 99 + #define WCD934X_ANA_EAR 0x060a 100 + #define WCD934X_ANA_LO_1_2 0x060b 101 + #define WCD934X_ANA_AMIC1 0x060e 102 + #define WCD934X_ANA_AMIC2 0x060f 103 + #define WCD934X_ANA_AMIC3 0x0610 104 + #define WCD934X_ANA_AMIC4 0x0611 105 + #define WCD934X_ANA_MBHC_MECH 0x0614 106 + #define WCD934X_ANA_MBHC_ELECT 0x0615 107 + #define WCD934X_ANA_MBHC_ZDET 0x0616 108 + #define WCD934X_ANA_MBHC_RESULT_1 0x0617 109 + #define WCD934X_ANA_MBHC_RESULT_2 0x0618 110 + #define WCD934X_ANA_MBHC_RESULT_3 0x0619 111 + #define WCD934X_ANA_MICB1 0x0622 112 + #define WCD934X_MICB_VAL_MASK GENMASK(5, 0) 113 + #define WCD934X_ANA_MICB_EN_MASK GENMASK(7, 6) 114 + #define WCD934X_ANA_MICB_PULL_UP 0x80 115 + #define WCD934X_ANA_MICB_ENABLE 0x40 116 + #define WCD934X_ANA_MICB_DISABLE 0x0 117 + #define WCD934X_ANA_MICB2 0x0623 118 + #define WCD934X_ANA_MICB3 0x0625 119 + #define WCD934X_ANA_MICB4 0x0626 120 + #define WCD934X_BIAS_VBG_FINE_ADJ 0x0629 121 + #define WCD934X_MICB1_TEST_CTL_1 0x066b 122 + #define WCD934X_MICB1_TEST_CTL_2 0x066c 123 + #define WCD934X_MICB2_TEST_CTL_1 0x066e 124 + #define WCD934X_MICB3_TEST_CTL_1 0x0671 125 + #define WCD934X_MICB4_TEST_CTL_1 0x0674 126 + #define WCD934X_CLASSH_MODE_1 0x0697 127 + #define WCD934X_CLASSH_MODE_2 0x0698 128 + #define WCD934X_CLASSH_MODE_3 0x0699 129 + #define WCD934X_CLASSH_CTRL_VCL_1 0x069a 130 + #define WCD934X_CLASSH_CTRL_VCL_2 0x069b 131 + #define WCD934X_CLASSH_CTRL_CCL_1 0x069c 132 + #define WCD934X_CLASSH_CTRL_CCL_2 0x069d 133 + #define WCD934X_CLASSH_CTRL_CCL_3 0x069e 134 + #define WCD934X_CLASSH_CTRL_CCL_4 0x069f 135 + #define WCD934X_CLASSH_CTRL_CCL_5 0x06a0 136 + #define WCD934X_CLASSH_BUCK_TMUX_A_D 0x06a1 137 + #define WCD934X_CLASSH_BUCK_SW_DRV_CNTL 0x06a2 138 + #define WCD934X_RX_OCP_CTL 0x06b6 139 + #define WCD934X_RX_OCP_COUNT 0x06b7 140 + #define WCD934X_HPH_CNP_EN 0x06cb 141 + #define WCD934X_HPH_CNP_WG_CTL 0x06cc 142 + #define WCD934X_HPH_GM3_BOOST_EN_MASK BIT(7) 143 + #define WCD934X_HPH_GM3_BOOST_ENABLE BIT(7) 144 + #define WCD934X_HPH_OCP_CTL 0x06ce 145 + #define WCD934X_HPH_L_EN 0x06d3 146 + #define WCD934X_HPH_GAIN_SRC_SEL_MASK BIT(5) 147 + #define WCD934X_HPH_GAIN_SRC_SEL_COMPANDER 0 148 + #define WCD934X_HPH_GAIN_SRC_SEL_REGISTER BIT(5) 149 + #define WCD934X_HPH_L_TEST 0x06d4 150 + #define WCD934X_HPH_R_EN 0x06d6 151 + #define WCD934X_HPH_R_TEST 0x06d7 152 + #define WCD934X_HPH_OCP_DET_MASK BIT(0) 153 + #define WCD934X_HPH_OCP_DET_ENABLE BIT(0) 154 + #define WCD934X_HPH_OCP_DET_DISABLE 0 155 + #define WCD934X_DIFF_LO_LO2_COMPANDER 0x06ea 156 + #define WCD934X_DIFF_LO_LO1_COMPANDER 0x06eb 157 + #define WCD934X_CLK_SYS_MCLK_PRG 0x0711 158 + #define WCD934X_EXT_CLK_BUF_EN_MASK BIT(7) 159 + #define WCD934X_EXT_CLK_BUF_EN BIT(7) 160 + #define WCD934X_EXT_CLK_DIV_RATIO_MASK GENMASK(5, 4) 161 + #define WCD934X_EXT_CLK_DIV_BY_2 0x10 162 + #define WCD934X_MCLK_SRC_MASK BIT(1) 163 + #define WCD934X_MCLK_SRC_EXT_CLK 0 164 + #define WCD934X_MCLK_SRC_MASK BIT(1) 165 + #define WCD934X_MCLK_EN_MASK BIT(0) 166 + #define WCD934X_MCLK_EN BIT(0) 167 + #define WCD934X_CLK_SYS_MCLK2_PRG1 0x0712 168 + #define WCD934X_CLK_SYS_MCLK2_PRG2 0x0713 169 + #define WCD934X_SIDO_NEW_VOUT_A_STARTUP 0x071b 170 + #define WCD934X_SIDO_NEW_VOUT_D_STARTUP 0x071c 171 + #define WCD934X_SIDO_NEW_VOUT_D_FREQ1 0x071d 172 + #define WCD934X_SIDO_NEW_VOUT_D_FREQ2 0x071e 173 + #define WCD934X_SIDO_RIPPLE_FREQ_EN_MASK BIT(0) 174 + #define WCD934X_SIDO_RIPPLE_FREQ_ENABLE BIT(0) 175 + #define WCD934X_MBHC_NEW_CTL_2 0x0721 176 + #define WCD934X_TX_NEW_AMIC_4_5_SEL 0x0727 177 + #define WCD934X_HPH_NEW_INT_RDAC_HD2_CTL_L 0x0733 178 + #define WCD934X_HPH_NEW_INT_RDAC_OVERRIDE_CTL 0x0735 179 + #define WCD934X_HPH_NEW_INT_RDAC_HD2_CTL_R 0x0736 180 + #define WCD934X_HPH_NEW_INT_HPH_TIMER1 0x073a 181 + #define WCD934X_HPH_AUTOCHOP_TIMER_EN_MASK BIT(1) 182 + #define WCD934X_HPH_AUTOCHOP_TIMER_ENABLE BIT(1) 183 + #define WCD934X_CDC_TX0_TX_PATH_CTL 0x0a31 184 + #define WCD934X_CDC_TX_PATH_CTL_PCM_RATE_MASK GENMASK(3, 0) 185 + #define WCD934X_CDC_TX_PATH_CTL(dec) (0xa31 + dec * 0x10) 186 + #define WCD934X_CDC_TX0_TX_PATH_CFG0 0x0a32 187 + #define WCD934X_CDC_TX0_TX_PATH_CFG1 0x0a33 188 + #define WCD934X_CDC_TX0_TX_VOL_CTL 0x0a34 189 + #define WCD934X_CDC_TX0_TX_PATH_192_CTL 0x0a35 190 + #define WCD934X_CDC_TX0_TX_PATH_192_CFG 0x0a36 191 + #define WCD934X_CDC_TX0_TX_PATH_SEC2 0x0a39 192 + #define WCD934X_HPH_CUTOFF_FREQ_CHANGE_REQ_MASK BIT(1) 193 + #define WCD934X_HPH_CUTOFF_FREQ_CHANGE_REQ BIT(1) 194 + #define WCD934X_CDC_TX1_TX_PATH_CTL 0x0a41 195 + #define WCD934X_CDC_TX1_TX_PATH_CFG0 0x0a42 196 + #define WCD934X_CDC_TX1_TX_PATH_CFG1 0x0a43 197 + #define WCD934X_CDC_TX1_TX_VOL_CTL 0x0a44 198 + #define WCD934X_CDC_TX2_TX_PATH_CTL 0x0a51 199 + #define WCD934X_CDC_TX2_TX_PATH_CFG0 0x0a52 200 + #define WCD934X_CDC_TX2_TX_PATH_CFG1 0x0a53 201 + #define WCD934X_CDC_TX2_TX_VOL_CTL 0x0a54 202 + #define WCD934X_CDC_TX3_TX_PATH_CTL 0x0a61 203 + #define WCD934X_CDC_TX3_TX_PATH_CFG0 0x0a62 204 + #define WCD934X_CDC_TX3_TX_PATH_CFG1 0x0a63 205 + #define WCD934X_CDC_TX3_TX_VOL_CTL 0x0a64 206 + #define WCD934X_CDC_TX3_TX_PATH_192_CTL 0x0a65 207 + #define WCD934X_CDC_TX3_TX_PATH_192_CFG 0x0a66 208 + #define WCD934X_CDC_TX4_TX_PATH_CTL 0x0a71 209 + #define WCD934X_CDC_TX4_TX_PATH_CFG0 0x0a72 210 + #define WCD934X_CDC_TX4_TX_PATH_CFG1 0x0a73 211 + #define WCD934X_CDC_TX4_TX_VOL_CTL 0x0a74 212 + #define WCD934X_CDC_TX4_TX_PATH_192_CTL 0x0a75 213 + #define WCD934X_CDC_TX4_TX_PATH_192_CFG 0x0a76 214 + #define WCD934X_CDC_TX5_TX_PATH_CTL 0x0a81 215 + #define WCD934X_CDC_TX5_TX_PATH_CFG0 0x0a82 216 + #define WCD934X_CDC_TX5_TX_PATH_CFG1 0x0a83 217 + #define WCD934X_CDC_TX5_TX_VOL_CTL 0x0a84 218 + #define WCD934X_CDC_TX5_TX_PATH_192_CTL 0x0a85 219 + #define WCD934X_CDC_TX5_TX_PATH_192_CFG 0x0a86 220 + #define WCD934X_CDC_TX6_TX_PATH_CTL 0x0a91 221 + #define WCD934X_CDC_TX6_TX_PATH_CFG0 0x0a92 222 + #define WCD934X_CDC_TX6_TX_PATH_CFG1 0x0a93 223 + #define WCD934X_CDC_TX6_TX_VOL_CTL 0x0a94 224 + #define WCD934X_CDC_TX6_TX_PATH_192_CTL 0x0a95 225 + #define WCD934X_CDC_TX6_TX_PATH_192_CFG 0x0a96 226 + #define WCD934X_CDC_TX7_TX_PATH_CTL 0x0aa1 227 + #define WCD934X_CDC_TX7_TX_PATH_CFG0 0x0aa2 228 + #define WCD934X_CDC_TX7_TX_PATH_CFG1 0x0aa3 229 + #define WCD934X_CDC_TX7_TX_VOL_CTL 0x0aa4 230 + #define WCD934X_CDC_TX7_TX_PATH_192_CTL 0x0aa5 231 + #define WCD934X_CDC_TX7_TX_PATH_192_CFG 0x0aa6 232 + #define WCD934X_CDC_TX8_TX_PATH_CTL 0x0ab1 233 + #define WCD934X_CDC_TX8_TX_PATH_CFG0 0x0ab2 234 + #define WCD934X_CDC_TX8_TX_PATH_CFG1 0x0ab3 235 + #define WCD934X_CDC_TX8_TX_VOL_CTL 0x0ab4 236 + #define WCD934X_CDC_TX8_TX_PATH_192_CTL 0x0ab5 237 + #define WCD934X_CDC_TX8_TX_PATH_192_CFG 0x0ab6 238 + #define WCD934X_CDC_TX9_SPKR_PROT_PATH_CFG0 0x0ac3 239 + #define WCD934X_CDC_TX10_SPKR_PROT_PATH_CFG0 0x0ac7 240 + #define WCD934X_CDC_TX11_SPKR_PROT_PATH_CFG0 0x0acb 241 + #define WCD934X_CDC_TX12_SPKR_PROT_PATH_CFG0 0x0acf 242 + #define WCD934X_CDC_COMPANDER1_CTL0 0x0b01 243 + #define WCD934X_COMP_CLK_EN_MASK BIT(0) 244 + #define WCD934X_COMP_CLK_ENABLE BIT(0) 245 + #define WCD934X_COMP_SOFT_RST_MASK BIT(1) 246 + #define WCD934X_COMP_SOFT_RST_ENABLE BIT(1) 247 + #define WCD934X_COMP_HALT_MASK BIT(2) 248 + #define WCD934X_COMP_HALT BIT(2) 249 + #define WCD934X_COMP_SOFT_RST_DISABLE 0 250 + #define WCD934X_CDC_COMPANDER1_CTL7 0x0b08 251 + #define WCD934X_HPH_LOW_PWR_MODE_EN_MASK BIT(5) 252 + #define WCD934X_CDC_COMPANDER2_CTL7 0x0b10 253 + #define WCD934X_CDC_COMPANDER7_CTL3 0x0b34 254 + #define WCD934X_CDC_COMPANDER7_CTL7 0x0b38 255 + #define WCD934X_CDC_COMPANDER8_CTL3 0x0b3c 256 + #define WCD934X_CDC_COMPANDER8_CTL7 0x0b40 257 + #define WCD934X_CDC_RX0_RX_PATH_CTL 0x0b41 258 + #define WCD934X_CDC_RX_PGA_MUTE_EN_MASK BIT(4) 259 + #define WCD934X_CDC_RX_PGA_MUTE_ENABLE BIT(4) 260 + #define WCD934X_CDC_RX_PGA_MUTE_DISABLE 0 261 + #define WCD934X_RX_CLK_EN_MASK BIT(5) 262 + #define WCD934X_RX_CLK_ENABLE BIT(5) 263 + #define WCD934X_RX_RESET_MASK BIT(6) 264 + #define WCD934X_RX_RESET_ENABLE BIT(6) 265 + #define WCD934X_RX_RESET_DISABLE 0 266 + #define WCD934X_RX_PCM_RATE_MASK GENMASK(3, 0) 267 + #define WCD934X_RX_PCM_RATE_F_48K 0x04 268 + #define WCD934X_CDC_RX_PATH_CTL(rx) (0xb41 + rx * 0x14) 269 + #define WCD934X_CDC_MIX_PCM_RATE_MASK GENMASK(3, 0) 270 + #define WCD934X_CDC_RX0_RX_PATH_CFG0 0x0b42 271 + #define WCD934X_RX_DLY_ZN_EN_MASK BIT(3) 272 + #define WCD934X_RX_DLY_ZN_ENABLE BIT(3) 273 + #define WCD934X_RX_DLY_ZN_DISABLE 0 274 + #define WCD934X_CDC_RX0_RX_PATH_CFG1 0x0b43 275 + #define WCD934X_CDC_RX0_RX_PATH_CFG2 0x0b44 276 + #define WCD934X_CDC_RX0_RX_VOL_CTL 0x0b45 277 + #define WCD934X_CDC_RX0_RX_PATH_MIX_CTL 0x0b46 278 + #define WCD934X_CDC_RX_MIX_CLK_EN_MASK BIT(5) 279 + #define WCD934X_CDC_RX_MIX_CLK_ENABLE BIT(5) 280 + #define WCD934X_CDC_RX_PATH_MIX_CTL(rx) (0xb46 + rx * 0x14) 281 + #define WCD934X_CDC_RX0_RX_PATH_MIX_CFG 0x0b47 282 + #define WCD934X_CDC_RX0_RX_VOL_MIX_CTL 0x0b48 283 + #define WCD934X_CDC_RX0_RX_PATH_SEC0 0x0b49 284 + #define WCD934X_CDC_RX0_RX_PATH_DSMDEM_CTL 0x0b53 285 + #define WCD934X_CDC_RX1_RX_PATH_CTL 0x0b55 286 + #define WCD934X_RX_PATH_PGA_MUTE_EN_MASK BIT(4) 287 + #define WCD934X_RX_PATH_PGA_MUTE_ENABLE BIT(4) 288 + #define WCD934X_CDC_RX_PATH_PGA_MUTE_DISABLE 0 289 + #define WCD934X_CDC_RX_PATH_CLK_EN_MASK BIT(5) 290 + #define WCD934X_CDC_RX_PATH_CLK_ENABLE BIT(5) 291 + #define WCD934X_CDC_RX_PATH_CLK_DISABLE 0 292 + #define WCD934X_CDC_RX1_RX_PATH_CFG0 0x0b56 293 + #define WCD934X_HPH_CMP_EN_MASK BIT(1) 294 + #define WCD934X_HPH_CMP_ENABLE BIT(1) 295 + #define WCD934X_HPH_CMP_DISABLE 0 296 + #define WCD934X_CDC_RX1_RX_PATH_CFG2 0x0b58 297 + #define WCD934X_CDC_RX1_RX_VOL_CTL 0x0b59 298 + #define WCD934X_CDC_RX1_RX_PATH_MIX_CTL 0x0b5a 299 + #define WCD934X_CDC_RX1_RX_PATH_MIX_CFG 0x0b5b 300 + #define WCD934X_CDC_RX1_RX_VOL_MIX_CTL 0x0b5c 301 + #define WCD934X_CDC_RX1_RX_PATH_SEC0 0x0b5d 302 + #define WCD934X_CDC_RX1_RX_PATH_SEC3 0x0b60 303 + #define WCD934X_CDC_RX_PATH_SEC_HD2_ALPHA_MASK GENMASK(5, 2) 304 + #define WCD934X_CDC_RX_PATH_SEC_HD2_ALPHA_0P3125 0x14 305 + #define WCD934X_CDC_RX_PATH_SEC_HD2_ALPHA_0P0000 0 306 + #define WCD934X_CDC_RX1_RX_PATH_DSMDEM_CTL 0x0b67 307 + #define WCD934X_CDC_RX2_RX_PATH_CTL 0x0b69 308 + #define WCD934X_CDC_RX2_RX_PATH_CFG0 0x0b6a 309 + #define WCD934X_CDC_RX_PATH_CFG_HD2_EN_MASK BIT(2) 310 + #define WCD934X_CDC_RX_PATH_CFG_HD2_ENABLE BIT(2) 311 + #define WCD934X_CDC_RX_PATH_CFG_HD2_DISABLE 0 312 + #define WCD934X_CDC_RX2_RX_PATH_CFG2 0x0b6c 313 + #define WCD934X_CDC_RX2_RX_VOL_CTL 0x0b6d 314 + #define WCD934X_CDC_RX2_RX_PATH_MIX_CTL 0x0b6e 315 + #define WCD934X_CDC_RX2_RX_PATH_MIX_CFG 0x0b6f 316 + #define WCD934X_CDC_RX2_RX_VOL_MIX_CTL 0x0b70 317 + #define WCD934X_CDC_RX2_RX_PATH_SEC0 0x0b71 318 + #define WCD934X_CDC_RX2_RX_PATH_SEC3 0x0b74 319 + #define WCD934X_CDC_RX2_RX_PATH_DSMDEM_CTL 0x0b7b 320 + #define WCD934X_CDC_RX3_RX_PATH_CTL 0x0b7d 321 + #define WCD934X_CDC_RX3_RX_PATH_CFG0 0x0b6e 322 + #define WCD934X_CDC_RX3_RX_PATH_CFG2 0x0b80 323 + #define WCD934X_CDC_RX3_RX_VOL_CTL 0x0b81 324 + #define WCD934X_CDC_RX3_RX_PATH_MIX_CTL 0x0b82 325 + #define WCD934X_CDC_RX3_RX_PATH_MIX_CFG 0x0b83 326 + #define WCD934X_CDC_RX3_RX_VOL_MIX_CTL 0x0b84 327 + #define WCD934X_CDC_RX3_RX_PATH_SEC0 0x0b85 328 + #define WCD934X_CDC_RX3_RX_PATH_DSMDEM_CTL 0x0b8f 329 + #define WCD934X_CDC_RX4_RX_PATH_CTL 0x0b91 330 + #define WCD934X_CDC_RX4_RX_PATH_CFG0 0x0b92 331 + #define WCD934X_CDC_RX4_RX_PATH_CFG2 0x0b94 332 + #define WCD934X_CDC_RX4_RX_VOL_CTL 0x0b95 333 + #define WCD934X_CDC_RX4_RX_PATH_MIX_CTL 0x0b96 334 + #define WCD934X_CDC_RX4_RX_PATH_MIX_CFG 0x0b97 335 + #define WCD934X_CDC_RX4_RX_VOL_MIX_CTL 0x0b98 336 + #define WCD934X_CDC_RX4_RX_PATH_SEC0 0x0b99 337 + #define WCD934X_CDC_RX4_RX_PATH_DSMDEM_CTL 0x0ba3 338 + #define WCD934X_CDC_RX7_RX_PATH_CTL 0x0bcd 339 + #define WCD934X_CDC_RX7_RX_PATH_CFG0 0x0bce 340 + #define WCD934X_CDC_RX7_RX_PATH_CFG1 0x0bcf 341 + #define WCD934X_CDC_RX7_RX_PATH_CFG2 0x0bd0 342 + #define WCD934X_CDC_RX7_RX_VOL_CTL 0x0bd1 343 + #define WCD934X_CDC_RX7_RX_PATH_MIX_CTL 0x0bd2 344 + #define WCD934X_CDC_RX7_RX_PATH_MIX_CFG 0x0bd3 345 + #define WCD934X_CDC_RX7_RX_VOL_MIX_CTL 0x0bd4 346 + #define WCD934X_CDC_RX7_RX_PATH_SEC1 0x0bd6 347 + #define WCD934X_CDC_RX7_RX_PATH_MIX_SEC0 0x0bdd 348 + #define WCD934X_CDC_RX7_RX_PATH_DSMDEM_CTL 0x0bdf 349 + #define WCD934X_CDC_RX8_RX_PATH_CTL 0x0be1 350 + #define WCD934X_CDC_RX8_RX_PATH_CFG0 0x0be2 351 + #define WCD934X_CDC_RX8_RX_PATH_CFG1 0x0be3 352 + #define WCD934X_RX_SMART_BOOST_EN_MASK BIT(0) 353 + #define WCD934X_RX_SMART_BOOST_ENABLE BIT(0) 354 + #define WCD934X_RX_SMART_BOOST_DISABLE 0 355 + #define WCD934X_CDC_RX8_RX_PATH_CFG2 0x0be4 356 + #define WCD934X_CDC_RX8_RX_VOL_CTL 0x0be5 357 + #define WCD934X_CDC_RX8_RX_PATH_MIX_CTL 0x0be6 358 + #define WCD934X_CDC_RX8_RX_PATH_MIX_CFG 0x0be7 359 + #define WCD934X_CDC_RX8_RX_VOL_MIX_CTL 0x0be8 360 + #define WCD934X_CDC_RX8_RX_PATH_SEC1 0x0bea 361 + #define WCD934X_CDC_RX8_RX_PATH_MIX_SEC0 0x0bf1 362 + #define WCD934X_CDC_RX8_RX_PATH_DSMDEM_CTL 0x0bf3 363 + #define WCD934X_CDC_CLSH_DECAY_CTRL 0x0c03 364 + #define WCD934X_CDC_CLSH_K2_MSB 0x0c0a 365 + #define WCD934X_CDC_CLSH_K2_LSB 0x0c0b 366 + #define WCD934X_CDC_CLSH_TEST0 0x0c0f 367 + #define WCD934X_CDC_BOOST0_BOOST_PATH_CTL 0x0c19 368 + #define WCD934X_BOOST_PATH_CLK_EN_MASK BIT(4) 369 + #define WCD934X_BOOST_PATH_CLK_ENABLE BIT(4) 370 + #define WCD934X_BOOST_PATH_CLK_DISABLE 0 371 + #define WCD934X_CDC_BOOST0_BOOST_CTL 0x0c1a 372 + #define WCD934X_CDC_BOOST0_BOOST_CFG1 0x0c1b 373 + #define WCD934X_CDC_BOOST0_BOOST_CFG2 0x0c1c 374 + #define WCD934X_CDC_BOOST1_BOOST_PATH_CTL 0x0c21 375 + #define WCD934X_CDC_BOOST1_BOOST_CTL 0x0c22 376 + #define WCD934X_CDC_BOOST1_BOOST_CFG1 0x0c23 377 + #define WCD934X_CDC_BOOST1_BOOST_CFG2 0x0c24 378 + #define WCD934X_SWR_AHB_BRIDGE_RD_DATA_0 0x0c91 379 + #define WCD934X_SWR_AHB_BRIDGE_RD_DATA_1 0x0c92 380 + #define WCD934X_SWR_AHB_BRIDGE_RD_DATA_2 0x0c93 381 + #define WCD934X_SWR_AHB_BRIDGE_RD_DATA_3 0x0c94 382 + #define WCD934X_SWR_AHB_BRIDGE_ACCESS_STATUS 0x0c96 383 + #define WCD934X_CDC_SIDETONE_SRC0_ST_SRC_PATH_CTL 0x0cb5 384 + #define WCD934X_CDC_SIDETONE_SRC1_ST_SRC_PATH_CTL 0x0cb9 385 + #define WCD934X_CDC_RX_INP_MUX_RX_INT0_CFG0 0x0d01 386 + #define WCD934X_CDC_RX_INP_MUX_RX_INT_CFG0(i) (0xd01 + i * 0x2) 387 + #define WCD934X_CDC_RX_INP_MUX_RX_INT_SEL_MASK GENMASK(3, 0) 388 + #define WCD934X_CDC_RX_INP_MUX_RX_INT0_CFG1 0x0d02 389 + #define WCD934X_CDC_RX_INP_MUX_RX_INT_CFG1(i) (0xd02 + i * 0x2) 390 + #define WCD934X_CDC_RX_INP_MUX_RX_INT1_CFG0 0x0d03 391 + #define WCD934X_CDC_RX_INP_MUX_RX_INT1_CFG1 0x0d04 392 + #define WCD934X_CDC_RX_INP_MUX_RX_INT2_CFG0 0x0d05 393 + #define WCD934X_CDC_RX_INP_MUX_RX_INT2_CFG1 0x0d06 394 + #define WCD934X_CDC_RX_INP_MUX_RX_INT3_CFG0 0x0d07 395 + #define WCD934X_CDC_RX_INP_MUX_RX_INT3_CFG1 0x0d08 396 + #define WCD934X_CDC_RX_INP_MUX_RX_INT4_CFG0 0x0d09 397 + #define WCD934X_CDC_RX_INP_MUX_RX_INT4_CFG1 0x0d0a 398 + #define WCD934X_CDC_RX_INP_MUX_RX_INT7_CFG0 0x0d0f 399 + #define WCD934X_CDC_RX_INP_MUX_RX_INT7_CFG1 0x0d10 400 + #define WCD934X_CDC_RX_INP_MUX_RX_INT8_CFG0 0x0d11 401 + #define WCD934X_CDC_RX_INP_MUX_RX_INT8_CFG1 0x0d12 402 + #define WCD934X_CDC_RX_INP_MUX_RX_MIX_CFG0 0x0d13 403 + #define WCD934X_CDC_RX_INP_MUX_RX_MIX_CFG1 0x0d14 404 + #define WCD934X_CDC_RX_INP_MUX_RX_MIX_CFG2 0x0d15 405 + #define WCD934X_CDC_RX_INP_MUX_RX_MIX_CFG3 0x0d16 406 + #define WCD934X_CDC_RX_INP_MUX_RX_MIX_CFG4 0x0d17 407 + #define WCD934X_CDC_RX_INP_MUX_SIDETONE_SRC_CFG0 0x0d18 408 + #define WCD934X_CDC_RX_INP_MUX_SIDETONE_SRC_CFG1 0x0d19 409 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX0_CFG0 0x0d1d 410 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX0_CFG1 0x0d1e 411 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX1_CFG0 0x0d1f 412 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX1_CFG1 0x0d20 413 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX2_CFG0 0x0d21 414 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX2_CFG1 0x0d22 415 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX3_CFG0 0x0d23 416 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX3_CFG1 0x0d25 417 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX4_CFG0 0x0d26 418 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX5_CFG0 0x0d27 419 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX6_CFG0 0x0d28 420 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX7_CFG0 0x0d29 421 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX8_CFG0 0x0d2a 422 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX10_CFG0 0x0d2b 423 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX11_CFG0 0x0d2c 424 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX12_CFG0 0x0d2d 425 + #define WCD934X_CDC_TX_INP_MUX_ADC_MUX13_CFG0 0x0d2e 426 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR0_MIX_CFG0 0x0d31 427 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR0_MIX_CFG1 0x0d32 428 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR0_MIX_CFG2 0x0d33 429 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR0_MIX_CFG3 0x0d34 430 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR1_MIX_CFG0 0x0d35 431 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR1_MIX_CFG1 0x0d36 432 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR1_MIX_CFG2 0x0d37 433 + #define WCD934X_CDC_SIDETONE_IIR_INP_MUX_IIR1_MIX_CFG3 0x0d38 434 + #define WCD934X_CDC_IF_ROUTER_TX_MUX_CFG0 0x0d3a 435 + #define WCD934X_CDC_IF_ROUTER_TX_MUX_CFG1 0x0d3b 436 + #define WCD934X_CDC_IF_ROUTER_TX_MUX_CFG2 0x0d3c 437 + #define WCD934X_CDC_IF_ROUTER_TX_MUX_CFG3 0x0d3d 438 + #define WCD934X_CDC_CLK_RST_CTRL_MCLK_CONTROL 0x0d41 439 + #define WCD934X_CDC_MCLK_EN_MASK BIT(0) 440 + #define WCD934X_CDC_MCLK_EN_ENABLE BIT(0) 441 + #define WCD934X_CDC_CLK_RST_CTRL_FS_CNT_CONTROL 0x0d42 442 + #define WCD934X_CDC_FS_MCLK_CNT_EN_MASK BIT(0) 443 + #define WCD934X_CDC_FS_MCLK_CNT_ENABLE BIT(0) 444 + #define WCD934X_CDC_CLK_RST_CTRL_SWR_CONTROL 0x0d43 445 + #define WCD934X_CDC_SWR_CLK_EN_MASK BIT(0) 446 + #define WCD934X_CDC_SWR_CLK_ENABLE BIT(0) 447 + #define WCD934X_CDC_CLK_RST_CTRL_DSD_CONTROL 0x0d44 448 + #define WCD934X_CDC_CLK_RST_CTRL_ASRC_SHARE_CONTROL 0x0d45 449 + #define WCD934X_CDC_CLK_RST_CTRL_GFM_CONTROL 0x0d46 450 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_PATH_CTL 0x0d55 451 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B1_CTL 0x0d56 452 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B2_CTL 0x0d57 453 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B3_CTL 0x0d58 454 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B4_CTL 0x0d59 455 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B5_CTL 0x0d5a 456 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B6_CTL 0x0d5b 457 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B7_CTL 0x0d5c 458 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_B8_CTL 0x0d5d 459 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_CTL 0x0d5e 460 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_GAIN_TIMER_CTL 0x0d5f 461 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_COEF_B1_CTL 0x0d60 462 + #define WCD934X_CDC_SIDETONE_IIR0_IIR_COEF_B2_CTL 0x0d61 463 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_PATH_CTL 0x0d65 464 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B1_CTL 0x0d66 465 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B2_CTL 0x0d67 466 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B3_CTL 0x0d68 467 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B4_CTL 0x0d69 468 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B5_CTL 0x0d6a 469 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B6_CTL 0x0d6b 470 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B7_CTL 0x0d6c 471 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_B8_CTL 0x0d6d 472 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_CTL 0x0d6e 473 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_GAIN_TIMER_CTL 0x0d6f 474 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_COEF_B1_CTL 0x0d70 475 + #define WCD934X_CDC_SIDETONE_IIR1_IIR_COEF_B2_CTL 0x0d71 476 + #define WCD934X_CDC_TOP_TOP_CFG1 0x0d82 477 + #define WCD934X_CDC_TOP_TOP_CFG7 0x0d88 478 + #define WCD934X_CDC_TOP_HPHL_COMP_LUT 0x0d8b 479 + #define WCD934X_CDC_TOP_HPHR_COMP_LUT 0x0d90 480 + #define WCD934X_HPH_LUT_BYPASS_MASK BIT(7) 481 + #define WCD934X_HPH_LUT_BYPASS_ENABLE BIT(7) 482 + #define WCD934X_HPH_LUT_BYPASS_DISABLE 0 483 + #define WCD934X_CODEC_CPR_WR_DATA_0 0x5001 484 + #define WCD934X_CODEC_CPR_WR_ADDR_0 0x5005 485 + #define WCD934X_CODEC_CPR_SVS_CX_VDD 0x5022 486 + #define WCD934X_CODEC_CPR_SVS2_CX_VDD 0x5023 487 + #define WCD934X_CODEC_CPR_SVS2_MIN_CX_VDD 0x5027 488 + #define WCD934X_TLMM_DMIC1_CLK_PINCFG 0x8015 489 + #define WCD934X_TLMM_DMIC1_DATA_PINCFG 0x8016 490 + #define WCD934X_TLMM_DMIC2_CLK_PINCFG 0x8017 491 + #define WCD934X_TLMM_DMIC2_DATA_PINCFG 0x8018 492 + #define WCD934X_TLMM_DMIC3_CLK_PINCFG 0x8019 493 + #define WCD934X_TLMM_DMIC3_DATA_PINCFG 0x801a 494 + #define WCD934X_TEST_DEBUG_PAD_DRVCTL_0 0x803b 495 + #define WCD934X_TEST_DEBUG_NPL_DLY_TEST_1 0x803e 496 + 497 + #define WCD934X_MAX_REGISTER 0xffff 498 + #define WCD934X_SEL_REGISTER 0x800 499 + #define WCD934X_SEL_MASK 0xff 500 + #define WCD934X_SEL_SHIFT 0x0 501 + #define WCD934X_WINDOW_START 0x800 502 + #define WCD934X_WINDOW_LENGTH 0x100 503 + 504 + /* SLIMBUS Slave Registers */ 505 + #define WCD934X_SLIM_PGD_PORT_INT_EN0 0x30 506 + #define WCD934X_SLIM_PGD_PORT_INT_STATUS_RX_0 0x34 507 + #define WCD934X_SLIM_PGD_PORT_INT_STATUS_RX_1 0x35 508 + #define WCD934X_SLIM_PGD_PORT_INT_STATUS_TX_0 0x36 509 + #define WCD934X_SLIM_PGD_PORT_INT_STATUS_TX_1 0x37 510 + #define WCD934X_SLIM_PGD_PORT_INT_CLR_RX_0 0x38 511 + #define WCD934X_SLIM_PGD_PORT_INT_CLR_RX_1 0x39 512 + #define WCD934X_SLIM_PGD_PORT_INT_CLR_TX_0 0x3A 513 + #define WCD934X_SLIM_PGD_PORT_INT_CLR_TX_1 0x3B 514 + #define WCD934X_SLIM_PGD_PORT_INT_RX_SOURCE0 0x60 515 + #define WCD934X_SLIM_PGD_PORT_INT_TX_SOURCE0 0x70 516 + #define WCD934X_SLIM_PGD_RX_PORT_CFG(p) (0x30 + p) 517 + #define WCD934X_SLIM_PGD_PORT_CFG(p) (0x40 + p) 518 + #define WCD934X_SLIM_PGD_TX_PORT_CFG(p) (0x50 + p) 519 + #define WCD934X_SLIM_PGD_PORT_INT_SRC(p) (0x60 + p) 520 + #define WCD934X_SLIM_PGD_PORT_INT_STATUS(p) (0x80 + p) 521 + #define WCD934X_SLIM_PGD_TX_PORT_MULTI_CHNL_0(p) (0x100 + 4 * p) 522 + /* ports range from 10-16 */ 523 + #define WCD934X_SLIM_PGD_TX_PORT_MULTI_CHNL_1(p) (0x101 + 4 * p) 524 + #define WCD934X_SLIM_PGD_RX_PORT_MULTI_CHNL_0(p) (0x140 + 4 * p) 525 + 526 + #define SLIM_MANF_ID_QCOM 0x217 527 + #define SLIM_PROD_CODE_WCD9340 0x250 528 + #define SLIM_DEV_IDX_WCD9340 0x1 529 + #define SLIM_DEV_INSTANCE_ID_WCD9340 0 530 + 531 + #endif
+31
include/linux/mfd/wcd934x/wcd934x.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef __WCD934X_H__ 4 + #define __WCD934X_H__ 5 + #include <linux/clk.h> 6 + #include <linux/regulator/consumer.h> 7 + #include <linux/regmap.h> 8 + #include <linux/slimbus.h> 9 + 10 + #define WCD934X_MAX_SUPPLY 5 11 + 12 + /** 13 + * struct wcd934x_ddata - wcd934x driver data 14 + * 15 + * @supplies: wcd934x regulator supplies 16 + * @irq_data: wcd934x irq_chip data 17 + * @regmap: wcd934x regmap pointer 18 + * @extclk: External clock 19 + * @dev: device instance of wcd934x slim device 20 + * @irq: irq for wcd934x. 21 + */ 22 + struct wcd934x_ddata { 23 + struct regulator_bulk_data supplies[WCD934X_MAX_SUPPLY]; 24 + struct regmap_irq_chip_data *irq_data; 25 + struct regmap *regmap; 26 + struct clk *extclk; 27 + struct device *dev; 28 + int irq; 29 + }; 30 + 31 + #endif /* __WCD934X_H__ */