Commit 362067b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This release is almost all drivers, there's some small improvements in
  the core but otherwise everything is updates to drivers, mostly the
  addition of new ones.

  There's also a bunch of changes pulled in from the MFD subsystem as
  dependencies, Rockchip and TI core MFD code that the regulator drivers
  depend on.

  I've also yet again managed to put a SPI commit in the regulator tree,
  I don't know what it is about those two trees (this for
  spi-geni-qcom).

  Summary:

   - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
     TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a"

* tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (43 commits)
  regulator: Add Renesas PMIC RAA215300 driver
  regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
  regulator: ltc3676: Use maple tree register cache
  regulator: ltc3589: Use maple tree register cache
  regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap()
  regulator: mt6358: Use linear voltage helpers for single range regulators
  regulator: mt6358: Const-ify mt6358_regulator_info data structures
  regulator: mt6358: Drop *_SSHUB regulators
  regulator: mt6358: Merge VCN33_* regulators
  regulator: dt-bindings: mt6358: Drop *_sshub regulators
  regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators
  regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit"
  regulator: Switch two more i2c drivers back to use .probe()
  spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead
  soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma()
  regulator: tps6594-regulator: Add driver for TI TPS6594 regulators
  regulator: axp20x: Add AXP15060 support
  regulator: axp20x: Add support for AXP313a variant
  dt-bindings: pfuze100.yaml: Add an entry for interrupts
  regulator: stm32-pwr: Fix regulator disabling
  ...
parents 4171a9aa 54e47ead
This diff is collapsed.
...@@ -8,15 +8,14 @@ Documentation/devicetree/bindings/regulator/regulator.txt. ...@@ -8,15 +8,14 @@ Documentation/devicetree/bindings/regulator/regulator.txt.
The valid names for regulators are:: The valid names for regulators are::
BUCK: BUCK:
buck_vdram1, buck_vcore, buck_vcore_sshub, buck_vpa, buck_vproc11, buck_vdram1, buck_vcore, buck_vpa, buck_vproc11, buck_vproc12, buck_vgpu,
buck_vproc12, buck_vgpu, buck_vs2, buck_vmodem, buck_vs1 buck_vs2, buck_vmodem, buck_vs1
LDO: LDO:
ldo_vdram2, ldo_vsim1, ldo_vibr, ldo_vrf12, ldo_vio18, ldo_vusb, ldo_vcamio, ldo_vdram2, ldo_vsim1, ldo_vibr, ldo_vrf12, ldo_vio18, ldo_vusb, ldo_vcamio,
ldo_vcamd, ldo_vcn18, ldo_vfe28, ldo_vsram_proc11, ldo_vcn28, ldo_vsram_others, ldo_vcamd, ldo_vcn18, ldo_vfe28, ldo_vsram_proc11, ldo_vcn28, ldo_vsram_others,
ldo_vsram_others_sshub, ldo_vsram_gpu, ldo_vxo22, ldo_vefuse, ldo_vaux18, ldo_vsram_gpu, ldo_vxo22, ldo_vefuse, ldo_vaux18, ldo_vmch, ldo_vbif28,
ldo_vmch, ldo_vbif28, ldo_vsram_proc12, ldo_vcama1, ldo_vemc, ldo_vio28, ldo_va12, ldo_vsram_proc12, ldo_vcama1, ldo_vemc, ldo_vio28, ldo_va12, ldo_vrf18,
ldo_vrf18, ldo_vcn33_bt, ldo_vcn33_wifi, ldo_vcama2, ldo_vmc, ldo_vldo28, ldo_vaud28, ldo_vcn33, ldo_vcama2, ldo_vmc, ldo_vldo28, ldo_vaud28, ldo_vsim2
ldo_vsim2
Example: Example:
...@@ -305,15 +304,8 @@ Example: ...@@ -305,15 +304,8 @@ Example:
regulator-enable-ramp-delay = <120>; regulator-enable-ramp-delay = <120>;
}; };
mt6358_vcn33_bt_reg: ldo_vcn33_bt { mt6358_vcn33_reg: ldo_vcn33 {
regulator-name = "vcn33_bt"; regulator-name = "vcn33";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3500000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vcn33_wifi_reg: ldo_vcn33_wifi {
regulator-name = "vcn33_wifi";
regulator-min-microvolt = <3300000>; regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3500000>; regulator-max-microvolt = <3500000>;
regulator-enable-ramp-delay = <270>; regulator-enable-ramp-delay = <270>;
...@@ -354,17 +346,5 @@ Example: ...@@ -354,17 +346,5 @@ Example:
regulator-max-microvolt = <3100000>; regulator-max-microvolt = <3100000>;
regulator-enable-ramp-delay = <540>; regulator-enable-ramp-delay = <540>;
}; };
mt6358_vcore_sshub_reg: buck_vcore_sshub {
regulator-name = "vcore_sshub";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
};
mt6358_vsram_others_sshub_reg: ldo_vsram_others_sshub {
regulator-name = "vsram_others_sshub";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
};
}; };
}; };
...@@ -36,6 +36,9 @@ properties: ...@@ -36,6 +36,9 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
fsl,pfuze-support-disable-sw: fsl,pfuze-support-disable-sw:
$ref: /schemas/types.yaml#/definitions/flag $ref: /schemas/types.yaml#/definitions/flag
description: | description: |
......
...@@ -64,6 +64,7 @@ properties: ...@@ -64,6 +64,7 @@ properties:
defined, <100> is assumed, meaning that defined, <100> is assumed, meaning that
pwm-dutycycle-range contains values expressed in pwm-dutycycle-range contains values expressed in
percent. percent.
$ref: /schemas/types.yaml#/definitions/uint32
default: 100 default: 100
pwm-dutycycle-range: pwm-dutycycle-range:
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/renesas,raa215300.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
maintainers:
- Biju Das <biju.das.jz@bp.renesas.com>
description: |
The RAA215300 is a high-performance, low-cost 9-channel PMIC designed for
32-bit and 64-bit MCU and MPU applications. It supports DDR3, DDR3L, DDR4,
and LPDDR4 memory power requirements. The internally compensated regulators,
built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell
battery charger provide a highly integrated, small footprint power solution
ideal for System-On-Module (SOM) applications. A spread spectrum feature
provides an ease-of-use solution for noise-sensitive audio or RF applications.
This device exposes two devices via I2C. One for the integrated RTC IP, and
one for everything else.
Link to datasheet:
https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
properties:
compatible:
enum:
- renesas,raa215300
reg:
maxItems: 2
reg-names:
items:
- const: main
- const: rtc
interrupts:
maxItems: 1
clocks:
description: |
The clocks are optional. The RTC is disabled, if no clocks are
provided(either xin or clkin).
maxItems: 1
clock-names:
description: |
Use xin, if connected to an external crystal.
Use clkin, if connected to an external clock signal.
enum:
- xin
- clkin
required:
- compatible
- reg
- reg-names
additionalProperties: false
examples:
- |
/* 32.768kHz crystal */
x2: x2-clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};
i2c {
#address-cells = <1>;
#size-cells = <0>;
raa215300: pmic@12 {
compatible = "renesas,raa215300";
reg = <0x12>, <0x6f>;
reg-names = "main", "rtc";
clocks = <&x2>;
clock-names = "xin";
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/ti,tps62870.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI TPS62870/TPS62871/TPS62872/TPS62873 voltage regulator
maintainers:
- Mårten Lindahl <marten.lindahl@axis.com>
allOf:
- $ref: regulator.yaml#
properties:
compatible:
enum:
- ti,tps62870
- ti,tps62871
- ti,tps62872
- ti,tps62873
reg:
maxItems: 1
regulator-initial-mode:
enum: [ 1, 2 ]
description: 1 - Forced PWM mode, 2 - Low power mode
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
regulator@41 {
compatible = "ti,tps62873";
reg = <0x41>;
regulator-name = "+0.75V";
regulator-min-microvolt = <400000>;
regulator-max-microvolt = <1675000>;
regulator-initial-mode = <1>;
};
};
...
...@@ -82,7 +82,7 @@ config COMMON_CLK_MAX9485 ...@@ -82,7 +82,7 @@ config COMMON_CLK_MAX9485
config COMMON_CLK_RK808 config COMMON_CLK_RK808
tristate "Clock driver for RK805/RK808/RK809/RK817/RK818" tristate "Clock driver for RK805/RK808/RK809/RK817/RK818"
depends on MFD_RK808 depends on MFD_RK8XX
help help
This driver supports RK805, RK809 and RK817, RK808 and RK818 crystal oscillator clock. This driver supports RK805, RK809 and RK817, RK808 and RK818 crystal oscillator clock.
These multi-function devices have two fixed-rate oscillators, clocked at 32KHz each. These multi-function devices have two fixed-rate oscillators, clocked at 32KHz each.
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mfd/rk808.h> #include <linux/mfd/rk808.h>
#include <linux/i2c.h>
struct rk808_clkout { struct rk808_clkout {
struct rk808 *rk808; struct regmap *regmap;
struct clk_hw clkout1_hw; struct clk_hw clkout1_hw;
struct clk_hw clkout2_hw; struct clk_hw clkout2_hw;
}; };
...@@ -31,9 +30,8 @@ static int rk808_clkout2_enable(struct clk_hw *hw, bool enable) ...@@ -31,9 +30,8 @@ static int rk808_clkout2_enable(struct clk_hw *hw, bool enable)
struct rk808_clkout *rk808_clkout = container_of(hw, struct rk808_clkout *rk808_clkout = container_of(hw,
struct rk808_clkout, struct rk808_clkout,
clkout2_hw); clkout2_hw);
struct rk808 *rk808 = rk808_clkout->rk808;
return regmap_update_bits(rk808->regmap, RK808_CLK32OUT_REG, return regmap_update_bits(rk808_clkout->regmap, RK808_CLK32OUT_REG,
CLK32KOUT2_EN, enable ? CLK32KOUT2_EN : 0); CLK32KOUT2_EN, enable ? CLK32KOUT2_EN : 0);
} }
...@@ -52,10 +50,9 @@ static int rk808_clkout2_is_prepared(struct clk_hw *hw) ...@@ -52,10 +50,9 @@ static int rk808_clkout2_is_prepared(struct clk_hw *hw)
struct rk808_clkout *rk808_clkout = container_of(hw, struct rk808_clkout *rk808_clkout = container_of(hw,
struct rk808_clkout, struct rk808_clkout,
clkout2_hw); clkout2_hw);
struct rk808 *rk808 = rk808_clkout->rk808;
uint32_t val; uint32_t val;
int ret = regmap_read(rk808->regmap, RK808_CLK32OUT_REG, &val); int ret = regmap_read(rk808_clkout->regmap, RK808_CLK32OUT_REG, &val);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -93,9 +90,8 @@ static int rk817_clkout2_enable(struct clk_hw *hw, bool enable) ...@@ -93,9 +90,8 @@ static int rk817_clkout2_enable(struct clk_hw *hw, bool enable)
struct rk808_clkout *rk808_clkout = container_of(hw, struct rk808_clkout *rk808_clkout = container_of(hw,
struct rk808_clkout, struct rk808_clkout,
clkout2_hw); clkout2_hw);
struct rk808 *rk808 = rk808_clkout->rk808;
return regmap_update_bits(rk808->regmap, RK817_SYS_CFG(1), return regmap_update_bits(rk808_clkout->regmap, RK817_SYS_CFG(1),
RK817_CLK32KOUT2_EN, RK817_CLK32KOUT2_EN,
enable ? RK817_CLK32KOUT2_EN : 0); enable ? RK817_CLK32KOUT2_EN : 0);
} }
...@@ -115,10 +111,9 @@ static int rk817_clkout2_is_prepared(struct clk_hw *hw) ...@@ -115,10 +111,9 @@ static int rk817_clkout2_is_prepared(struct clk_hw *hw)
struct rk808_clkout *rk808_clkout = container_of(hw, struct rk808_clkout *rk808_clkout = container_of(hw,
struct rk808_clkout, struct rk808_clkout,
clkout2_hw); clkout2_hw);
struct rk808 *rk808 = rk808_clkout->rk808;
unsigned int val; unsigned int val;
int ret = regmap_read(rk808->regmap, RK817_SYS_CFG(1), &val); int ret = regmap_read(rk808_clkout->regmap, RK817_SYS_CFG(1), &val);
if (ret < 0) if (ret < 0)
return 0; return 0;
...@@ -153,18 +148,21 @@ static const struct clk_ops *rkpmic_get_ops(long variant) ...@@ -153,18 +148,21 @@ static const struct clk_ops *rkpmic_get_ops(long variant)
static int rk808_clkout_probe(struct platform_device *pdev) static int rk808_clkout_probe(struct platform_device *pdev)
{ {
struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
struct i2c_client *client = rk808->i2c; struct device *dev = &pdev->dev;
struct device_node *node = client->dev.of_node;
struct clk_init_data init = {}; struct clk_init_data init = {};
struct rk808_clkout *rk808_clkout; struct rk808_clkout *rk808_clkout;
int ret; int ret;
rk808_clkout = devm_kzalloc(&client->dev, dev->of_node = pdev->dev.parent->of_node;
rk808_clkout = devm_kzalloc(dev,
sizeof(*rk808_clkout), GFP_KERNEL); sizeof(*rk808_clkout), GFP_KERNEL);
if (!rk808_clkout) if (!rk808_clkout)
return -ENOMEM; return -ENOMEM;
rk808_clkout->rk808 = rk808; rk808_clkout->regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!rk808_clkout->regmap)
return -ENODEV;
init.parent_names = NULL; init.parent_names = NULL;
init.num_parents = 0; init.num_parents = 0;
...@@ -173,10 +171,10 @@ static int rk808_clkout_probe(struct platform_device *pdev) ...@@ -173,10 +171,10 @@ static int rk808_clkout_probe(struct platform_device *pdev)
rk808_clkout->clkout1_hw.init = &init; rk808_clkout->clkout1_hw.init = &init;
/* optional override of the clockname */ /* optional override of the clockname */
of_property_read_string_index(node, "clock-output-names", of_property_read_string_index(dev->of_node, "clock-output-names",
0, &init.name); 0, &init.name);
ret = devm_clk_hw_register(&client->dev, &rk808_clkout->clkout1_hw); ret = devm_clk_hw_register(dev, &rk808_clkout->clkout1_hw);
if (ret) if (ret)
return ret; return ret;
...@@ -185,10 +183,10 @@ static int rk808_clkout_probe(struct platform_device *pdev) ...@@ -185,10 +183,10 @@ static int rk808_clkout_probe(struct platform_device *pdev)
rk808_clkout->clkout2_hw.init = &init; rk808_clkout->clkout2_hw.init = &init;
/* optional override of the clockname */ /* optional override of the clockname */
of_property_read_string_index(node, "clock-output-names", of_property_read_string_index(dev->of_node, "clock-output-names",
1, &init.name); 1, &init.name);
ret = devm_clk_hw_register(&client->dev, &rk808_clkout->clkout2_hw); ret = devm_clk_hw_register(dev, &rk808_clkout->clkout2_hw);
if (ret) if (ret)
return ret; return ret;
......
...@@ -609,7 +609,7 @@ config INPUT_PWM_VIBRA ...@@ -609,7 +609,7 @@ config INPUT_PWM_VIBRA
config INPUT_RK805_PWRKEY config INPUT_RK805_PWRKEY
tristate "Rockchip RK805 PMIC power key support" tristate "Rockchip RK805 PMIC power key support"
depends on MFD_RK808 depends on MFD_RK8XX
help help
Select this option to enable power key driver for RK805. Select this option to enable power key driver for RK805.
......
...@@ -1183,12 +1183,17 @@ config MFD_RC5T583 ...@@ -1183,12 +1183,17 @@ config MFD_RC5T583
Additional drivers must be enabled in order to use the Additional drivers must be enabled in order to use the
different functionality of the device. different functionality of the device.
config MFD_RK808 config MFD_RK8XX
bool
select MFD_CORE
config MFD_RK8XX_I2C
tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip" tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip"
depends on I2C && OF depends on I2C && OF
select MFD_CORE select MFD_CORE
select REGMAP_I2C select REGMAP_I2C
select REGMAP_IRQ select REGMAP_IRQ
select MFD_RK8XX
help help
If you say yes here you get support for the RK805, RK808, RK809, If you say yes here you get support for the RK805, RK808, RK809,
RK817 and RK818 Power Management chips. RK817 and RK818 Power Management chips.
...@@ -1196,6 +1201,20 @@ config MFD_RK808 ...@@ -1196,6 +1201,20 @@ config MFD_RK808
through I2C interface. The device supports multiple sub-devices through I2C interface. The device supports multiple sub-devices
including interrupts, RTC, LDO & DCDC regulators, and onkey. including interrupts, RTC, LDO & DCDC regulators, and onkey.
config MFD_RK8XX_SPI
tristate "Rockchip RK806 Power Management Chip"
depends on SPI && OF
select MFD_CORE
select REGMAP_SPI
select REGMAP_IRQ
select MFD_RK8XX
help
If you say yes here you get support for the RK806 Power Management
chip.
This driver provides common support for accessing the device
through an SPI interface. The device supports multiple sub-devices
including interrupts, LDO & DCDC regulators, and power on-key.
config MFD_RN5T618 config MFD_RN5T618
tristate "Ricoh RN5T567/618 PMIC" tristate "Ricoh RN5T567/618 PMIC"
depends on I2C depends on I2C
...@@ -1679,6 +1698,38 @@ config MFD_TPS65912_SPI ...@@ -1679,6 +1698,38 @@ config MFD_TPS65912_SPI
If you say yes here you get support for the TPS65912 series of If you say yes here you get support for the TPS65912 series of
PM chips with SPI interface. PM chips with SPI interface.
config MFD_TPS6594
tristate
select MFD_CORE
select REGMAP
select REGMAP_IRQ
config MFD_TPS6594_I2C
tristate "TI TPS6594 Power Management chip with I2C"
select MFD_TPS6594
select REGMAP_I2C
select CRC8
depends on I2C
help
If you say yes here you get support for the TPS6594 series of
PM chips with I2C interface.
This driver can also be built as a module. If so, the module
will be called tps6594-i2c.
config MFD_TPS6594_SPI
tristate "TI TPS6594 Power Management chip with SPI"
select MFD_TPS6594
select REGMAP_SPI
select CRC8
depends on SPI_MASTER
help
If you say yes here you get support for the TPS6594 series of
PM chips with SPI interface.
This driver can also be built as a module. If so, the module
will be called tps6594-spi.
config TWL4030_CORE config TWL4030_CORE
bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support" bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"
depends on I2C=y depends on I2C=y
......
...@@ -96,6 +96,9 @@ obj-$(CONFIG_MFD_TPS65910) += tps65910.o ...@@ -96,6 +96,9 @@ obj-$(CONFIG_MFD_TPS65910) += tps65910.o
obj-$(CONFIG_MFD_TPS65912) += tps65912-core.o obj-$(CONFIG_MFD_TPS65912) += tps65912-core.o
obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o
obj-$(CONFIG_MFD_TPS65912_SPI) += tps65912-spi.o obj-$(CONFIG_MFD_TPS65912_SPI) += tps65912-spi.o
obj-$(CONFIG_MFD_TPS6594) += tps6594-core.o
obj-$(CONFIG_MFD_TPS6594_I2C) += tps6594-i2c.o
obj-$(CONFIG_MFD_TPS6594_SPI) += tps6594-spi.o
obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
...@@ -214,7 +217,9 @@ obj-$(CONFIG_MFD_PALMAS) += palmas.o ...@@ -214,7 +217,9 @@ obj-$(CONFIG_MFD_PALMAS) += palmas.o
obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o
obj-$(CONFIG_MFD_NTXEC) += ntxec.o obj-$(CONFIG_MFD_NTXEC) += ntxec.o
obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o
obj-$(CONFIG_MFD_RK808) += rk808.o obj-$(CONFIG_MFD_RK8XX) += rk8xx-core.o
obj-$(CONFIG_MFD_RK8XX_I2C) += rk8xx-i2c.o
obj-$(CONFIG_MFD_RK8XX_SPI) += rk8xx-spi.o
obj-$(CONFIG_MFD_RN5T618) += rn5t618.o obj-$(CONFIG_MFD_RN5T618) += rn5t618.o
obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o
obj-$(CONFIG_MFD_SYSCON) += syscon.o obj-$(CONFIG_MFD_SYSCON) += syscon.o
......
...@@ -63,6 +63,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = { ...@@ -63,6 +63,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
{ .compatible = "x-powers,axp209", .data = (void *)AXP209_ID }, { .compatible = "x-powers,axp209", .data = (void *)AXP209_ID },
{ .compatible = "x-powers,axp221", .data = (void *)AXP221_ID }, { .compatible = "x-powers,axp221", .data = (void *)AXP221_ID },
{ .compatible = "x-powers,axp223", .data = (void *)AXP223_ID }, { .compatible = "x-powers,axp223", .data = (void *)AXP223_ID },
{ .compatible = "x-powers,axp313a", .data = (void *)AXP313A_ID },
{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID }, { .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID }, { .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
{ .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID }, { .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID },
...@@ -77,6 +78,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = { ...@@ -77,6 +78,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
{ "axp209", 0 }, { "axp209", 0 },
{ "axp221", 0 }, { "axp221", 0 },
{ "axp223", 0 }, { "axp223", 0 },
{ "axp313a", 0 },
{ "axp803", 0 }, { "axp803", 0 },
{ "axp806", 0 }, { "axp806", 0 },
{ "axp15060", 0 }, { "axp15060", 0 },
......
...@@ -39,6 +39,7 @@ static const char * const axp20x_model_names[] = { ...@@ -39,6 +39,7 @@ static const char * const axp20x_model_names[] = {
"AXP221", "AXP221",
"AXP223", "AXP223",
"AXP288", "AXP288",
"AXP313a",
"AXP803", "AXP803",
"AXP806", "AXP806",
"AXP809", "AXP809",
...@@ -156,6 +157,25 @@ static const struct regmap_range axp806_writeable_ranges[] = { ...@@ -156,6 +157,25 @@ static const struct regmap_range axp806_writeable_ranges[] = {
regmap_reg_range(AXP806_REG_ADDR_EXT, AXP806_REG_ADDR_EXT), regmap_reg_range(AXP806_REG_ADDR_EXT, AXP806_REG_ADDR_EXT),
}; };
static const struct regmap_range axp313a_writeable_ranges[] = {
regmap_reg_range(AXP313A_ON_INDICATE, AXP313A_IRQ_STATE),
};
static const struct regmap_range axp313a_volatile_ranges[] = {
regmap_reg_range(AXP313A_SHUTDOWN_CTRL, AXP313A_SHUTDOWN_CTRL),
regmap_reg_range(AXP313A_IRQ_STATE, AXP313A_IRQ_STATE),
};
static const struct regmap_access_table axp313a_writeable_table = {
.yes_ranges = axp313a_writeable_ranges,
.n_yes_ranges = ARRAY_SIZE(axp313a_writeable_ranges),
};
static const struct regmap_access_table axp313a_volatile_table = {
.yes_ranges = axp313a_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(axp313a_volatile_ranges),
};
static const struct regmap_range axp806_volatile_ranges[] = { static const struct regmap_range axp806_volatile_ranges[] = {
regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE), regmap_reg_range(AXP20X_IRQ1_STATE, AXP20X_IRQ2_STATE),
}; };
...@@ -248,6 +268,11 @@ static const struct resource axp288_fuel_gauge_resources[] = { ...@@ -248,6 +268,11 @@ static const struct resource axp288_fuel_gauge_resources[] = {
DEFINE_RES_IRQ(AXP288_IRQ_WL1), DEFINE_RES_IRQ(AXP288_IRQ_WL1),
}; };
static const struct resource axp313a_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP313A_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP313A_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
};
static const struct resource axp803_pek_resources[] = { static const struct resource axp803_pek_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"), DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"), DEFINE_RES_IRQ_NAMED(AXP803_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
...@@ -304,6 +329,15 @@ static const struct regmap_config axp288_regmap_config = { ...@@ -304,6 +329,15 @@ static const struct regmap_config axp288_regmap_config = {
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_RBTREE,
}; };
static const struct regmap_config axp313a_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.wr_table = &axp313a_writeable_table,
.volatile_table = &axp313a_volatile_table,
.max_register = AXP313A_IRQ_STATE,
.cache_type = REGCACHE_RBTREE,
};
static const struct regmap_config axp806_regmap_config = { static const struct regmap_config axp806_regmap_config = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 8, .val_bits = 8,
...@@ -456,6 +490,16 @@ static const struct regmap_irq axp288_regmap_irqs[] = { ...@@ -456,6 +490,16 @@ static const struct regmap_irq axp288_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP288, BC_USB_CHNG, 5, 1), INIT_REGMAP_IRQ(AXP288, BC_USB_CHNG, 5, 1),
}; };
static const struct regmap_irq axp313a_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP313A, PEK_RIS_EDGE, 0, 7),
INIT_REGMAP_IRQ(AXP313A, PEK_FAL_EDGE, 0, 6),
INIT_REGMAP_IRQ(AXP313A, PEK_SHORT, 0, 5),
INIT_REGMAP_IRQ(AXP313A, PEK_LONG, 0, 4),
INIT_REGMAP_IRQ(AXP313A, DCDC3_V_LOW, 0, 3),
INIT_REGMAP_IRQ(AXP313A, DCDC2_V_LOW, 0, 2),
INIT_REGMAP_IRQ(AXP313A, DIE_TEMP_HIGH, 0, 0),
};
static const struct regmap_irq axp803_regmap_irqs[] = { static const struct regmap_irq axp803_regmap_irqs[] = {
INIT_REGMAP_IRQ(AXP803, ACIN_OVER_V, 0, 7), INIT_REGMAP_IRQ(AXP803, ACIN_OVER_V, 0, 7),
INIT_REGMAP_IRQ(AXP803, ACIN_PLUGIN, 0, 6), INIT_REGMAP_IRQ(AXP803, ACIN_PLUGIN, 0, 6),
...@@ -606,6 +650,17 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = { ...@@ -606,6 +650,17 @@ static const struct regmap_irq_chip axp288_regmap_irq_chip = {
}; };
static const struct regmap_irq_chip axp313a_regmap_irq_chip = {
.name = "axp313a_irq_chip",
.status_base = AXP313A_IRQ_STATE,
.ack_base = AXP313A_IRQ_STATE,
.unmask_base = AXP313A_IRQ_EN,
.init_ack_masked = true,
.irqs = axp313a_regmap_irqs,
.num_irqs = ARRAY_SIZE(axp313a_regmap_irqs),
.num_regs = 1,
};
static const struct regmap_irq_chip axp803_regmap_irq_chip = { static const struct regmap_irq_chip axp803_regmap_irq_chip = {
.name = "axp803", .name = "axp803",
.status_base = AXP20X_IRQ1_STATE, .status_base = AXP20X_IRQ1_STATE,
...@@ -745,6 +800,11 @@ static const struct mfd_cell axp152_cells[] = { ...@@ -745,6 +800,11 @@ static const struct mfd_cell axp152_cells[] = {
}, },
}; };
static struct mfd_cell axp313a_cells[] = {
MFD_CELL_NAME("axp20x-regulator"),
MFD_CELL_RES("axp313a-pek", axp313a_pek_resources),
};
static const struct resource axp288_adc_resources[] = { static const struct resource axp288_adc_resources[] = {
DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"), DEFINE_RES_IRQ_NAMED(AXP288_IRQ_GPADC, "GPADC"),
}; };
...@@ -914,8 +974,18 @@ static const struct mfd_cell axp_regulator_only_cells[] = { ...@@ -914,8 +974,18 @@ static const struct mfd_cell axp_regulator_only_cells[] = {
static int axp20x_power_off(struct sys_off_data *data) static int axp20x_power_off(struct sys_off_data *data)
{ {
struct axp20x_dev *axp20x = data->cb_data; struct axp20x_dev *axp20x = data->cb_data;
unsigned int shutdown_reg;
regmap_write(axp20x->regmap, AXP20X_OFF_CTRL, AXP20X_OFF); switch (axp20x->variant) {
case AXP313A_ID:
shutdown_reg = AXP313A_SHUTDOWN_CTRL;
break;
default:
shutdown_reg = AXP20X_OFF_CTRL;
break;
}
regmap_write(axp20x->regmap, shutdown_reg, AXP20X_OFF);
/* Give capacitors etc. time to drain to avoid kernel panic msg. */ /* Give capacitors etc. time to drain to avoid kernel panic msg. */
mdelay(500); mdelay(500);
...@@ -978,6 +1048,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x) ...@@ -978,6 +1048,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
axp20x->regmap_irq_chip = &axp288_regmap_irq_chip; axp20x->regmap_irq_chip = &axp288_regmap_irq_chip;
axp20x->irq_flags = IRQF_TRIGGER_LOW; axp20x->irq_flags = IRQF_TRIGGER_LOW;
break; break;
case AXP313A_ID:
axp20x->nr_cells = ARRAY_SIZE(axp313a_cells);
axp20x->cells = axp313a_cells;
axp20x->regmap_cfg = &axp313a_regmap_config;
axp20x->regmap_irq_chip = &axp313a_regmap_irq_chip;
break;
case AXP803_ID: case AXP803_ID:
axp20x->nr_cells = ARRAY_SIZE(axp803_cells); axp20x->nr_cells = ARRAY_SIZE(axp803_cells);
axp20x->cells = axp803_cells; axp20x->cells = axp803_cells;
......
// SPDX-License-Identifier: GPL-2.0-only
/*
* Rockchip RK808/RK818 Core (I2C) driver
*
* Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
* Copyright (C) 2016 PHYTEC Messtechnik GmbH
*
* Author: Chris Zhong <zyw@rock-chips.com>
* Author: Zhang Qing <zhangqing@rock-chips.com>
* Author: Wadim Egorov <w.egorov@phytec.de>
*/
#include <linux/i2c.h>
#include <linux/mfd/rk808.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
struct rk8xx_i2c_platform_data {
const struct regmap_config *regmap_cfg;
int variant;
};
static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg)
{
/*
* Notes:
* - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but
* we don't use that feature. It's better to cache.
* - It's unlikely we care that RK808_DEVCTRL_REG is volatile since
* bits are cleared in case when we shutoff anyway, but better safe.
*/
switch (reg) {
case RK808_SECONDS_REG ... RK808_WEEKS_REG:
case RK808_RTC_STATUS_REG:
case RK808_VB_MON_REG:
case RK808_THERMAL_REG:
case RK808_DCDC_UV_STS_REG:
case RK808_LDO_UV_STS_REG:
case RK808_DCDC_PG_REG:
case RK808_LDO_PG_REG:
case RK808_DEVCTRL_REG:
case RK808_INT_STS_REG1:
case RK808_INT_STS_REG2:
return true;
}
return false;
}
static bool rk817_is_volatile_reg(struct device *dev, unsigned int reg)
{
/*
* Notes:
* - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but
* we don't use that feature. It's better to cache.
*/
switch (reg) {
case RK817_SECONDS_REG ... RK817_WEEKS_REG:
case RK817_RTC_STATUS_REG:
case RK817_CODEC_DTOP_LPT_SRST:
case RK817_GAS_GAUGE_ADC_CONFIG0 ... RK817_GAS_GAUGE_CUR_ADC_K0:
case RK817_PMIC_CHRG_STS:
case RK817_PMIC_CHRG_OUT:
case RK817_PMIC_CHRG_IN:
case RK817_INT_STS_REG0:
case RK817_INT_STS_REG1:
case RK817_INT_STS_REG2:
case RK817_SYS_STS:
return true;
}
return false;
}
static const struct regmap_config rk818_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RK818_USB_CTRL_REG,
.cache_type = REGCACHE_RBTREE,
.volatile_reg = rk808_is_volatile_reg,
};
static const struct regmap_config rk805_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RK805_OFF_SOURCE_REG,
.cache_type = REGCACHE_RBTREE,
.volatile_reg = rk808_is_volatile_reg,
};
static const struct regmap_config rk808_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RK808_IO_POL_REG,
.cache_type = REGCACHE_RBTREE,
.volatile_reg = rk808_is_volatile_reg,
};
static const struct regmap_config rk817_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RK817_GPIO_INT_CFG,
.cache_type = REGCACHE_NONE,
.volatile_reg = rk817_is_volatile_reg,
};
static const struct rk8xx_i2c_platform_data rk805_data = {
.regmap_cfg = &rk805_regmap_config,
.variant = RK805_ID,
};
static const struct rk8xx_i2c_platform_data rk808_data = {
.regmap_cfg = &rk808_regmap_config,
.variant = RK808_ID,
};
static const struct rk8xx_i2c_platform_data rk809_data = {
.regmap_cfg = &rk817_regmap_config,
.variant = RK809_ID,
};
static const struct rk8xx_i2c_platform_data rk817_data = {
.regmap_cfg = &rk817_regmap_config,
.variant = RK817_ID,
};
static const struct rk8xx_i2c_platform_data rk818_data = {
.regmap_cfg = &rk818_regmap_config,
.variant = RK818_ID,
};
static int rk8xx_i2c_probe(struct i2c_client *client)
{
const struct rk8xx_i2c_platform_data *data;
struct regmap *regmap;
data = device_get_match_data(&client->dev);
if (!data)
return -ENODEV;
regmap = devm_regmap_init_i2c(client, data->regmap_cfg);
if (IS_ERR(regmap))
return dev_err_probe(&client->dev, PTR_ERR(regmap),
"regmap initialization failed\n");
return rk8xx_probe(&client->dev, data->variant, client->irq, regmap);
}
static void rk8xx_i2c_shutdown(struct i2c_client *client)
{
rk8xx_shutdown(&client->dev);
}
static SIMPLE_DEV_PM_OPS(rk8xx_i2c_pm_ops, rk8xx_suspend, rk8xx_resume);
static const struct of_device_id rk8xx_i2c_of_match[] = {
{ .compatible = "rockchip,rk805", .data = &rk805_data },
{ .compatible = "rockchip,rk808", .data = &rk808_data },
{ .compatible = "rockchip,rk809", .data = &rk809_data },
{ .compatible = "rockchip,rk817", .data = &rk817_data },
{ .compatible = "rockchip,rk818", .data = &rk818_data },
{ },
};
MODULE_DEVICE_TABLE(of, rk8xx_i2c_of_match);
static struct i2c_driver rk8xx_i2c_driver = {
.driver = {
.name = "rk8xx-i2c",
.of_match_table = rk8xx_i2c_of_match,
.pm = &rk8xx_i2c_pm_ops,
},
.probe_new = rk8xx_i2c_probe,
.shutdown = rk8xx_i2c_shutdown,
};
module_i2c_driver(rk8xx_i2c_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
MODULE_AUTHOR("Zhang Qing <zhangqing@rock-chips.com>");
MODULE_AUTHOR("Wadim Egorov <w.egorov@phytec.de>");
MODULE_DESCRIPTION("RK8xx I2C PMIC driver");
// SPDX-License-Identifier: GPL-2.0
/*
* Rockchip RK806 Core (SPI) driver
*
* Copyright (c) 2021 Rockchip Electronics Co., Ltd.
* Copyright (c) 2023 Collabora Ltd.
*
* Author: Xu Shengfei <xsf@rock-chips.com>
* Author: Sebastian Reichel <sebastian.reichel@collabora.com>
*/
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/mfd/rk808.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#define RK806_ADDR_SIZE 2
#define RK806_CMD_WITH_SIZE(CMD, VALUE_BYTES) \
(RK806_CMD_##CMD | RK806_CMD_CRC_DIS | (VALUE_BYTES - 1))
static const struct regmap_range rk806_volatile_ranges[] = {
regmap_reg_range(RK806_POWER_EN0, RK806_POWER_EN5),
regmap_reg_range(RK806_DVS_START_CTRL, RK806_INT_MSK1),
};
static const struct regmap_access_table rk806_volatile_table = {
.yes_ranges = rk806_volatile_ranges,
.n_yes_ranges = ARRAY_SIZE(rk806_volatile_ranges),
};
static const struct regmap_config rk806_regmap_config_spi = {
.reg_bits = 16,
.val_bits = 8,
.max_register = RK806_BUCK_RSERVE_REG5,
.cache_type = REGCACHE_RBTREE,
.volatile_table = &rk806_volatile_table,
};
static int rk806_spi_bus_write(void *context, const void *vdata, size_t count)
{
struct device *dev = context;
struct spi_device *spi = to_spi_device(dev);
struct spi_transfer xfer[2] = { 0 };
/* data and thus count includes the register address */
size_t val_size = count - RK806_ADDR_SIZE;
char cmd;
if (val_size < 1 || val_size > (RK806_CMD_LEN_MSK + 1))
return -EINVAL;
cmd = RK806_CMD_WITH_SIZE(WRITE, val_size);
xfer[0].tx_buf = &cmd;
xfer[0].len = sizeof(cmd);
xfer[1].tx_buf = vdata;
xfer[1].len = count;
return spi_sync_transfer(spi, xfer, ARRAY_SIZE(xfer));
}
static int rk806_spi_bus_read(void *context, const void *vreg, size_t reg_size,
void *val, size_t val_size)
{
struct device *dev = context;
struct spi_device *spi = to_spi_device(dev);
char txbuf[3] = { 0 };
if (reg_size != RK806_ADDR_SIZE ||
val_size < 1 || val_size > (RK806_CMD_LEN_MSK + 1))
return -EINVAL;
/* TX buffer contains command byte followed by two address bytes */
txbuf[0] = RK806_CMD_WITH_SIZE(READ, val_size);
memcpy(txbuf+1, vreg, reg_size);
return spi_write_then_read(spi, txbuf, sizeof(txbuf), val, val_size);
}
static const struct regmap_bus rk806_regmap_bus_spi = {
.write = rk806_spi_bus_write,
.read = rk806_spi_bus_read,
.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
};
static int rk8xx_spi_probe(struct spi_device *spi)
{
struct regmap *regmap;
regmap = devm_regmap_init(&spi->dev, &rk806_regmap_bus_spi,
&spi->dev, &rk806_regmap_config_spi);
if (IS_ERR(regmap))
return dev_err_probe(&spi->dev, PTR_ERR(regmap),
"Failed to init regmap\n");
return rk8xx_probe(&spi->dev, RK806_ID, spi->irq, regmap);
}
static const struct of_device_id rk8xx_spi_of_match[] = {
{ .compatible = "rockchip,rk806", },
{ }
};
MODULE_DEVICE_TABLE(of, rk8xx_spi_of_match);
static const struct spi_device_id rk8xx_spi_id_table[] = {
{ "rk806", 0 },
{ }
};
MODULE_DEVICE_TABLE(spi, rk8xx_spi_id_table);
static struct spi_driver rk8xx_spi_driver = {
.driver = {
.name = "rk8xx-spi",
.of_match_table = rk8xx_spi_of_match,
},
.probe = rk8xx_spi_probe,
.id_table = rk8xx_spi_id_table,
};
module_spi_driver(rk8xx_spi_driver);
MODULE_AUTHOR("Xu Shengfei <xsf@rock-chips.com>");
MODULE_DESCRIPTION("RK8xx SPI PMIC driver");
MODULE_LICENSE("GPL");
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0
/*
* I2C access driver for TI TPS6594/TPS6593/LP8764 PMICs
*
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
*/
#include <linux/crc8.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/mfd/tps6594.h>
static bool enable_crc;
module_param(enable_crc, bool, 0444);
MODULE_PARM_DESC(enable_crc, "Enable CRC feature for I2C interface");
DECLARE_CRC8_TABLE(tps6594_i2c_crc_table);
static int tps6594_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
int ret = i2c_transfer(adap, msgs, num);
if (ret == num)
return 0;
else if (ret < 0)
return ret;
else
return -EIO;
}
static int tps6594_i2c_reg_read_with_crc(struct i2c_client *client, u8 page, u8 reg, u8 *val)
{
struct i2c_msg msgs[2];
u8 buf_rx[] = { 0, 0 };
/* I2C address = I2C base address + Page index */
const u8 addr = client->addr + page;
/*
* CRC is calculated from every bit included in the protocol
* except the ACK bits from the target. Byte stream is:
* - B0: (I2C_addr_7bits << 1) | WR_bit, with WR_bit = 0
* - B1: reg
* - B2: (I2C_addr_7bits << 1) | RD_bit, with RD_bit = 1
* - B3: val
* - B4: CRC from B0-B1-B2-B3
*/
u8 crc_data[] = { addr << 1, reg, addr << 1 | 1, 0 };
int ret;
/* Write register */
msgs[0].addr = addr;
msgs[0].flags = 0;
msgs[0].len = 1;
msgs[0].buf = &reg;
/* Read data and CRC */
msgs[1].addr = msgs[0].addr;
msgs[1].flags = I2C_M_RD;
msgs[1].len = 2;
msgs[1].buf = buf_rx;
ret = tps6594_i2c_transfer(client->adapter, msgs, 2);
if (ret < 0)
return ret;
crc_data[sizeof(crc_data) - 1] = *val = buf_rx[0];
if (buf_rx[1] != crc8(tps6594_i2c_crc_table, crc_data, sizeof(crc_data), CRC8_INIT_VALUE))
return -EIO;
return ret;
}
static int tps6594_i2c_reg_write_with_crc(struct i2c_client *client, u8 page, u8 reg, u8 val)
{
struct i2c_msg msg;
u8 buf[] = { reg, val, 0 };
/* I2C address = I2C base address + Page index */
const u8 addr = client->addr + page;
/*
* CRC is calculated from every bit included in the protocol
* except the ACK bits from the target. Byte stream is:
* - B0: (I2C_addr_7bits << 1) | WR_bit, with WR_bit = 0
* - B1: reg
* - B2: val
* - B3: CRC from B0-B1-B2
*/
const u8 crc_data[] = { addr << 1, reg, val };
/* Write register, data and CRC */
msg.addr = addr;
msg.flags = client->flags & I2C_M_TEN;
msg.len = sizeof(buf);
msg.buf = buf;
buf[msg.len - 1] = crc8(tps6594_i2c_crc_table, crc_data, sizeof(crc_data), CRC8_INIT_VALUE);
return tps6594_i2c_transfer(client->adapter, &msg, 1);
}
static int tps6594_i2c_read(void *context, const void *reg_buf, size_t reg_size,
void *val_buf, size_t val_size)
{
struct i2c_client *client = context;
struct tps6594 *tps = i2c_get_clientdata(client);
struct i2c_msg msgs[2];
const u8 *reg_bytes = reg_buf;
u8 *val_bytes = val_buf;
const u8 page = reg_bytes[1];
u8 reg = reg_bytes[0];
int ret = 0;
int i;
if (tps->use_crc) {
/*
* Auto-increment feature does not support CRC protocol.
* Converts the bulk read operation into a series of single read operations.
*/
for (i = 0 ; ret == 0 && i < val_size ; i++)
ret = tps6594_i2c_reg_read_with_crc(client, page, reg + i, val_bytes + i);
return ret;
}
/* Write register: I2C address = I2C base address + Page index */
msgs[0].addr = client->addr + page;
msgs[0].flags = 0;
msgs[0].len = 1;
msgs[0].buf = &reg;
/* Read data */
msgs[1].addr = msgs[0].addr;
msgs[1].flags = I2C_M_RD;
msgs[1].len = val_size;
msgs[1].buf = val_bytes;
return tps6594_i2c_transfer(client->adapter, msgs, 2);
}
static int tps6594_i2c_write(void *context, const void *data, size_t count)
{
struct i2c_client *client = context;
struct tps6594 *tps = i2c_get_clientdata(client);
struct i2c_msg msg;
const u8 *bytes = data;
u8 *buf;
const u8 page = bytes[1];
const u8 reg = bytes[0];
int ret = 0;
int i;
if (tps->use_crc) {
/*
* Auto-increment feature does not support CRC protocol.
* Converts the bulk write operation into a series of single write operations.
*/
for (i = 0 ; ret == 0 && i < count - 2 ; i++)
ret = tps6594_i2c_reg_write_with_crc(client, page, reg + i, bytes[i + 2]);
return ret;
}
/* Setup buffer: page byte is not sent */
buf = kzalloc(--count, GFP_KERNEL);
if (!buf)
return -ENOMEM;
buf[0] = reg;
for (i = 0 ; i < count - 1 ; i++)
buf[i + 1] = bytes[i + 2];
/* Write register and data: I2C address = I2C base address + Page index */
msg.addr = client->addr + page;
msg.flags = client->flags & I2C_M_TEN;
msg.len = count;
msg.buf = buf;
ret = tps6594_i2c_transfer(client->adapter, &msg, 1);
kfree(buf);
return ret;
}
static const struct regmap_config tps6594_i2c_regmap_config = {
.reg_bits = 16,
.val_bits = 8,
.max_register = TPS6594_REG_DWD_FAIL_CNT_REG,
.volatile_reg = tps6594_is_volatile_reg,
.read = tps6594_i2c_read,
.write = tps6594_i2c_write,
};
static const struct of_device_id tps6594_i2c_of_match_table[] = {
{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
{}
};
MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table);
static int tps6594_i2c_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct tps6594 *tps;
const struct of_device_id *match;
tps = devm_kzalloc(dev, sizeof(*tps), GFP_KERNEL);
if (!tps)
return -ENOMEM;
i2c_set_clientdata(client, tps);
tps->dev = dev;
tps->reg = client->addr;
tps->irq = client->irq;
tps->regmap = devm_regmap_init(dev, NULL, client, &tps6594_i2c_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
match = of_match_device(tps6594_i2c_of_match_table, dev);
if (!match)
return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data;
crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL);
return tps6594_device_init(tps, enable_crc);
}
static struct i2c_driver tps6594_i2c_driver = {
.driver = {
.name = "tps6594",
.of_match_table = tps6594_i2c_of_match_table,
},
.probe_new = tps6594_i2c_probe,
};
module_i2c_driver(tps6594_i2c_driver);
MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>");
MODULE_DESCRIPTION("TPS6594 I2C Interface Driver");
MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0
/*
* SPI access driver for TI TPS6594/TPS6593/LP8764 PMICs
*
* Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
*/
#include <linux/crc8.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/mfd/tps6594.h>
#define TPS6594_SPI_PAGE_SHIFT 5
#define TPS6594_SPI_READ_BIT BIT(4)
static bool enable_crc;
module_param(enable_crc, bool, 0444);
MODULE_PARM_DESC(enable_crc, "Enable CRC feature for SPI interface");
DECLARE_CRC8_TABLE(tps6594_spi_crc_table);
static int tps6594_spi_reg_read(void *context, unsigned int reg, unsigned int *val)
{
struct spi_device *spi = context;
struct tps6594 *tps = spi_get_drvdata(spi);
u8 buf[4] = { 0 };
size_t count_rx = 1;
int ret;
buf[0] = reg;
buf[1] = TPS6594_REG_TO_PAGE(reg) << TPS6594_SPI_PAGE_SHIFT | TPS6594_SPI_READ_BIT;
if (tps->use_crc)
count_rx++;
ret = spi_write_then_read(spi, buf, 2, buf + 2, count_rx);
if (ret < 0)
return ret;
if (tps->use_crc && buf[3] != crc8(tps6594_spi_crc_table, buf, 3, CRC8_INIT_VALUE))
return -EIO;
*val = buf[2];
return 0;
}
static int tps6594_spi_reg_write(void *context, unsigned int reg, unsigned int val)
{
struct spi_device *spi = context;
struct tps6594 *tps = spi_get_drvdata(spi);
u8 buf[4] = { 0 };
size_t count = 3;
buf[0] = reg;
buf[1] = TPS6594_REG_TO_PAGE(reg) << TPS6594_SPI_PAGE_SHIFT;
buf[2] = val;
if (tps->use_crc)
buf[3] = crc8(tps6594_spi_crc_table, buf, count++, CRC8_INIT_VALUE);
return spi_write(spi, buf, count);
}
static const struct regmap_config tps6594_spi_regmap_config = {
.reg_bits = 16,
.val_bits = 8,
.max_register = TPS6594_REG_DWD_FAIL_CNT_REG,
.volatile_reg = tps6594_is_volatile_reg,
.reg_read = tps6594_spi_reg_read,
.reg_write = tps6594_spi_reg_write,
.use_single_read = true,
.use_single_write = true,
};
static const struct of_device_id tps6594_spi_of_match_table[] = {
{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764, },
{}
};
MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table);
static int tps6594_spi_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
struct tps6594 *tps;
const struct of_device_id *match;
tps = devm_kzalloc(dev, sizeof(*tps), GFP_KERNEL);
if (!tps)
return -ENOMEM;
spi_set_drvdata(spi, tps);
tps->dev = dev;
tps->reg = spi->chip_select;
tps->irq = spi->irq;
tps->regmap = devm_regmap_init(dev, NULL, spi, &tps6594_spi_regmap_config);
if (IS_ERR(tps->regmap))
return dev_err_probe(dev, PTR_ERR(tps->regmap), "Failed to init regmap\n");
match = of_match_device(tps6594_spi_of_match_table, dev);
if (!match)
return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data;
crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL);
return tps6594_device_init(tps, enable_crc);
}
static struct spi_driver tps6594_spi_driver = {
.driver = {
.name = "tps6594",
.of_match_table = tps6594_spi_of_match_table,
},
.probe = tps6594_spi_probe,
};
module_spi_driver(tps6594_spi_driver);
MODULE_AUTHOR("Julien Panis <jpanis@baylibre.com>");
MODULE_DESCRIPTION("TPS6594 SPI Interface Driver");
MODULE_LICENSE("GPL");
...@@ -407,7 +407,7 @@ config PINCTRL_PISTACHIO ...@@ -407,7 +407,7 @@ config PINCTRL_PISTACHIO
config PINCTRL_RK805 config PINCTRL_RK805
tristate "Pinctrl and GPIO driver for RK805 PMIC" tristate "Pinctrl and GPIO driver for RK805 PMIC"
depends on MFD_RK808 depends on MFD_RK8XX
select GPIOLIB select GPIOLIB
select PINMUX select PINMUX
select GENERIC_PINCONF select GENERIC_PINCONF
......
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
/* /*
* Pinctrl driver for Rockchip RK805 PMIC * Pinctrl driver for Rockchip RK805/RK806 PMIC
* *
* Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
* Copyright (c) 2021 Rockchip Electronics Co., Ltd.
* *
* Author: Joseph Chen <chenjh@rock-chips.com> * Author: Joseph Chen <chenjh@rock-chips.com>
* Author: Xu Shengfei <xsf@rock-chips.com>
* *
* Based on the pinctrl-as3722 driver * Based on the pinctrl-as3722 driver
*/ */
...@@ -44,6 +46,7 @@ struct rk805_pin_group { ...@@ -44,6 +46,7 @@ struct rk805_pin_group {
/* /*
* @reg: gpio setting register; * @reg: gpio setting register;
* @fun_reg: functions select register;
* @fun_mask: functions select mask value, when set is gpio; * @fun_mask: functions select mask value, when set is gpio;
* @dir_mask: input or output mask value, when set is output, otherwise input; * @dir_mask: input or output mask value, when set is output, otherwise input;
* @val_mask: gpio set value, when set is level high, otherwise low; * @val_mask: gpio set value, when set is level high, otherwise low;
...@@ -56,6 +59,7 @@ struct rk805_pin_group { ...@@ -56,6 +59,7 @@ struct rk805_pin_group {
*/ */
struct rk805_pin_config { struct rk805_pin_config {
u8 reg; u8 reg;
u8 fun_reg;
u8 fun_msk; u8 fun_msk;
u8 dir_msk; u8 dir_msk;
u8 val_msk; u8 val_msk;
...@@ -80,22 +84,50 @@ enum rk805_pinmux_option { ...@@ -80,22 +84,50 @@ enum rk805_pinmux_option {
RK805_PINMUX_GPIO, RK805_PINMUX_GPIO,
}; };
enum rk806_pinmux_option {
RK806_PINMUX_FUN0 = 0,
RK806_PINMUX_FUN1,
RK806_PINMUX_FUN2,
RK806_PINMUX_FUN3,
RK806_PINMUX_FUN4,
RK806_PINMUX_FUN5,
};
enum { enum {
RK805_GPIO0, RK805_GPIO0,
RK805_GPIO1, RK805_GPIO1,
}; };
enum {
RK806_GPIO_DVS1,
RK806_GPIO_DVS2,
RK806_GPIO_DVS3
};
static const char *const rk805_gpio_groups[] = { static const char *const rk805_gpio_groups[] = {
"gpio0", "gpio0",
"gpio1", "gpio1",
}; };
static const char *const rk806_gpio_groups[] = {
"gpio_pwrctrl1",
"gpio_pwrctrl2",
"gpio_pwrctrl3",
};
/* RK805: 2 output only GPIOs */ /* RK805: 2 output only GPIOs */
static const struct pinctrl_pin_desc rk805_pins_desc[] = { static const struct pinctrl_pin_desc rk805_pins_desc[] = {
PINCTRL_PIN(RK805_GPIO0, "gpio0"), PINCTRL_PIN(RK805_GPIO0, "gpio0"),
PINCTRL_PIN(RK805_GPIO1, "gpio1"), PINCTRL_PIN(RK805_GPIO1, "gpio1"),
}; };
/* RK806 */
static const struct pinctrl_pin_desc rk806_pins_desc[] = {
PINCTRL_PIN(RK806_GPIO_DVS1, "gpio_pwrctrl1"),
PINCTRL_PIN(RK806_GPIO_DVS2, "gpio_pwrctrl2"),
PINCTRL_PIN(RK806_GPIO_DVS3, "gpio_pwrctrl3"),
};
static const struct rk805_pin_function rk805_pin_functions[] = { static const struct rk805_pin_function rk805_pin_functions[] = {
{ {
.name = "gpio", .name = "gpio",
...@@ -105,6 +137,45 @@ static const struct rk805_pin_function rk805_pin_functions[] = { ...@@ -105,6 +137,45 @@ static const struct rk805_pin_function rk805_pin_functions[] = {
}, },
}; };
static const struct rk805_pin_function rk806_pin_functions[] = {
{
.name = "pin_fun0",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN0,
},
{
.name = "pin_fun1",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN1,
},
{
.name = "pin_fun2",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN2,
},
{
.name = "pin_fun3",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN3,
},
{
.name = "pin_fun4",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN4,
},
{
.name = "pin_fun5",
.groups = rk806_gpio_groups,
.ngroups = ARRAY_SIZE(rk806_gpio_groups),
.mux_option = RK806_PINMUX_FUN5,
},
};
static const struct rk805_pin_group rk805_pin_groups[] = { static const struct rk805_pin_group rk805_pin_groups[] = {
{ {
.name = "gpio0", .name = "gpio0",
...@@ -118,6 +189,24 @@ static const struct rk805_pin_group rk805_pin_groups[] = { ...@@ -118,6 +189,24 @@ static const struct rk805_pin_group rk805_pin_groups[] = {
}, },
}; };
static const struct rk805_pin_group rk806_pin_groups[] = {
{
.name = "gpio_pwrctrl1",
.pins = { RK806_GPIO_DVS1 },
.npins = 1,
},
{
.name = "gpio_pwrctrl2",
.pins = { RK806_GPIO_DVS2 },
.npins = 1,
},
{
.name = "gpio_pwrctrl3",
.pins = { RK806_GPIO_DVS3 },
.npins = 1,
}
};
#define RK805_GPIO0_VAL_MSK BIT(0) #define RK805_GPIO0_VAL_MSK BIT(0)
#define RK805_GPIO1_VAL_MSK BIT(1) #define RK805_GPIO1_VAL_MSK BIT(1)
...@@ -132,6 +221,40 @@ static const struct rk805_pin_config rk805_gpio_cfgs[] = { ...@@ -132,6 +221,40 @@ static const struct rk805_pin_config rk805_gpio_cfgs[] = {
}, },
}; };
#define RK806_PWRCTRL1_DR BIT(0)
#define RK806_PWRCTRL2_DR BIT(1)
#define RK806_PWRCTRL3_DR BIT(2)
#define RK806_PWRCTRL1_DATA BIT(4)
#define RK806_PWRCTRL2_DATA BIT(5)
#define RK806_PWRCTRL3_DATA BIT(6)
#define RK806_PWRCTRL1_FUN GENMASK(2, 0)
#define RK806_PWRCTRL2_FUN GENMASK(6, 4)
#define RK806_PWRCTRL3_FUN GENMASK(2, 0)
static struct rk805_pin_config rk806_gpio_cfgs[] = {
{
.fun_reg = RK806_SLEEP_CONFIG0,
.fun_msk = RK806_PWRCTRL1_FUN,
.reg = RK806_SLEEP_GPIO,
.val_msk = RK806_PWRCTRL1_DATA,
.dir_msk = RK806_PWRCTRL1_DR,
},
{
.fun_reg = RK806_SLEEP_CONFIG0,
.fun_msk = RK806_PWRCTRL2_FUN,
.reg = RK806_SLEEP_GPIO,
.val_msk = RK806_PWRCTRL2_DATA,
.dir_msk = RK806_PWRCTRL2_DR,
},
{
.fun_reg = RK806_SLEEP_CONFIG1,
.fun_msk = RK806_PWRCTRL3_FUN,
.reg = RK806_SLEEP_GPIO,
.val_msk = RK806_PWRCTRL3_DATA,
.dir_msk = RK806_PWRCTRL3_DR,
}
};
/* generic gpio chip */ /* generic gpio chip */
static int rk805_gpio_get(struct gpio_chip *chip, unsigned int offset) static int rk805_gpio_get(struct gpio_chip *chip, unsigned int offset)
{ {
...@@ -289,19 +412,13 @@ static int _rk805_pinctrl_set_mux(struct pinctrl_dev *pctldev, ...@@ -289,19 +412,13 @@ static int _rk805_pinctrl_set_mux(struct pinctrl_dev *pctldev,
if (!pci->pin_cfg[offset].fun_msk) if (!pci->pin_cfg[offset].fun_msk)
return 0; return 0;
if (mux == RK805_PINMUX_GPIO) { mux <<= ffs(pci->pin_cfg[offset].fun_msk) - 1;
ret = regmap_update_bits(pci->rk808->regmap, ret = regmap_update_bits(pci->rk808->regmap,
pci->pin_cfg[offset].reg, pci->pin_cfg[offset].fun_reg,
pci->pin_cfg[offset].fun_msk, pci->pin_cfg[offset].fun_msk, mux);
pci->pin_cfg[offset].fun_msk);
if (ret) { if (ret)
dev_err(pci->dev, "set gpio%d GPIO failed\n", offset); dev_err(pci->dev, "set gpio%d func%d failed\n", offset, mux);
return ret;
}
} else {
dev_err(pci->dev, "Couldn't find function mux %d\n", mux);
return -EINVAL;
}
return 0; return 0;
} }
...@@ -317,6 +434,22 @@ static int rk805_pinctrl_set_mux(struct pinctrl_dev *pctldev, ...@@ -317,6 +434,22 @@ static int rk805_pinctrl_set_mux(struct pinctrl_dev *pctldev,
return _rk805_pinctrl_set_mux(pctldev, offset, mux); return _rk805_pinctrl_set_mux(pctldev, offset, mux);
} }
static int rk805_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int offset)
{
struct rk805_pctrl_info *pci = pinctrl_dev_get_drvdata(pctldev);
switch (pci->rk808->variant) {
case RK805_ID:
return _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO);
case RK806_ID:
return _rk805_pinctrl_set_mux(pctldev, offset, RK806_PINMUX_FUN5);
}
return -ENOTSUPP;
}
static int rk805_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, static int rk805_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range, struct pinctrl_gpio_range *range,
unsigned int offset, bool input) unsigned int offset, bool input)
...@@ -324,13 +457,6 @@ static int rk805_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, ...@@ -324,13 +457,6 @@ static int rk805_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
struct rk805_pctrl_info *pci = pinctrl_dev_get_drvdata(pctldev); struct rk805_pctrl_info *pci = pinctrl_dev_get_drvdata(pctldev);
int ret; int ret;
/* switch to gpio function */
ret = _rk805_pinctrl_set_mux(pctldev, offset, RK805_PINMUX_GPIO);
if (ret) {
dev_err(pci->dev, "set gpio%d mux failed\n", offset);
return ret;
}
/* set direction */ /* set direction */
if (!pci->pin_cfg[offset].dir_msk) if (!pci->pin_cfg[offset].dir_msk)
return 0; return 0;
...@@ -352,6 +478,7 @@ static const struct pinmux_ops rk805_pinmux_ops = { ...@@ -352,6 +478,7 @@ static const struct pinmux_ops rk805_pinmux_ops = {
.get_function_name = rk805_pinctrl_get_func_name, .get_function_name = rk805_pinctrl_get_func_name,
.get_function_groups = rk805_pinctrl_get_func_groups, .get_function_groups = rk805_pinctrl_get_func_groups,
.set_mux = rk805_pinctrl_set_mux, .set_mux = rk805_pinctrl_set_mux,
.gpio_request_enable = rk805_pinctrl_gpio_request_enable,
.gpio_set_direction = rk805_pmx_gpio_set_direction, .gpio_set_direction = rk805_pmx_gpio_set_direction,
}; };
...@@ -364,6 +491,7 @@ static int rk805_pinconf_get(struct pinctrl_dev *pctldev, ...@@ -364,6 +491,7 @@ static int rk805_pinconf_get(struct pinctrl_dev *pctldev,
switch (param) { switch (param) {
case PIN_CONFIG_OUTPUT: case PIN_CONFIG_OUTPUT:
case PIN_CONFIG_INPUT_ENABLE:
arg = rk805_gpio_get(&pci->gpio_chip, pin); arg = rk805_gpio_get(&pci->gpio_chip, pin);
break; break;
default: default:
...@@ -393,6 +521,12 @@ static int rk805_pinconf_set(struct pinctrl_dev *pctldev, ...@@ -393,6 +521,12 @@ static int rk805_pinconf_set(struct pinctrl_dev *pctldev,
rk805_gpio_set(&pci->gpio_chip, pin, arg); rk805_gpio_set(&pci->gpio_chip, pin, arg);
rk805_pmx_gpio_set_direction(pctldev, NULL, pin, false); rk805_pmx_gpio_set_direction(pctldev, NULL, pin, false);
break; break;
case PIN_CONFIG_INPUT_ENABLE:
if (pci->rk808->variant != RK805_ID && arg) {
rk805_pmx_gpio_set_direction(pctldev, NULL, pin, true);
break;
}
fallthrough;
default: default:
dev_err(pci->dev, "Properties not supported\n"); dev_err(pci->dev, "Properties not supported\n");
return -ENOTSUPP; return -ENOTSUPP;
...@@ -448,6 +582,18 @@ static int rk805_pinctrl_probe(struct platform_device *pdev) ...@@ -448,6 +582,18 @@ static int rk805_pinctrl_probe(struct platform_device *pdev)
pci->pin_cfg = rk805_gpio_cfgs; pci->pin_cfg = rk805_gpio_cfgs;
pci->gpio_chip.ngpio = ARRAY_SIZE(rk805_gpio_cfgs); pci->gpio_chip.ngpio = ARRAY_SIZE(rk805_gpio_cfgs);
break; break;
case RK806_ID:
pci->pins = rk806_pins_desc;
pci->num_pins = ARRAY_SIZE(rk806_pins_desc);
pci->functions = rk806_pin_functions;
pci->num_functions = ARRAY_SIZE(rk806_pin_functions);
pci->groups = rk806_pin_groups;
pci->num_pin_groups = ARRAY_SIZE(rk806_pin_groups);
pci->pinctrl_desc.pins = rk806_pins_desc;
pci->pinctrl_desc.npins = ARRAY_SIZE(rk806_pins_desc);
pci->pin_cfg = rk806_gpio_cfgs;
pci->gpio_chip.ngpio = ARRAY_SIZE(rk806_gpio_cfgs);
break;
default: default:
dev_err(&pdev->dev, "unsupported RK805 ID %lu\n", dev_err(&pdev->dev, "unsupported RK805 ID %lu\n",
pci->rk808->variant); pci->rk808->variant);
...@@ -488,5 +634,6 @@ static struct platform_driver rk805_pinctrl_driver = { ...@@ -488,5 +634,6 @@ static struct platform_driver rk805_pinctrl_driver = {
module_platform_driver(rk805_pinctrl_driver); module_platform_driver(rk805_pinctrl_driver);
MODULE_DESCRIPTION("RK805 pin control and GPIO driver"); MODULE_DESCRIPTION("RK805 pin control and GPIO driver");
MODULE_AUTHOR("Xu Shengfei <xsf@rock-chips.com>");
MODULE_AUTHOR("Joseph Chen <chenjh@rock-chips.com>"); MODULE_AUTHOR("Joseph Chen <chenjh@rock-chips.com>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -706,7 +706,7 @@ config CHARGER_BQ256XX ...@@ -706,7 +706,7 @@ config CHARGER_BQ256XX
config CHARGER_RK817 config CHARGER_RK817
tristate "Rockchip RK817 PMIC Battery Charger" tristate "Rockchip RK817 PMIC Battery Charger"
depends on MFD_RK808 depends on MFD_RK8XX
help help
Say Y to include support for Rockchip RK817 Battery Charger. Say Y to include support for Rockchip RK817 Battery Charger.
......
...@@ -104,7 +104,7 @@ static struct i2c_driver pg86x_regulator_driver = { ...@@ -104,7 +104,7 @@ static struct i2c_driver pg86x_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(pg86x_dt_ids), .of_match_table = of_match_ptr(pg86x_dt_ids),
}, },
.probe_new = pg86x_i2c_probe, .probe = pg86x_i2c_probe,
.id_table = pg86x_i2c_id, .id_table = pg86x_i2c_id,
}; };
......
...@@ -1033,6 +1033,13 @@ config REGULATOR_QCOM_USB_VBUS ...@@ -1033,6 +1033,13 @@ config REGULATOR_QCOM_USB_VBUS
Say M here if you want to include support for enabling the VBUS output Say M here if you want to include support for enabling the VBUS output
as a module. The module will be named "qcom_usb_vbus_regulator". as a module. The module will be named "qcom_usb_vbus_regulator".
config REGULATOR_RAA215300
tristate "Renesas RAA215300 driver"
select REGMAP_I2C
depends on I2C
help
Support for the Renesas RAA215300 PMIC.
config REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY config REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY
tristate "Raspberry Pi 7-inch touchscreen panel ATTINY regulator" tristate "Raspberry Pi 7-inch touchscreen panel ATTINY regulator"
depends on BACKLIGHT_CLASS_DEVICE depends on BACKLIGHT_CLASS_DEVICE
...@@ -1056,7 +1063,7 @@ config REGULATOR_RC5T583 ...@@ -1056,7 +1063,7 @@ config REGULATOR_RC5T583
config REGULATOR_RK808 config REGULATOR_RK808
tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power regulators" tristate "Rockchip RK805/RK808/RK809/RK817/RK818 Power regulators"
depends on MFD_RK808 depends on MFD_RK8XX
help help
Select this option to enable the power regulator of ROCKCHIP Select this option to enable the power regulator of ROCKCHIP
PMIC RK805,RK809&RK817,RK808 and RK818. PMIC RK805,RK809&RK817,RK808 and RK818.
...@@ -1397,6 +1404,17 @@ config REGULATOR_TPS6286X ...@@ -1397,6 +1404,17 @@ config REGULATOR_TPS6286X
high-frequency synchronous step-down converters with an I2C high-frequency synchronous step-down converters with an I2C
interface. interface.
config REGULATOR_TPS6287X
tristate "TI TPS6287x Power Regulator"
depends on I2C && OF
select REGMAP_I2C
help
This driver supports TPS6287x voltage regulator chips. These are
pin-to-pin high-frequency synchronous step-down dc-dc converters
with an I2C interface.
If built as a module it will be called tps6287x-regulator.
config REGULATOR_TPS65023 config REGULATOR_TPS65023
tristate "TI TPS65023 Power regulators" tristate "TI TPS65023 Power regulators"
depends on I2C depends on I2C
...@@ -1463,6 +1481,19 @@ config REGULATOR_TPS65219 ...@@ -1463,6 +1481,19 @@ config REGULATOR_TPS65219
voltage regulators. It supports software based voltage control voltage regulators. It supports software based voltage control
for different voltage domains. for different voltage domains.
config REGULATOR_TPS6594
tristate "TI TPS6594 Power regulators"
depends on MFD_TPS6594 && OF
default MFD_TPS6594
help
This driver supports TPS6594 voltage regulator chips.
TPS6594 series of PMICs have 5 BUCKs and 4 LDOs
voltage regulators.
BUCKs 1,2,3,4 can be used in single phase or multiphase mode.
Part number defines which single or multiphase mode is i used.
It supports software based voltage control
for different voltage domains.
config REGULATOR_TPS6524X config REGULATOR_TPS6524X
tristate "TI TPS6524X Power regulators" tristate "TI TPS6524X Power regulators"
depends on SPI depends on SPI
......
...@@ -124,6 +124,7 @@ obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o ...@@ -124,6 +124,7 @@ obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o
obj-$(CONFIG_REGULATOR_PBIAS) += pbias-regulator.o obj-$(CONFIG_REGULATOR_PBIAS) += pbias-regulator.o
obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
obj-$(CONFIG_REGULATOR_RAA215300) += raa215300.o
obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY) += rpi-panel-attiny-regulator.o obj-$(CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY) += rpi-panel-attiny-regulator.o
obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o obj-$(CONFIG_REGULATOR_RC5T583) += rc5t583-regulator.o
obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o obj-$(CONFIG_REGULATOR_RK808) += rk808-regulator.o
...@@ -163,6 +164,7 @@ obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o ...@@ -163,6 +164,7 @@ obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
obj-$(CONFIG_REGULATOR_TPS6286X) += tps6286x-regulator.o obj-$(CONFIG_REGULATOR_TPS6286X) += tps6286x-regulator.o
obj-$(CONFIG_REGULATOR_TPS6287X) += tps6287x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65086) += tps65086-regulator.o obj-$(CONFIG_REGULATOR_TPS65086) += tps65086-regulator.o
...@@ -174,6 +176,7 @@ obj-$(CONFIG_REGULATOR_TPS6524X) += tps6524x-regulator.o ...@@ -174,6 +176,7 @@ obj-$(CONFIG_REGULATOR_TPS6524X) += tps6524x-regulator.o
obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
obj-$(CONFIG_REGULATOR_TPS65912) += tps65912-regulator.o obj-$(CONFIG_REGULATOR_TPS65912) += tps65912-regulator.o
obj-$(CONFIG_REGULATOR_TPS6594) += tps6594-regulator.o
obj-$(CONFIG_REGULATOR_TPS65132) += tps65132-regulator.o obj-$(CONFIG_REGULATOR_TPS65132) += tps65132-regulator.o
obj-$(CONFIG_REGULATOR_TPS68470) += tps68470-regulator.o obj-$(CONFIG_REGULATOR_TPS68470) += tps68470-regulator.o
obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o twl6030-regulator.o obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o twl6030-regulator.o
......
...@@ -791,7 +791,7 @@ static struct i2c_driver act8865_pmic_driver = { ...@@ -791,7 +791,7 @@ static struct i2c_driver act8865_pmic_driver = {
.name = "act8865", .name = "act8865",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = act8865_pmic_probe, .probe = act8865_pmic_probe,
.id_table = act8865_ids, .id_table = act8865_ids,
}; };
......
...@@ -254,7 +254,7 @@ static int ad5398_probe(struct i2c_client *client) ...@@ -254,7 +254,7 @@ static int ad5398_probe(struct i2c_client *client)
} }
static struct i2c_driver ad5398_driver = { static struct i2c_driver ad5398_driver = {
.probe_new = ad5398_probe, .probe = ad5398_probe,
.driver = { .driver = {
.name = "ad5398", .name = "ad5398",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
This diff is collapsed.
...@@ -1911,19 +1911,17 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, ...@@ -1911,19 +1911,17 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
if (err != -EEXIST) if (err != -EEXIST)
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs); regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
if (!regulator->debugfs) { if (IS_ERR(regulator->debugfs))
rdev_dbg(rdev, "Failed to create debugfs directory\n"); rdev_dbg(rdev, "Failed to create debugfs directory\n");
} else {
debugfs_create_u32("uA_load", 0444, regulator->debugfs, debugfs_create_u32("uA_load", 0444, regulator->debugfs,
&regulator->uA_load); &regulator->uA_load);
debugfs_create_u32("min_uV", 0444, regulator->debugfs, debugfs_create_u32("min_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].min_uV); &regulator->voltage[PM_SUSPEND_ON].min_uV);
debugfs_create_u32("max_uV", 0444, regulator->debugfs, debugfs_create_u32("max_uV", 0444, regulator->debugfs,
&regulator->voltage[PM_SUSPEND_ON].max_uV); &regulator->voltage[PM_SUSPEND_ON].max_uV);
debugfs_create_file("constraint_flags", 0444, debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
regulator->debugfs, regulator, regulator, &constraint_flags_fops);
&constraint_flags_fops);
}
/* /*
* Check now if the regulator is an always on regulator - if * Check now if the regulator is an always on regulator - if
...@@ -5256,10 +5254,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) ...@@ -5256,10 +5254,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
} }
rdev->debugfs = debugfs_create_dir(rname, debugfs_root); rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
if (IS_ERR(rdev->debugfs)) { if (IS_ERR(rdev->debugfs))
rdev_warn(rdev, "Failed to create debugfs directory\n"); rdev_dbg(rdev, "Failed to create debugfs directory\n");
return;
}
debugfs_create_u32("use_count", 0444, rdev->debugfs, debugfs_create_u32("use_count", 0444, rdev->debugfs,
&rdev->use_count); &rdev->use_count);
...@@ -6179,7 +6175,7 @@ static int __init regulator_init(void) ...@@ -6179,7 +6175,7 @@ static int __init regulator_init(void)
debugfs_root = debugfs_create_dir("regulator", NULL); debugfs_root = debugfs_create_dir("regulator", NULL);
if (IS_ERR(debugfs_root)) if (IS_ERR(debugfs_root))
pr_warn("regulator: Failed to create debugfs directory\n"); pr_debug("regulator: Failed to create debugfs directory\n");
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
debugfs_create_file("supply_map", 0444, debugfs_root, NULL, debugfs_create_file("supply_map", 0444, debugfs_root, NULL,
......
...@@ -1197,7 +1197,7 @@ static struct i2c_driver da9121_regulator_driver = { ...@@ -1197,7 +1197,7 @@ static struct i2c_driver da9121_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9121_dt_ids), .of_match_table = of_match_ptr(da9121_dt_ids),
}, },
.probe_new = da9121_i2c_probe, .probe = da9121_i2c_probe,
.remove = da9121_i2c_remove, .remove = da9121_i2c_remove,
.id_table = da9121_i2c_id, .id_table = da9121_i2c_id,
}; };
......
...@@ -224,7 +224,7 @@ static struct i2c_driver da9210_regulator_driver = { ...@@ -224,7 +224,7 @@ static struct i2c_driver da9210_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9210_dt_ids), .of_match_table = of_match_ptr(da9210_dt_ids),
}, },
.probe_new = da9210_i2c_probe, .probe = da9210_i2c_probe,
.id_table = da9210_i2c_id, .id_table = da9210_i2c_id,
}; };
......
...@@ -555,7 +555,7 @@ static struct i2c_driver da9211_regulator_driver = { ...@@ -555,7 +555,7 @@ static struct i2c_driver da9211_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(da9211_dt_ids), .of_match_table = of_match_ptr(da9211_dt_ids),
}, },
.probe_new = da9211_i2c_probe, .probe = da9211_i2c_probe,
.id_table = da9211_i2c_id, .id_table = da9211_i2c_id,
}; };
......
...@@ -775,7 +775,7 @@ static struct i2c_driver fan53555_regulator_driver = { ...@@ -775,7 +775,7 @@ static struct i2c_driver fan53555_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(fan53555_dt_ids), .of_match_table = of_match_ptr(fan53555_dt_ids),
}, },
.probe_new = fan53555_regulator_probe, .probe = fan53555_regulator_probe,
.id_table = fan53555_id, .id_table = fan53555_id,
}; };
......
...@@ -175,7 +175,7 @@ static struct i2c_driver fan53880_regulator_driver = { ...@@ -175,7 +175,7 @@ static struct i2c_driver fan53880_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = fan53880_dt_ids, .of_match_table = fan53880_dt_ids,
}, },
.probe_new = fan53880_i2c_probe, .probe = fan53880_i2c_probe,
.id_table = fan53880_i2c_id, .id_table = fan53880_i2c_id,
}; };
module_i2c_driver(fan53880_regulator_driver); module_i2c_driver(fan53880_regulator_driver);
......
...@@ -902,8 +902,21 @@ bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2) ...@@ -902,8 +902,21 @@ bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2)
} }
EXPORT_SYMBOL_GPL(regulator_is_equal); EXPORT_SYMBOL_GPL(regulator_is_equal);
static int find_closest_bigger(unsigned int target, const unsigned int *table, /**
unsigned int num_sel, unsigned int *sel) * regulator_find_closest_bigger - helper to find offset in ramp delay table
*
* @target: targeted ramp_delay
* @table: table with supported ramp delays
* @num_sel: number of entries in the table
* @sel: Pointer to store table offset
*
* This is the internal helper used by regulator_set_ramp_delay_regmap to
* map ramp delay to register value. It should only be used directly if
* regulator_set_ramp_delay_regmap cannot handle a specific device setup
* (e.g. because the value is split over multiple registers).
*/
int regulator_find_closest_bigger(unsigned int target, const unsigned int *table,
unsigned int num_sel, unsigned int *sel)
{ {
unsigned int s, tmp, max, maxsel = 0; unsigned int s, tmp, max, maxsel = 0;
bool found = false; bool found = false;
...@@ -933,11 +946,13 @@ static int find_closest_bigger(unsigned int target, const unsigned int *table, ...@@ -933,11 +946,13 @@ static int find_closest_bigger(unsigned int target, const unsigned int *table,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(regulator_find_closest_bigger);
/** /**
* regulator_set_ramp_delay_regmap - set_ramp_delay() helper * regulator_set_ramp_delay_regmap - set_ramp_delay() helper
* *
* @rdev: regulator to operate on * @rdev: regulator to operate on
* @ramp_delay: ramp-rate value given in units V/S (uV/uS)
* *
* Regulators that use regmap for their register I/O can set the ramp_reg * Regulators that use regmap for their register I/O can set the ramp_reg
* and ramp_mask fields in their descriptor and then use this as their * and ramp_mask fields in their descriptor and then use this as their
...@@ -951,8 +966,8 @@ int regulator_set_ramp_delay_regmap(struct regulator_dev *rdev, int ramp_delay) ...@@ -951,8 +966,8 @@ int regulator_set_ramp_delay_regmap(struct regulator_dev *rdev, int ramp_delay)
if (WARN_ON(!rdev->desc->n_ramp_values || !rdev->desc->ramp_delay_table)) if (WARN_ON(!rdev->desc->n_ramp_values || !rdev->desc->ramp_delay_table))
return -EINVAL; return -EINVAL;
ret = find_closest_bigger(ramp_delay, rdev->desc->ramp_delay_table, ret = regulator_find_closest_bigger(ramp_delay, rdev->desc->ramp_delay_table,
rdev->desc->n_ramp_values, &sel); rdev->desc->n_ramp_values, &sel);
if (ret) { if (ret) {
dev_warn(rdev_get_dev(rdev), dev_warn(rdev_get_dev(rdev),
......
...@@ -149,7 +149,7 @@ static struct i2c_driver isl6271a_i2c_driver = { ...@@ -149,7 +149,7 @@ static struct i2c_driver isl6271a_i2c_driver = {
.name = "isl6271a", .name = "isl6271a",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = isl6271a_probe, .probe = isl6271a_probe,
.id_table = isl6271a_id, .id_table = isl6271a_id,
}; };
......
...@@ -198,7 +198,7 @@ static struct i2c_driver isl9305_regulator_driver = { ...@@ -198,7 +198,7 @@ static struct i2c_driver isl9305_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(isl9305_dt_ids), .of_match_table = of_match_ptr(isl9305_dt_ids),
}, },
.probe_new = isl9305_i2c_probe, .probe = isl9305_i2c_probe,
.id_table = isl9305_i2c_id, .id_table = isl9305_i2c_id,
}; };
......
...@@ -449,7 +449,7 @@ static struct i2c_driver lp3971_i2c_driver = { ...@@ -449,7 +449,7 @@ static struct i2c_driver lp3971_i2c_driver = {
.name = "LP3971", .name = "LP3971",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp3971_i2c_probe, .probe = lp3971_i2c_probe,
.id_table = lp3971_i2c_id, .id_table = lp3971_i2c_id,
}; };
......
...@@ -547,7 +547,7 @@ static struct i2c_driver lp3972_i2c_driver = { ...@@ -547,7 +547,7 @@ static struct i2c_driver lp3972_i2c_driver = {
.name = "lp3972", .name = "lp3972",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp3972_i2c_probe, .probe = lp3972_i2c_probe,
.id_table = lp3972_i2c_id, .id_table = lp3972_i2c_id,
}; };
......
...@@ -947,7 +947,7 @@ static struct i2c_driver lp872x_driver = { ...@@ -947,7 +947,7 @@ static struct i2c_driver lp872x_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(lp872x_dt_ids), .of_match_table = of_match_ptr(lp872x_dt_ids),
}, },
.probe_new = lp872x_probe, .probe = lp872x_probe,
.id_table = lp872x_ids, .id_table = lp872x_ids,
}; };
......
...@@ -442,7 +442,7 @@ static struct i2c_driver lp8755_i2c_driver = { ...@@ -442,7 +442,7 @@ static struct i2c_driver lp8755_i2c_driver = {
.name = LP8755_NAME, .name = LP8755_NAME,
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
}, },
.probe_new = lp8755_probe, .probe = lp8755_probe,
.remove = lp8755_remove, .remove = lp8755_remove,
.id_table = lp8755_id, .id_table = lp8755_id,
}; };
......
...@@ -348,7 +348,7 @@ static const struct regmap_config ltc3589_regmap_config = { ...@@ -348,7 +348,7 @@ static const struct regmap_config ltc3589_regmap_config = {
.num_reg_defaults = ARRAY_SIZE(ltc3589_reg_defaults), .num_reg_defaults = ARRAY_SIZE(ltc3589_reg_defaults),
.use_single_read = true, .use_single_read = true,
.use_single_write = true, .use_single_write = true,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static irqreturn_t ltc3589_isr(int irq, void *dev_id) static irqreturn_t ltc3589_isr(int irq, void *dev_id)
...@@ -477,7 +477,7 @@ static struct i2c_driver ltc3589_driver = { ...@@ -477,7 +477,7 @@ static struct i2c_driver ltc3589_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(ltc3589_of_match), .of_match_table = of_match_ptr(ltc3589_of_match),
}, },
.probe_new = ltc3589_probe, .probe = ltc3589_probe,
.id_table = ltc3589_i2c_id, .id_table = ltc3589_i2c_id,
}; };
module_i2c_driver(ltc3589_driver); module_i2c_driver(ltc3589_driver);
......
...@@ -261,7 +261,7 @@ static const struct regmap_config ltc3676_regmap_config = { ...@@ -261,7 +261,7 @@ static const struct regmap_config ltc3676_regmap_config = {
.max_register = LTC3676_CLIRQ, .max_register = LTC3676_CLIRQ,
.use_single_read = true, .use_single_read = true,
.use_single_write = true, .use_single_write = true,
.cache_type = REGCACHE_RBTREE, .cache_type = REGCACHE_MAPLE,
}; };
static irqreturn_t ltc3676_isr(int irq, void *dev_id) static irqreturn_t ltc3676_isr(int irq, void *dev_id)
...@@ -374,7 +374,7 @@ static struct i2c_driver ltc3676_driver = { ...@@ -374,7 +374,7 @@ static struct i2c_driver ltc3676_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(ltc3676_of_match), .of_match_table = of_match_ptr(ltc3676_of_match),
}, },
.probe_new = ltc3676_regulator_probe, .probe = ltc3676_regulator_probe,
.id_table = ltc3676_i2c_id, .id_table = ltc3676_i2c_id,
}; };
module_i2c_driver(ltc3676_driver); module_i2c_driver(ltc3676_driver);
......
...@@ -289,7 +289,7 @@ static const struct i2c_device_id max1586_id[] = { ...@@ -289,7 +289,7 @@ static const struct i2c_device_id max1586_id[] = {
MODULE_DEVICE_TABLE(i2c, max1586_id); MODULE_DEVICE_TABLE(i2c, max1586_id);
static struct i2c_driver max1586_pmic_driver = { static struct i2c_driver max1586_pmic_driver = {
.probe_new = max1586_pmic_probe, .probe = max1586_pmic_probe,
.driver = { .driver = {
.name = "max1586", .name = "max1586",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -323,7 +323,7 @@ static struct i2c_driver max20086_regulator_driver = { ...@@ -323,7 +323,7 @@ static struct i2c_driver max20086_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(max20086_dt_ids), .of_match_table = of_match_ptr(max20086_dt_ids),
}, },
.probe_new = max20086_i2c_probe, .probe = max20086_i2c_probe,
.id_table = max20086_i2c_id, .id_table = max20086_i2c_id,
}; };
......
...@@ -156,7 +156,7 @@ static struct i2c_driver max20411_i2c_driver = { ...@@ -156,7 +156,7 @@ static struct i2c_driver max20411_i2c_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_max20411_match_tbl, .of_match_table = of_max20411_match_tbl,
}, },
.probe_new = max20411_probe, .probe = max20411_probe,
.id_table = max20411_id, .id_table = max20411_id,
}; };
module_i2c_driver(max20411_i2c_driver); module_i2c_driver(max20411_i2c_driver);
......
...@@ -292,7 +292,7 @@ static struct i2c_driver max77826_regulator_driver = { ...@@ -292,7 +292,7 @@ static struct i2c_driver max77826_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(max77826_of_match), .of_match_table = of_match_ptr(max77826_of_match),
}, },
.probe_new = max77826_i2c_probe, .probe = max77826_i2c_probe,
.id_table = max77826_id, .id_table = max77826_id,
}; };
module_i2c_driver(max77826_regulator_driver); module_i2c_driver(max77826_regulator_driver);
......
...@@ -246,7 +246,7 @@ static const struct i2c_device_id max8649_id[] = { ...@@ -246,7 +246,7 @@ static const struct i2c_device_id max8649_id[] = {
MODULE_DEVICE_TABLE(i2c, max8649_id); MODULE_DEVICE_TABLE(i2c, max8649_id);
static struct i2c_driver max8649_driver = { static struct i2c_driver max8649_driver = {
.probe_new = max8649_regulator_probe, .probe = max8649_regulator_probe,
.driver = { .driver = {
.name = "max8649", .name = "max8649",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -503,7 +503,7 @@ static const struct i2c_device_id max8660_id[] = { ...@@ -503,7 +503,7 @@ static const struct i2c_device_id max8660_id[] = {
MODULE_DEVICE_TABLE(i2c, max8660_id); MODULE_DEVICE_TABLE(i2c, max8660_id);
static struct i2c_driver max8660_driver = { static struct i2c_driver max8660_driver = {
.probe_new = max8660_probe, .probe = max8660_probe,
.driver = { .driver = {
.name = "max8660", .name = "max8660",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -168,7 +168,7 @@ static const struct i2c_device_id max8893_ids[] = { ...@@ -168,7 +168,7 @@ static const struct i2c_device_id max8893_ids[] = {
MODULE_DEVICE_TABLE(i2c, max8893_ids); MODULE_DEVICE_TABLE(i2c, max8893_ids);
static struct i2c_driver max8893_driver = { static struct i2c_driver max8893_driver = {
.probe_new = max8893_probe_new, .probe = max8893_probe_new,
.driver = { .driver = {
.name = "max8893", .name = "max8893",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -313,7 +313,7 @@ static const struct i2c_device_id max8952_ids[] = { ...@@ -313,7 +313,7 @@ static const struct i2c_device_id max8952_ids[] = {
MODULE_DEVICE_TABLE(i2c, max8952_ids); MODULE_DEVICE_TABLE(i2c, max8952_ids);
static struct i2c_driver max8952_pmic_driver = { static struct i2c_driver max8952_pmic_driver = {
.probe_new = max8952_pmic_probe, .probe = max8952_pmic_probe,
.driver = { .driver = {
.name = "max8952", .name = "max8952",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -807,7 +807,7 @@ static struct i2c_driver max8973_i2c_driver = { ...@@ -807,7 +807,7 @@ static struct i2c_driver max8973_i2c_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_max8973_match_tbl, .of_match_table = of_max8973_match_tbl,
}, },
.probe_new = max8973_probe, .probe = max8973_probe,
.id_table = max8973_id, .id_table = max8973_id,
}; };
......
...@@ -584,7 +584,7 @@ static const struct i2c_device_id mcp16502_i2c_id[] = { ...@@ -584,7 +584,7 @@ static const struct i2c_device_id mcp16502_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, mcp16502_i2c_id); MODULE_DEVICE_TABLE(i2c, mcp16502_i2c_id);
static struct i2c_driver mcp16502_drv = { static struct i2c_driver mcp16502_drv = {
.probe_new = mcp16502_probe, .probe = mcp16502_probe,
.driver = { .driver = {
.name = "mcp16502-regulator", .name = "mcp16502-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
......
...@@ -240,7 +240,7 @@ static struct i2c_driver mp5416_regulator_driver = { ...@@ -240,7 +240,7 @@ static struct i2c_driver mp5416_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(mp5416_of_match), .of_match_table = of_match_ptr(mp5416_of_match),
}, },
.probe_new = mp5416_i2c_probe, .probe = mp5416_i2c_probe,
.id_table = mp5416_id, .id_table = mp5416_id,
}; };
module_i2c_driver(mp5416_regulator_driver); module_i2c_driver(mp5416_regulator_driver);
......
...@@ -147,7 +147,7 @@ static struct i2c_driver mp8859_regulator_driver = { ...@@ -147,7 +147,7 @@ static struct i2c_driver mp8859_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(mp8859_dt_id), .of_match_table = of_match_ptr(mp8859_dt_id),
}, },
.probe_new = mp8859_i2c_probe, .probe = mp8859_i2c_probe,
.id_table = mp8859_i2c_id, .id_table = mp8859_i2c_id,
}; };
......
...@@ -365,7 +365,7 @@ static struct i2c_driver mp886x_regulator_driver = { ...@@ -365,7 +365,7 @@ static struct i2c_driver mp886x_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = mp886x_dt_ids, .of_match_table = mp886x_dt_ids,
}, },
.probe_new = mp886x_i2c_probe, .probe = mp886x_i2c_probe,
.id_table = mp886x_id, .id_table = mp886x_id,
}; };
module_i2c_driver(mp886x_regulator_driver); module_i2c_driver(mp886x_regulator_driver);
......
...@@ -321,7 +321,7 @@ static struct i2c_driver mpq7920_regulator_driver = { ...@@ -321,7 +321,7 @@ static struct i2c_driver mpq7920_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(mpq7920_of_match), .of_match_table = of_match_ptr(mpq7920_of_match),
}, },
.probe_new = mpq7920_i2c_probe, .probe = mpq7920_i2c_probe,
.id_table = mpq7920_id, .id_table = mpq7920_id,
}; };
module_i2c_driver(mpq7920_regulator_driver); module_i2c_driver(mpq7920_regulator_driver);
......
...@@ -154,7 +154,7 @@ static struct i2c_driver mt6311_regulator_driver = { ...@@ -154,7 +154,7 @@ static struct i2c_driver mt6311_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(mt6311_dt_ids), .of_match_table = of_match_ptr(mt6311_dt_ids),
}, },
.probe_new = mt6311_i2c_probe, .probe = mt6311_i2c_probe,
.id_table = mt6311_i2c_id, .id_table = mt6311_i2c_id,
}; };
......
This diff is collapsed.
...@@ -875,7 +875,7 @@ static struct i2c_driver pca9450_i2c_driver = { ...@@ -875,7 +875,7 @@ static struct i2c_driver pca9450_i2c_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = pca9450_of_match, .of_match_table = pca9450_of_match,
}, },
.probe_new = pca9450_i2c_probe, .probe = pca9450_i2c_probe,
}; };
module_i2c_driver(pca9450_i2c_driver); module_i2c_driver(pca9450_i2c_driver);
......
...@@ -610,7 +610,7 @@ static struct i2c_driver pf8x00_regulator_driver = { ...@@ -610,7 +610,7 @@ static struct i2c_driver pf8x00_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = pf8x00_dt_ids, .of_match_table = pf8x00_dt_ids,
}, },
.probe_new = pf8x00_i2c_probe, .probe = pf8x00_i2c_probe,
}; };
module_i2c_driver(pf8x00_regulator_driver); module_i2c_driver(pf8x00_regulator_driver);
......
...@@ -848,7 +848,7 @@ static struct i2c_driver pfuze_driver = { ...@@ -848,7 +848,7 @@ static struct i2c_driver pfuze_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = pfuze_dt_ids, .of_match_table = pfuze_dt_ids,
}, },
.probe_new = pfuze100_regulator_probe, .probe = pfuze100_regulator_probe,
}; };
module_i2c_driver(pfuze_driver); module_i2c_driver(pfuze_driver);
......
...@@ -379,7 +379,7 @@ static struct i2c_driver pv88060_regulator_driver = { ...@@ -379,7 +379,7 @@ static struct i2c_driver pv88060_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(pv88060_dt_ids), .of_match_table = of_match_ptr(pv88060_dt_ids),
}, },
.probe_new = pv88060_i2c_probe, .probe = pv88060_i2c_probe,
.id_table = pv88060_i2c_id, .id_table = pv88060_i2c_id,
}; };
......
...@@ -560,7 +560,7 @@ static struct i2c_driver pv88080_regulator_driver = { ...@@ -560,7 +560,7 @@ static struct i2c_driver pv88080_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(pv88080_dt_ids), .of_match_table = of_match_ptr(pv88080_dt_ids),
}, },
.probe_new = pv88080_i2c_probe, .probe = pv88080_i2c_probe,
.id_table = pv88080_i2c_id, .id_table = pv88080_i2c_id,
}; };
......
...@@ -400,7 +400,7 @@ static struct i2c_driver pv88090_regulator_driver = { ...@@ -400,7 +400,7 @@ static struct i2c_driver pv88090_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(pv88090_dt_ids), .of_match_table = of_match_ptr(pv88090_dt_ids),
}, },
.probe_new = pv88090_i2c_probe, .probe = pv88090_i2c_probe,
.id_table = pv88090_i2c_id, .id_table = pv88090_i2c_id,
}; };
......
// SPDX-License-Identifier: GPL-2.0
//
// Renesas RAA215300 PMIC driver
//
// Copyright (C) 2023 Renesas Electronics Corporation
//
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h>
#define RAA215300_FAULT_LATCHED_STATUS_1 0x59
#define RAA215300_FAULT_LATCHED_STATUS_2 0x5a
#define RAA215300_FAULT_LATCHED_STATUS_3 0x5b
#define RAA215300_FAULT_LATCHED_STATUS_4 0x5c
#define RAA215300_FAULT_LATCHED_STATUS_6 0x5e
#define RAA215300_INT_MASK_1 0x64
#define RAA215300_INT_MASK_2 0x65
#define RAA215300_INT_MASK_3 0x66
#define RAA215300_INT_MASK_4 0x67
#define RAA215300_INT_MASK_6 0x68
#define RAA215300_REG_BLOCK_EN 0x6c
#define RAA215300_HW_REV 0xf8
#define RAA215300_INT_MASK_1_ALL GENMASK(5, 0)
#define RAA215300_INT_MASK_2_ALL GENMASK(3, 0)
#define RAA215300_INT_MASK_3_ALL GENMASK(5, 0)
#define RAA215300_INT_MASK_4_ALL BIT(0)
#define RAA215300_INT_MASK_6_ALL GENMASK(7, 0)
#define RAA215300_REG_BLOCK_EN_RTC_EN BIT(6)
#define RAA215300_RTC_DEFAULT_ADDR 0x6f
const char *clkin_name = "clkin";
const char *xin_name = "xin";
static struct clk *clk;
static const struct regmap_config raa215300_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = 0xff,
};
static void raa215300_rtc_unregister_device(void *data)
{
i2c_unregister_device(data);
if (!clk) {
clk_unregister_fixed_rate(clk);
clk = NULL;
}
}
static int raa215300_clk_present(struct i2c_client *client, const char *name)
{
struct clk *clk;
clk = devm_clk_get_optional(&client->dev, name);
if (IS_ERR(clk))
return PTR_ERR(clk);
return !!clk;
}
static int raa215300_i2c_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
const char *clk_name = xin_name;
unsigned int pmic_version, val;
struct regmap *regmap;
int ret;
regmap = devm_regmap_init_i2c(client, &raa215300_regmap_config);
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap),
"regmap i2c init failed\n");
ret = regmap_read(regmap, RAA215300_HW_REV, &pmic_version);
if (ret < 0)
return dev_err_probe(dev, ret, "HW rev read failed\n");
dev_dbg(dev, "RAA215300 PMIC version 0x%04x\n", pmic_version);
/* Clear all blocks except RTC, if enabled */
regmap_read(regmap, RAA215300_REG_BLOCK_EN, &val);
val &= RAA215300_REG_BLOCK_EN_RTC_EN;
regmap_write(regmap, RAA215300_REG_BLOCK_EN, val);
/*Clear the latched registers */
regmap_read(regmap, RAA215300_FAULT_LATCHED_STATUS_1, &val);
regmap_write(regmap, RAA215300_FAULT_LATCHED_STATUS_1, val);
regmap_read(regmap, RAA215300_FAULT_LATCHED_STATUS_2, &val);
regmap_write(regmap, RAA215300_FAULT_LATCHED_STATUS_2, val);
regmap_read(regmap, RAA215300_FAULT_LATCHED_STATUS_3, &val);
regmap_write(regmap, RAA215300_FAULT_LATCHED_STATUS_3, val);
regmap_read(regmap, RAA215300_FAULT_LATCHED_STATUS_4, &val);
regmap_write(regmap, RAA215300_FAULT_LATCHED_STATUS_4, val);
regmap_read(regmap, RAA215300_FAULT_LATCHED_STATUS_6, &val);
regmap_write(regmap, RAA215300_FAULT_LATCHED_STATUS_6, val);
/* Mask all the PMIC interrupts */
regmap_write(regmap, RAA215300_INT_MASK_1, RAA215300_INT_MASK_1_ALL);
regmap_write(regmap, RAA215300_INT_MASK_2, RAA215300_INT_MASK_2_ALL);
regmap_write(regmap, RAA215300_INT_MASK_3, RAA215300_INT_MASK_3_ALL);
regmap_write(regmap, RAA215300_INT_MASK_4, RAA215300_INT_MASK_4_ALL);
regmap_write(regmap, RAA215300_INT_MASK_6, RAA215300_INT_MASK_6_ALL);
ret = raa215300_clk_present(client, xin_name);
if (ret < 0) {
return ret;
} else if (!ret) {
ret = raa215300_clk_present(client, clkin_name);
if (ret < 0)
return ret;
clk_name = clkin_name;
}
if (ret) {
char *name = pmic_version >= 0x12 ? "isl1208" : "raa215300_a0";
struct device_node *np = client->dev.of_node;
u32 addr = RAA215300_RTC_DEFAULT_ADDR;
struct i2c_board_info info = {};
struct i2c_client *rtc_client;
ssize_t size;
clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 32000);
clk_register_clkdev(clk, clk_name, NULL);
if (np) {
int i;
i = of_property_match_string(np, "reg-names", "rtc");
if (i >= 0)
of_property_read_u32_index(np, "reg", i, &addr);
}
info.addr = addr;
if (client->irq > 0)
info.irq = client->irq;
size = strscpy(info.type, name, sizeof(info.type));
if (size < 0)
return dev_err_probe(dev, size,
"Invalid device name: %s\n", name);
/* Enable RTC block */
regmap_update_bits(regmap, RAA215300_REG_BLOCK_EN,
RAA215300_REG_BLOCK_EN_RTC_EN,
RAA215300_REG_BLOCK_EN_RTC_EN);
rtc_client = i2c_new_client_device(client->adapter, &info);
if (IS_ERR(rtc_client))
return PTR_ERR(rtc_client);
ret = devm_add_action_or_reset(dev,
raa215300_rtc_unregister_device,
rtc_client);
if (ret < 0)
return ret;
}
return 0;
}
static const struct of_device_id raa215300_dt_match[] = {
{ .compatible = "renesas,raa215300" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, raa215300_dt_match);
static struct i2c_driver raa215300_i2c_driver = {
.driver = {
.name = "raa215300",
.of_match_table = raa215300_dt_match,
},
.probe_new = raa215300_i2c_probe,
};
module_i2c_driver(raa215300_i2c_driver);
MODULE_DESCRIPTION("Renesas RAA215300 PMIC driver");
MODULE_AUTHOR("Fabrizio Castro <fabrizio.castro.jz@renesas.com>");
MODULE_AUTHOR("Biju Das <biju.das.jz@bp.renesas.com>");
MODULE_LICENSE("GPL");
This diff is collapsed.
...@@ -399,7 +399,7 @@ static struct i2c_driver attiny_regulator_driver = { ...@@ -399,7 +399,7 @@ static struct i2c_driver attiny_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(attiny_dt_ids), .of_match_table = of_match_ptr(attiny_dt_ids),
}, },
.probe_new = attiny_i2c_probe, .probe = attiny_i2c_probe,
.remove = attiny_i2c_remove, .remove = attiny_i2c_remove,
}; };
......
...@@ -242,7 +242,7 @@ static struct i2c_driver rt4801_driver = { ...@@ -242,7 +242,7 @@ static struct i2c_driver rt4801_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(rt4801_of_id), .of_match_table = of_match_ptr(rt4801_of_id),
}, },
.probe_new = rt4801_probe, .probe = rt4801_probe,
}; };
module_i2c_driver(rt4801_driver); module_i2c_driver(rt4801_driver);
......
...@@ -508,7 +508,7 @@ static struct i2c_driver rt5190a_driver = { ...@@ -508,7 +508,7 @@ static struct i2c_driver rt5190a_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = rt5190a_device_table, .of_match_table = rt5190a_device_table,
}, },
.probe_new = rt5190a_probe, .probe = rt5190a_probe,
}; };
module_i2c_driver(rt5190a_driver); module_i2c_driver(rt5190a_driver);
......
...@@ -282,7 +282,7 @@ static struct i2c_driver rt5739_driver = { ...@@ -282,7 +282,7 @@ static struct i2c_driver rt5739_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = rt5739_device_table, .of_match_table = rt5739_device_table,
}, },
.probe_new = rt5739_probe, .probe = rt5739_probe,
}; };
module_i2c_driver(rt5739_driver); module_i2c_driver(rt5739_driver);
......
...@@ -362,7 +362,7 @@ static struct i2c_driver rt5759_driver = { ...@@ -362,7 +362,7 @@ static struct i2c_driver rt5759_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = of_match_ptr(rt5759_device_table), .of_match_table = of_match_ptr(rt5759_device_table),
}, },
.probe_new = rt5759_probe, .probe = rt5759_probe,
}; };
module_i2c_driver(rt5759_driver); module_i2c_driver(rt5759_driver);
......
...@@ -311,7 +311,7 @@ static struct i2c_driver rt6160_driver = { ...@@ -311,7 +311,7 @@ static struct i2c_driver rt6160_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = rt6160_of_match_table, .of_match_table = rt6160_of_match_table,
}, },
.probe_new = rt6160_probe, .probe = rt6160_probe,
}; };
module_i2c_driver(rt6160_driver); module_i2c_driver(rt6160_driver);
......
...@@ -487,7 +487,7 @@ static struct i2c_driver rt6190_driver = { ...@@ -487,7 +487,7 @@ static struct i2c_driver rt6190_driver = {
.of_match_table = rt6190_of_dev_table, .of_match_table = rt6190_of_dev_table,
.pm = pm_ptr(&rt6190_dev_pm), .pm = pm_ptr(&rt6190_dev_pm),
}, },
.probe_new = rt6190_probe, .probe = rt6190_probe,
}; };
module_i2c_driver(rt6190_driver); module_i2c_driver(rt6190_driver);
......
...@@ -246,7 +246,7 @@ static struct i2c_driver rt6245_driver = { ...@@ -246,7 +246,7 @@ static struct i2c_driver rt6245_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS, .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.of_match_table = rt6245_of_match_table, .of_match_table = rt6245_of_match_table,
}, },
.probe_new = rt6245_probe, .probe = rt6245_probe,
}; };
module_i2c_driver(rt6245_driver); module_i2c_driver(rt6245_driver);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment