Commit 2385018a authored by Linus Torvalds's avatar Linus Torvalds

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

Pull mfd updates from Lee Jones:
 "New Device Support:
   - Add support for Qualcomm PM8937 PMIC to QCOM SPMI PMIC

  Fix-ups:
   - Use/convert to new/better APIs/helpers/MACROs instead of
     hand-rolling implementations
   - Device Tree binding adaptions/conversions/creation
   - Improve error handling; return proper error values, simplify,
     avoid duplicates, etc
   - Continue work to remove superfluous platform .remove() call-backs
   - Move some exported symbols into private namespaces
   - Clean-up and staticify PM related operations
   - Trivial; spelling, whitespace, clean-ups, etc
   - Fix include lists; alphabetise, remove unused, explicitly add used

  Bug Fixes:
   - Use PLATFORM_DEVID_AUTO to ensure multiple duplicate devices can
     co-exist
   - Ensure debugfs register view is correctly presented
   - Fix ordering and value issues in current use of
     clk_register_fractional_divider()
   - Repair Kconfig based dependency lists"

* tag 'mfd-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (50 commits)
  mfd: ti_am335x_tscadc: Fix TI SoC dependencies
  dt-bindings: mfd: sprd: Add support for UMS9620
  mfd: ab8500-sysctrl: Drop ancient charger
  mfd: intel-lpss: Fix the fractional clock divider flags
  mfd: tps6594: Add null pointer check to tps6594_device_init()
  dt-bindings: mfd: pm8008: Clean up example node names
  dt-bindings: mfd: hisilicon,hi6421-spmi-pmic: Clean up example
  dt-bindings: mfd: hisilicon,hi6421-spmi-pmic: Fix regulator binding
  dt-bindings: mfd: hisilicon,hi6421-spmi-pmic: Fix up binding reference
  mfd: da9062: Simplify obtaining I2C match data
  mfd: syscon: Fix null pointer dereference in of_syscon_register()
  mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
  mfd: twl6030-irq: Revert to use of_match_device()
  mfd: cs42l43: Correct order of include files to be alphabetical
  mfd: cs42l43: Correct SoundWire port list
  mfd: Fix a few spelling mistakes in PMIC header file comments
  mfd: intel-lpss: Provide Intel LPSS PM ops structure
  mfd: intel-lpss: Move exported symbols to INTEL_LPSS namespace
  mfd: intel-lpss: Adjust header inclusions
  mfd: intel-lpss: Use device_get_match_data()
  ...
parents a2ec2071 284d16c4
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/ams,as3711.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Austria MicroSystems AS3711 Quad Buck High Current PMIC with Charger
maintainers:
- Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
description:
AS3711 is an I2C PMIC from Austria MicroSystems with multiple DC/DC and LDO
power supplies, a battery charger and an RTC. So far only bindings for the
two step-up DC/DC converters are defined.
properties:
compatible:
const: ams,as3711
reg:
maxItems: 1
backlight:
description:
Step-up converter configuration, to be used as a backlight source
type: object
additionalProperties: false
properties:
compatible:
const: ams,as3711-bl
su1-dev:
description: Framebuffer phandle for the first step-up converter
$ref: /schemas/types.yaml#/definitions/phandle
su1-max-uA:
description: Maximum current for the first step-up converter
$ref: /schemas/types.yaml#/definitions/uint32
su2-dev:
description: Framebuffer phandle for the second step-up converter
$ref: /schemas/types.yaml#/definitions/phandle
su2-max-uA:
description: Maximum current for the second step-up converter
$ref: /schemas/types.yaml#/definitions/uint32
su2-feedback-voltage:
description: Second step-up converter uses voltage feedback
type: boolean
su2-feedback-curr1:
description:
Second step-up converter uses CURR1 input for current feedback
type: boolean
su2-feedback-curr2:
description:
Second step-up converter uses CURR2 input for current feedback
type: boolean
su2-feedback-curr3:
description:
Second step-up converter uses CURR3 input for current feedback
type: boolean
su2-feedback-curr-auto:
description:
Second step-up converter uses automatic current feedback selection
type: boolean
su2-fbprot-lx-sd4:
description:
Second step-up converter uses LX_SD4 for over-voltage protection
type: boolean
su2-fbprot-gpio2:
description:
Second step-up converter uses GPIO2 for over-voltage protection
type: boolean
su2-fbprot-gpio3:
description:
Second step-up converter uses GPIO3 for over-voltage protection
type: boolean
su2-fbprot-gpio4:
description:
Second step-up converter uses GPIO4 for over-voltage protection
type: boolean
su2-auto-curr1:
description:
Second step-up converter uses CURR1 input for automatic current
feedback
type: boolean
su2-auto-curr2:
description:
Second step-up converter uses CURR2 input for automatic current
feedback
type: boolean
su2-auto-curr3:
description:
Second step-up converter uses CURR3 input for automatic current
feedback
type: boolean
required:
- compatible
dependentRequired:
# To use the SU1 converter as a backlight source the following two
# properties must be provided:
su1-dev: [ su1-max-uA ]
su1-max-uA: [ su1-dev ]
# To use the SU2 converter as a backlight source the following two
# properties must be provided:
su2-dev: [ su2-max-uA ]
su2-max-uA: [ su2-dev ]
su2-feedback-voltage: [ su2-dev ]
su2-feedback-curr1: [ su2-dev ]
su2-feedback-curr2: [ su2-dev ]
su2-feedback-curr3: [ su2-dev ]
su2-feedback-curr-auto: [ su2-dev ]
su2-fbprot-lx-sd4: [ su2-dev ]
su2-fbprot-gpio2: [ su2-dev ]
su2-fbprot-gpio3: [ su2-dev ]
su2-fbprot-gpio4: [ su2-dev ]
su2-auto-curr1: [ su2-feedback-curr-auto ]
su2-auto-curr2: [ su2-feedback-curr-auto ]
su2-auto-curr3: [ su2-feedback-curr-auto ]
dependentSchemas:
su2-dev:
allOf:
- oneOf:
- required:
- su2-feedback-voltage
- required:
- su2-feedback-curr1
- required:
- su2-feedback-curr2
- required:
- su2-feedback-curr3
- required:
- su2-feedback-curr-auto
- oneOf:
- required:
- su2-fbprot-lx-sd4
- required:
- su2-fbprot-gpio2
- required:
- su2-fbprot-gpio3
- required:
- su2-fbprot-gpio4
su2-feedback-curr-auto:
anyOf:
- required:
- su2-auto-curr1
- required:
- su2-auto-curr2
- required:
- su2-auto-curr3
regulators:
description: Other DC/DC and LDO supplies
type: object
unevaluatedProperties: false
patternProperties:
"^(sd[1-4]|ldo[1-8])$":
type: object
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
required:
- compatible
- reg
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@40 {
compatible = "ams,as3711";
reg = <0x40>;
regulators {
sd4 {
regulator-name = "1.215V";
regulator-min-microvolt = <1215000>;
regulator-max-microvolt = <1235000>;
};
ldo2 {
regulator-name = "2.8V CPU";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-always-on;
regulator-boot-on;
};
};
backlight {
compatible = "ams,as3711-bl";
su2-dev = <&lcdc>;
su2-max-uA = <36000>;
su2-feedback-curr-auto;
su2-fbprot-gpio4;
su2-auto-curr1;
su2-auto-curr2;
su2-auto-curr3;
};
};
};
AS3711 is an I2C PMIC from Austria MicroSystems with multiple DCDC and LDO power
supplies, a battery charger and an RTC. So far only bindings for the two stepup
DCDC converters are defined. Other DCDC and LDO supplies are configured, using
standard regulator properties, they must belong to a sub-node, called
"regulators" and be called "sd1" to "sd4" and "ldo1" to "ldo8." Stepup converter
configuration should be placed in a subnode, called "backlight."
Compulsory properties:
- compatible : must be "ams,as3711"
- reg : specifies the I2C address
To use the SU1 converter as a backlight source the following two properties must
be provided:
- su1-dev : framebuffer phandle
- su1-max-uA : maximum current
To use the SU2 converter as a backlight source the following two properties must
be provided:
- su2-dev : framebuffer phandle
- su1-max-uA : maximum current
Additionally one of these properties must be provided to select the type of
feedback used:
- su2-feedback-voltage : voltage feedback is used
- su2-feedback-curr1 : CURR1 input used for current feedback
- su2-feedback-curr2 : CURR2 input used for current feedback
- su2-feedback-curr3 : CURR3 input used for current feedback
- su2-feedback-curr-auto: automatic current feedback selection
and one of these to select the over-voltage protection pin
- su2-fbprot-lx-sd4 : LX_SD4 is used for over-voltage protection
- su2-fbprot-gpio2 : GPIO2 is used for over-voltage protection
- su2-fbprot-gpio3 : GPIO3 is used for over-voltage protection
- su2-fbprot-gpio4 : GPIO4 is used for over-voltage protection
If "su2-feedback-curr-auto" is selected, one or more of the following properties
have to be specified:
- su2-auto-curr1 : use CURR1 input for current feedback
- su2-auto-curr2 : use CURR2 input for current feedback
- su2-auto-curr3 : use CURR3 input for current feedback
Example:
as3711@40 {
compatible = "ams,as3711";
reg = <0x40>;
regulators {
sd4 {
regulator-name = "1.215V";
regulator-min-microvolt = <1215000>;
regulator-max-microvolt = <1235000>;
};
ldo2 {
regulator-name = "2.8V CPU";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-always-on;
regulator-boot-on;
};
};
backlight {
compatible = "ams,as3711-bl";
su2-dev = <&lcdc>;
su2-max-uA = <36000>;
su2-feedback-curr-auto;
su2-fbprot-gpio4;
su2-auto-curr1;
su2-auto-curr2;
su2-auto-curr3;
};
};
......@@ -17,7 +17,7 @@ description: |
node.
The SPMI controller part is provided by
Documentation/devicetree/bindings/mfd/hisilicon,hi6421-spmi-pmic.yaml
Documentation/devicetree/bindings/spmi/hisilicon,hisi-spmi-controller.yaml
properties:
$nodename:
......@@ -42,13 +42,6 @@ properties:
additionalProperties: false
properties:
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
'^ldo[0-9]+$':
type: object
......@@ -66,72 +59,75 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/spmi/spmi.h>
pmic: pmic@0 {
compatible = "hisilicon,hi6421v600-spmi";
reg = <0 0>;
#interrupt-cells = <2>;
interrupt-controller;
interrupt-parent = <&gpio28>;
interrupts = <0 0>;
regulators {
#address-cells = <1>;
spmi {
#address-cells = <2>;
#size-cells = <0>;
ldo3: ldo3 {
regulator-name = "ldo3";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <2000000>;
regulator-boot-on;
};
ldo4: ldo4 {
regulator-name = "ldo4";
regulator-min-microvolt = <1725000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
};
ldo9: ldo9 {
regulator-name = "ldo9";
regulator-min-microvolt = <1750000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo15: ldo15 {
regulator-name = "ldo15";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
};
ldo16: ldo16 {
regulator-name = "ldo16";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-boot-on;
};
ldo17: ldo17 {
regulator-name = "ldo17";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <3300000>;
};
ldo33: ldo33 {
regulator-name = "ldo33";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo34: ldo34 {
regulator-name = "ldo34";
regulator-min-microvolt = <2600000>;
regulator-max-microvolt = <3300000>;
pmic@0 {
compatible = "hisilicon,hi6421v600-spmi";
reg = <0 SPMI_USID>;
#interrupt-cells = <2>;
interrupt-controller;
interrupt-parent = <&gpio28>;
interrupts = <0 0>;
regulators {
ldo3 {
regulator-name = "ldo3";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <2000000>;
regulator-boot-on;
};
ldo4 {
regulator-name = "ldo4";
regulator-min-microvolt = <1725000>;
regulator-max-microvolt = <1900000>;
regulator-boot-on;
};
ldo9 {
regulator-name = "ldo9";
regulator-min-microvolt = <1750000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo15 {
regulator-name = "ldo15";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
};
ldo16 {
regulator-name = "ldo16";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-boot-on;
};
ldo17 {
regulator-name = "ldo17";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <3300000>;
};
ldo33 {
regulator-name = "ldo33";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo34 {
regulator-name = "ldo34";
regulator-min-microvolt = <2600000>;
regulator-max-microvolt = <3300000>;
};
};
};
};
};
......@@ -99,10 +99,12 @@ examples:
- |
#include <dt-bindings/mfd/qcom-pm8008.h>
#include <dt-bindings/interrupt-controller/irq.h>
qupv3_se13_i2c {
i2c {
#address-cells = <1>;
#size-cells = <0>;
pm8008i@8 {
pmic@8 {
compatible = "qcom,pm8008";
reg = <0x8>;
#address-cells = <1>;
......
......@@ -66,6 +66,7 @@ properties:
- qcom,pm8841
- qcom,pm8909
- qcom,pm8916
- qcom,pm8937
- qcom,pm8941
- qcom,pm8950
- qcom,pm8953
......@@ -134,9 +135,15 @@ patternProperties:
type: object
$ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml#
"^battery@[0-9a-f]+$":
type: object
oneOf:
- $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml#
"^charger@[0-9a-f]+$":
type: object
oneOf:
- $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml#
- $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
- $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
- $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml#
......
......@@ -29,6 +29,8 @@ properties:
- qcom,sdx65-tcsr
- qcom,sm4450-tcsr
- qcom,sm8150-tcsr
- qcom,sm8250-tcsr
- qcom,sm8350-tcsr
- qcom,sm8450-tcsr
- qcom,tcsr-apq8064
- qcom,tcsr-apq8084
......
......@@ -19,7 +19,9 @@ description:
properties:
compatible:
items:
- const: sprd,ums512-glbregs
- enum:
- sprd,ums512-glbregs
- sprd,ums9620-glbregs
- const: syscon
- const: simple-mfd
......
......@@ -61,8 +61,6 @@ required:
- interrupts
- clocks
- clock-names
- dmas
- dma-names
additionalProperties: false
......
......@@ -1483,6 +1483,7 @@ config MFD_SYSCON
config MFD_TI_AM335X_TSCADC
tristate "TI ADC / Touch Screen chip support"
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
select MFD_CORE
select REGMAP
select REGMAP_MMIO
......
......@@ -30,7 +30,7 @@ static void ab8500_power_off(void)
{
sigset_t old;
sigset_t all;
static const char * const pss[] = {"ab8500_ac", "pm2301", "ab8500_usb"};
static const char * const pss[] = {"ab8500_ac", "ab8500_usb"};
int i;
bool charger_present = false;
union power_supply_propval val;
......@@ -140,14 +140,12 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
return 0;
}
static int ab8500_sysctrl_remove(struct platform_device *pdev)
static void ab8500_sysctrl_remove(struct platform_device *pdev)
{
sysctrl_dev = NULL;
if (pm_power_off == ab8500_power_off)
pm_power_off = NULL;
return 0;
}
static const struct of_device_id ab8500_sysctrl_match[] = {
......@@ -161,7 +159,7 @@ static struct platform_driver ab8500_sysctrl_driver = {
.of_match_table = ab8500_sysctrl_match,
},
.probe = ab8500_sysctrl_probe,
.remove = ab8500_sysctrl_remove,
.remove_new = ab8500_sysctrl_remove,
};
static int __init ab8500_sysctrl_init(void)
......
......@@ -288,13 +288,12 @@ static int ec_device_probe(struct platform_device *pdev)
return retval;
}
static int ec_device_remove(struct platform_device *pdev)
static void ec_device_remove(struct platform_device *pdev)
{
struct cros_ec_dev *ec = dev_get_drvdata(&pdev->dev);
mfd_remove_devices(ec->dev);
device_unregister(&ec->class_dev);
return 0;
}
static const struct platform_device_id cros_ec_id[] = {
......@@ -309,7 +308,7 @@ static struct platform_driver cros_ec_dev_driver = {
},
.id_table = cros_ec_id,
.probe = ec_device_probe,
.remove = ec_device_remove,
.remove_new = ec_device_remove,
};
static int __init cros_ec_dev_init(void)
......
......@@ -6,24 +6,23 @@
* Cirrus Logic International Semiconductor Ltd.
*/
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/mfd/cs42l43-regs.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/soundwire/sdw_type.h>
#include "cs42l43.h"
enum cs42l43_sdw_ports {
CS42L43_DMIC_DEC_ASP_PORT = 1,
CS42L43_SPK_TX_PORT,
CS42L43_SPDIF_HP_PORT,
CS42L43_SPK_RX_PORT,
CS42L43_ASP_PORT,
};
#define CS42L43_SDW_PORT(port, chans) { \
.num = port, \
.max_ch = chans, \
.type = SDW_DPN_FULL, \
.max_word = 24, \
}
static const struct regmap_config cs42l43_sdw_regmap = {
.reg_bits = 32,
......@@ -42,65 +41,48 @@ static const struct regmap_config cs42l43_sdw_regmap = {
.num_reg_defaults = ARRAY_SIZE(cs42l43_reg_default),
};
static const struct sdw_dpn_prop cs42l43_src_port_props[] = {
CS42L43_SDW_PORT(1, 4),
CS42L43_SDW_PORT(2, 2),
CS42L43_SDW_PORT(3, 2),
CS42L43_SDW_PORT(4, 2),
};
static const struct sdw_dpn_prop cs42l43_sink_port_props[] = {
CS42L43_SDW_PORT(5, 2),
CS42L43_SDW_PORT(6, 2),
CS42L43_SDW_PORT(7, 2),
};
static int cs42l43_read_prop(struct sdw_slave *sdw)
{
struct sdw_slave_prop *prop = &sdw->prop;
struct device *dev = &sdw->dev;
struct sdw_dpn_prop *dpn;
unsigned long addr;
int nval;
int i;
u32 bit;
prop->use_domain_irq = true;
prop->paging_support = true;
prop->wake_capable = true;
prop->source_ports = BIT(CS42L43_DMIC_DEC_ASP_PORT) | BIT(CS42L43_SPK_TX_PORT);
prop->sink_ports = BIT(CS42L43_SPDIF_HP_PORT) |
BIT(CS42L43_SPK_RX_PORT) | BIT(CS42L43_ASP_PORT);
prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY |
SDW_SCP_INT1_IMPL_DEF;
nval = hweight32(prop->source_ports);
prop->src_dpn_prop = devm_kcalloc(dev, nval, sizeof(*prop->src_dpn_prop),
GFP_KERNEL);
for (i = 0; i < ARRAY_SIZE(cs42l43_src_port_props); i++)
prop->source_ports |= BIT(cs42l43_src_port_props[i].num);
prop->src_dpn_prop = devm_kmemdup(dev, cs42l43_src_port_props,
sizeof(cs42l43_src_port_props), GFP_KERNEL);
if (!prop->src_dpn_prop)
return -ENOMEM;
i = 0;
dpn = prop->src_dpn_prop;
addr = prop->source_ports;
for_each_set_bit(bit, &addr, 32) {
dpn[i].num = bit;
dpn[i].max_ch = 2;
dpn[i].type = SDW_DPN_FULL;
dpn[i].max_word = 24;
i++;
}
/*
* All ports are 2 channels max, except the first one,
* CS42L43_DMIC_DEC_ASP_PORT.
*/
dpn[CS42L43_DMIC_DEC_ASP_PORT].max_ch = 4;
for (i = 0; i < ARRAY_SIZE(cs42l43_sink_port_props); i++)
prop->sink_ports |= BIT(cs42l43_sink_port_props[i].num);
nval = hweight32(prop->sink_ports);
prop->sink_dpn_prop = devm_kcalloc(dev, nval, sizeof(*prop->sink_dpn_prop),
GFP_KERNEL);
prop->sink_dpn_prop = devm_kmemdup(dev, cs42l43_sink_port_props,
sizeof(cs42l43_sink_port_props), GFP_KERNEL);
if (!prop->sink_dpn_prop)
return -ENOMEM;
i = 0;
dpn = prop->sink_dpn_prop;
addr = prop->sink_ports;
for_each_set_bit(bit, &addr, 32) {
dpn[i].num = bit;
dpn[i].max_ch = 2;
dpn[i].type = SDW_DPN_FULL;
dpn[i].max_word = 24;
i++;
}
return 0;
}
......
......@@ -588,16 +588,8 @@ static struct regmap_config da9062_regmap_config = {
.volatile_table = &da9062_aa_volatile_table,
};
static const struct of_device_id da9062_dt_ids[] = {
{ .compatible = "dlg,da9061", .data = (void *)COMPAT_TYPE_DA9061, },
{ .compatible = "dlg,da9062", .data = (void *)COMPAT_TYPE_DA9062, },
{ }
};
MODULE_DEVICE_TABLE(of, da9062_dt_ids);
static int da9062_i2c_probe(struct i2c_client *i2c)
{
const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
struct da9062 *chip;
unsigned int irq_base = 0;
const struct mfd_cell *cell;
......@@ -611,10 +603,7 @@ static int da9062_i2c_probe(struct i2c_client *i2c)
if (!chip)
return -ENOMEM;
if (i2c->dev.of_node)
chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev);
else
chip->chip_type = id->driver_data;
chip->chip_type = (uintptr_t)i2c_get_match_data(i2c);
i2c_set_clientdata(i2c, chip);
chip->dev = &i2c->dev;
......@@ -714,10 +703,17 @@ static void da9062_i2c_remove(struct i2c_client *i2c)
regmap_del_irq_chip(i2c->irq, chip->regmap_irq);
}
static const struct of_device_id da9062_dt_ids[] = {
{ .compatible = "dlg,da9061", .data = (void *)COMPAT_TYPE_DA9061 },
{ .compatible = "dlg,da9062", .data = (void *)COMPAT_TYPE_DA9062 },
{ }
};
MODULE_DEVICE_TABLE(of, da9062_dt_ids);
static const struct i2c_device_id da9062_i2c_id[] = {
{ "da9061", COMPAT_TYPE_DA9061 },
{ "da9062", COMPAT_TYPE_DA9062 },
{ },
{ }
};
MODULE_DEVICE_TABLE(i2c, da9062_i2c_id);
......
......@@ -137,7 +137,7 @@ static int exynos_lpass_probe(struct platform_device *pdev)
return devm_of_platform_populate(dev);
}
static int exynos_lpass_remove(struct platform_device *pdev)
static void exynos_lpass_remove(struct platform_device *pdev)
{
struct exynos_lpass *lpass = platform_get_drvdata(pdev);
......@@ -146,8 +146,6 @@ static int exynos_lpass_remove(struct platform_device *pdev)
if (!pm_runtime_status_suspended(&pdev->dev))
exynos_lpass_disable(lpass);
regmap_exit(lpass->top);
return 0;
}
static int __maybe_unused exynos_lpass_suspend(struct device *dev)
......@@ -187,7 +185,7 @@ static struct platform_driver exynos_lpass_driver = {
.of_match_table = exynos_lpass_of_match,
},
.probe = exynos_lpass_probe,
.remove = exynos_lpass_remove,
.remove_new = exynos_lpass_remove,
};
module_platform_driver(exynos_lpass_driver);
......
......@@ -194,11 +194,9 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
return ret;
}
static int mx25_tsadc_remove(struct platform_device *pdev)
static void mx25_tsadc_remove(struct platform_device *pdev)
{
mx25_tsadc_unset_irq(pdev);
return 0;
}
static const struct of_device_id mx25_tsadc_ids[] = {
......@@ -213,7 +211,7 @@ static struct platform_driver mx25_tsadc_driver = {
.of_match_table = mx25_tsadc_ids,
},
.probe = mx25_tsadc_probe,
.remove = mx25_tsadc_remove,
.remove_new = mx25_tsadc_remove,
};
module_platform_driver(mx25_tsadc_driver);
......
......@@ -144,13 +144,12 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
return 0;
}
static int hi655x_pmic_remove(struct platform_device *pdev)
static void hi655x_pmic_remove(struct platform_device *pdev)
{
struct hi655x_pmic *pmic = platform_get_drvdata(pdev);
regmap_del_irq_chip(gpiod_to_irq(pmic->gpio), pmic->irq_data);
mfd_remove_devices(&pdev->dev);
return 0;
}
static const struct of_device_id hi655x_pmic_match[] = {
......@@ -165,7 +164,7 @@ static struct platform_driver hi655x_pmic_driver = {
.of_match_table = hi655x_pmic_match,
},
.probe = hi655x_pmic_probe,
.remove = hi655x_pmic_remove,
.remove_new = hi655x_pmic_remove,
};
module_platform_driver(hi655x_pmic_driver);
......
......@@ -8,15 +8,20 @@
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/gfp_types.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/pxa2xx_ssp.h>
#include <asm/errno.h>
#include "intel-lpss.h"
static const struct property_entry spt_spi_properties[] = {
......@@ -169,23 +174,20 @@ MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids);
static int intel_lpss_acpi_probe(struct platform_device *pdev)
{
const struct intel_lpss_platform_info *data;
struct intel_lpss_platform_info *info;
const struct acpi_device_id *id;
int ret;
id = acpi_match_device(intel_lpss_acpi_ids, &pdev->dev);
if (!id)
data = device_get_match_data(&pdev->dev);
if (!data)
return -ENODEV;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
GFP_KERNEL);
info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
/* No need to check mem and irq here as intel_lpss_probe() does it for us */
info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!info->mem)
return -ENODEV;
info->irq = platform_get_irq(pdev, 0);
ret = intel_lpss_probe(&pdev->dev, info);
......@@ -198,23 +200,19 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev)
return 0;
}
static int intel_lpss_acpi_remove(struct platform_device *pdev)
static void intel_lpss_acpi_remove(struct platform_device *pdev)
{
intel_lpss_remove(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return 0;
}
static INTEL_LPSS_PM_OPS(intel_lpss_acpi_pm_ops);
static struct platform_driver intel_lpss_acpi_driver = {
.probe = intel_lpss_acpi_probe,
.remove = intel_lpss_acpi_remove,
.remove_new = intel_lpss_acpi_remove,
.driver = {
.name = "intel-lpss",
.acpi_match_table = intel_lpss_acpi_ids,
.pm = &intel_lpss_acpi_pm_ops,
.pm = pm_ptr(&intel_lpss_pm_ops),
},
};
......@@ -224,3 +222,4 @@ MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
MODULE_DESCRIPTION("Intel LPSS ACPI driver");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(INTEL_LPSS);
......@@ -8,14 +8,19 @@
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/gfp_types.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/pxa2xx_ssp.h>
#include <asm/errno.h>
#include "intel-lpss.h"
/* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources */
......@@ -30,6 +35,7 @@ static const struct pci_device_id ignore_resource_conflicts_ids[] = {
static int intel_lpss_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
const struct intel_lpss_platform_info *data = (void *)id->driver_data;
struct intel_lpss_platform_info *info;
int ret;
......@@ -37,13 +43,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
GFP_KERNEL);
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY);
if (ret < 0)
return ret;
info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
info->mem = &pdev->resource[0];
info->irq = pdev->irq;
/* No need to check mem and irq here as intel_lpss_probe() does it for us */
info->mem = pci_resource_n(pdev, 0);
info->irq = pci_irq_vector(pdev, 0);
if (pci_match_id(ignore_resource_conflicts_ids, pdev))
info->ignore_resource_conflicts = true;
......@@ -72,8 +82,6 @@ static void intel_lpss_pci_remove(struct pci_dev *pdev)
intel_lpss_remove(&pdev->dev);
}
static INTEL_LPSS_PM_OPS(intel_lpss_pci_pm_ops);
static const struct property_entry spt_spi_properties[] = {
PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_SPT_SSP),
{ }
......@@ -584,7 +592,7 @@ static struct pci_driver intel_lpss_pci_driver = {
.probe = intel_lpss_pci_probe,
.remove = intel_lpss_pci_remove,
.driver = {
.pm = &intel_lpss_pci_pm_ops,
.pm = pm_ptr(&intel_lpss_pm_ops),
},
};
......@@ -594,3 +602,4 @@ MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
MODULE_DESCRIPTION("Intel LPSS PCI driver");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(INTEL_LPSS);
......@@ -10,26 +10,34 @@
* Jarkko Nikula <jarkko.nikula@linux.intel.com>
*/
#include <linux/clk.h>
#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/clkdev.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gfp_types.h>
#include <linux/idr.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/pm_qos.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/seq_file.h>
#include <linux/sprintf.h>
#include <linux/types.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/dma/idma64.h>
#include "intel-lpss.h"
struct dentry;
#define LPSS_DEV_OFFSET 0x000
#define LPSS_DEV_SIZE 0x200
#define LPSS_PRIV_OFFSET 0x200
......@@ -301,8 +309,8 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss,
snprintf(name, sizeof(name), "%s-div", devname);
tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp),
0, lpss->priv, 1, 15, 16, 15,
CLK_FRAC_DIVIDER_POWER_OF_TWO_PS,
lpss->priv, 1, 15, 16, 15, 0,
NULL);
if (IS_ERR(tmp))
return PTR_ERR(tmp);
......@@ -378,9 +386,12 @@ int intel_lpss_probe(struct device *dev,
struct intel_lpss *lpss;
int ret;
if (!info || !info->mem || info->irq <= 0)
if (!info || !info->mem)
return -EINVAL;
if (info->irq < 0)
return info->irq;
lpss = devm_kzalloc(dev, sizeof(*lpss), GFP_KERNEL);
if (!lpss)
return -ENOMEM;
......@@ -405,7 +416,7 @@ int intel_lpss_probe(struct device *dev,
intel_lpss_init_dev(lpss);
lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL);
lpss->devid = ida_alloc(&intel_lpss_devid_ida, GFP_KERNEL);
if (lpss->devid < 0)
return lpss->devid;
......@@ -442,11 +453,11 @@ int intel_lpss_probe(struct device *dev,
intel_lpss_unregister_clock(lpss);
err_clk_register:
ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
ida_free(&intel_lpss_devid_ida, lpss->devid);
return ret;
}
EXPORT_SYMBOL_GPL(intel_lpss_probe);
EXPORT_SYMBOL_NS_GPL(intel_lpss_probe, INTEL_LPSS);
void intel_lpss_remove(struct device *dev)
{
......@@ -456,11 +467,10 @@ void intel_lpss_remove(struct device *dev)
intel_lpss_debugfs_remove(lpss);
intel_lpss_ltr_hide(lpss);
intel_lpss_unregister_clock(lpss);
ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
ida_free(&intel_lpss_devid_ida, lpss->devid);
}
EXPORT_SYMBOL_GPL(intel_lpss_remove);
EXPORT_SYMBOL_NS_GPL(intel_lpss_remove, INTEL_LPSS);
#ifdef CONFIG_PM
static int resume_lpss_device(struct device *dev, void *data)
{
if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
......@@ -469,7 +479,7 @@ static int resume_lpss_device(struct device *dev, void *data)
return 0;
}
int intel_lpss_prepare(struct device *dev)
static int intel_lpss_prepare(struct device *dev)
{
/*
* Resume both child devices before entering system sleep. This
......@@ -478,9 +488,8 @@ int intel_lpss_prepare(struct device *dev)
device_for_each_child_reverse(dev, NULL, resume_lpss_device);
return 0;
}
EXPORT_SYMBOL_GPL(intel_lpss_prepare);
int intel_lpss_suspend(struct device *dev)
static int intel_lpss_suspend(struct device *dev)
{
struct intel_lpss *lpss = dev_get_drvdata(dev);
unsigned int i;
......@@ -499,9 +508,8 @@ int intel_lpss_suspend(struct device *dev)
return 0;
}
EXPORT_SYMBOL_GPL(intel_lpss_suspend);
int intel_lpss_resume(struct device *dev)
static int intel_lpss_resume(struct device *dev)
{
struct intel_lpss *lpss = dev_get_drvdata(dev);
unsigned int i;
......@@ -514,8 +522,12 @@ int intel_lpss_resume(struct device *dev)
return 0;
}
EXPORT_SYMBOL_GPL(intel_lpss_resume);
#endif
EXPORT_NS_GPL_DEV_PM_OPS(intel_lpss_pm_ops, INTEL_LPSS) = {
.prepare = pm_sleep_ptr(&intel_lpss_prepare),
LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
RUNTIME_PM_OPS(intel_lpss_suspend, intel_lpss_resume, NULL)
};
static int __init intel_lpss_init(void)
{
......
......@@ -30,32 +30,6 @@ int intel_lpss_probe(struct device *dev,
const struct intel_lpss_platform_info *info);
void intel_lpss_remove(struct device *dev);
#ifdef CONFIG_PM
int intel_lpss_prepare(struct device *dev);
int intel_lpss_suspend(struct device *dev);
int intel_lpss_resume(struct device *dev);
#ifdef CONFIG_PM_SLEEP
#define INTEL_LPSS_SLEEP_PM_OPS \
.prepare = intel_lpss_prepare, \
SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
#else
#define INTEL_LPSS_SLEEP_PM_OPS
#endif
#define INTEL_LPSS_RUNTIME_PM_OPS \
.runtime_suspend = intel_lpss_suspend, \
.runtime_resume = intel_lpss_resume,
#else /* !CONFIG_PM */
#define INTEL_LPSS_SLEEP_PM_OPS
#define INTEL_LPSS_RUNTIME_PM_OPS
#endif /* CONFIG_PM */
#define INTEL_LPSS_PM_OPS(name) \
const struct dev_pm_ops name = { \
INTEL_LPSS_SLEEP_PM_OPS \
INTEL_LPSS_RUNTIME_PM_OPS \
}
extern const struct dev_pm_ops intel_lpss_pm_ops;
#endif /* __MFD_INTEL_LPSS_H */
......@@ -535,7 +535,7 @@ static int kempld_probe(struct platform_device *pdev)
return kempld_detect_device(pld);
}
static int kempld_remove(struct platform_device *pdev)
static void kempld_remove(struct platform_device *pdev)
{
struct kempld_device_data *pld = platform_get_drvdata(pdev);
const struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
......@@ -544,8 +544,6 @@ static int kempld_remove(struct platform_device *pdev)
mfd_remove_devices(&pdev->dev);
pdata->release_hardware_mutex(pld);
return 0;
}
#ifdef CONFIG_ACPI
......@@ -563,7 +561,7 @@ static struct platform_driver kempld_driver = {
.acpi_match_table = ACPI_PTR(kempld_acpi_table),
},
.probe = kempld_probe,
.remove = kempld_remove,
.remove_new = kempld_remove,
};
static const struct dmi_system_id kempld_dmi_table[] __initconst = {
......
......@@ -232,7 +232,7 @@ static int mcp_sa11x0_probe(struct platform_device *dev)
return ret;
}
static int mcp_sa11x0_remove(struct platform_device *dev)
static void mcp_sa11x0_remove(struct platform_device *dev)
{
struct mcp *mcp = platform_get_drvdata(dev);
struct mcp_sa11x0 *m = priv(mcp);
......@@ -251,8 +251,6 @@ static int mcp_sa11x0_remove(struct platform_device *dev)
mcp_host_free(mcp);
release_mem_region(mem1->start, resource_size(mem1));
release_mem_region(mem0->start, resource_size(mem0));
return 0;
}
static int mcp_sa11x0_suspend(struct device *dev)
......@@ -288,7 +286,7 @@ static const struct dev_pm_ops mcp_sa11x0_pm_ops = {
static struct platform_driver mcp_sa11x0_driver = {
.probe = mcp_sa11x0_probe,
.remove = mcp_sa11x0_remove,
.remove_new = mcp_sa11x0_remove,
.driver = {
.name = DRIVER_NAME,
.pm = pm_sleep_ptr(&mcp_sa11x0_pm_ops),
......
......@@ -230,13 +230,11 @@ static int mxs_lradc_probe(struct platform_device *pdev)
return ret;
}
static int mxs_lradc_remove(struct platform_device *pdev)
static void mxs_lradc_remove(struct platform_device *pdev)
{
struct mxs_lradc *lradc = platform_get_drvdata(pdev);
clk_disable_unprepare(lradc->clk);
return 0;
}
static struct platform_driver mxs_lradc_driver = {
......@@ -245,7 +243,7 @@ static struct platform_driver mxs_lradc_driver = {
.of_match_table = mxs_lradc_dt_ids,
},
.probe = mxs_lradc_probe,
.remove = mxs_lradc_remove,
.remove_new = mxs_lradc_remove,
};
module_platform_driver(mxs_lradc_driver);
......
......@@ -816,13 +816,12 @@ static int usbhs_omap_remove_child(struct device *dev, void *data)
*
* Reverses the effect of usbhs_omap_probe().
*/
static int usbhs_omap_remove(struct platform_device *pdev)
static void usbhs_omap_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
/* remove children */
device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
return 0;
}
static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
......@@ -845,7 +844,7 @@ static struct platform_driver usbhs_omap_driver = {
.of_match_table = usbhs_omap_dt_ids,
},
.probe = usbhs_omap_probe,
.remove = usbhs_omap_remove,
.remove_new = usbhs_omap_remove,
};
MODULE_AUTHOR("Keshava Munegowda <keshava_mgowda@ti.com>");
......
......@@ -270,7 +270,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
*
* Reverses the effect of usbtll_omap_probe().
*/
static int usbtll_omap_remove(struct platform_device *pdev)
static void usbtll_omap_remove(struct platform_device *pdev)
{
struct usbtll_omap *tll = platform_get_drvdata(pdev);
int i;
......@@ -287,7 +287,6 @@ static int usbtll_omap_remove(struct platform_device *pdev)
}
pm_runtime_disable(&pdev->dev);
return 0;
}
static const struct of_device_id usbtll_omap_dt_ids[] = {
......@@ -303,7 +302,7 @@ static struct platform_driver usbtll_omap_driver = {
.of_match_table = usbtll_omap_dt_ids,
},
.probe = usbtll_omap_probe,
.remove = usbtll_omap_remove,
.remove_new = usbtll_omap_remove,
};
int omap_tll_init(struct usbhs_omap_platform_data *pdata)
......
......@@ -218,7 +218,7 @@ static int pcf50633_adc_probe(struct platform_device *pdev)
return 0;
}
static int pcf50633_adc_remove(struct platform_device *pdev)
static void pcf50633_adc_remove(struct platform_device *pdev)
{
struct pcf50633_adc *adc = platform_get_drvdata(pdev);
int i, head;
......@@ -236,8 +236,6 @@ static int pcf50633_adc_remove(struct platform_device *pdev)
kfree(adc->queue[i]);
mutex_unlock(&adc->queue_mutex);
return 0;
}
static struct platform_driver pcf50633_adc_driver = {
......@@ -245,7 +243,7 @@ static struct platform_driver pcf50633_adc_driver = {
.name = "pcf50633-adc",
},
.probe = pcf50633_adc_probe,
.remove = pcf50633_adc_remove,
.remove_new = pcf50633_adc_remove,
};
module_platform_driver(pcf50633_adc_driver);
......
......@@ -585,19 +585,17 @@ static int pm8xxx_remove_child(struct device *dev, void *unused)
return 0;
}
static int pm8xxx_remove(struct platform_device *pdev)
static void pm8xxx_remove(struct platform_device *pdev)
{
struct pm_irq_chip *chip = platform_get_drvdata(pdev);
device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child);
irq_domain_remove(chip->irqdomain);
return 0;
}
static struct platform_driver pm8xxx_driver = {
.probe = pm8xxx_probe,
.remove = pm8xxx_remove,
.remove_new = pm8xxx_remove,
.driver = {
.name = "pm8xxx-core",
.of_match_table = pm8xxx_id_table,
......
......@@ -53,6 +53,7 @@ static const struct of_device_id pmic_spmi_id_table[] = {
{ .compatible = "qcom,pm8901", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8909", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8916", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8937", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8941", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8950", .data = N_USIDS(2) },
{ .compatible = "qcom,pm8994", .data = N_USIDS(2) },
......
......@@ -53,76 +53,68 @@ static const struct resource rk817_charger_resources[] = {
};
static const struct mfd_cell rk805s[] = {
{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk805-pinctrl", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-clkout", },
{ .name = "rk808-regulator", },
{ .name = "rk805-pinctrl", },
{
.name = "rk808-rtc",
.num_resources = ARRAY_SIZE(rtc_resources),
.resources = &rtc_resources[0],
.id = PLATFORM_DEVID_NONE,
},
{ .name = "rk805-pwrkey",
.num_resources = ARRAY_SIZE(rk805_key_resources),
.resources = &rk805_key_resources[0],
.id = PLATFORM_DEVID_NONE,
},
};
static const struct mfd_cell rk806s[] = {
{ .name = "rk805-pinctrl", .id = PLATFORM_DEVID_AUTO, },
{ .name = "rk808-regulator", .id = PLATFORM_DEVID_AUTO, },
{ .name = "rk805-pinctrl", },
{ .name = "rk808-regulator", },
{
.name = "rk805-pwrkey",
.resources = rk806_pwrkey_resources,
.num_resources = ARRAY_SIZE(rk806_pwrkey_resources),
.id = PLATFORM_DEVID_AUTO,
},
};
static const struct mfd_cell rk808s[] = {
{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-clkout", },
{ .name = "rk808-regulator", },
{
.name = "rk808-rtc",
.num_resources = ARRAY_SIZE(rtc_resources),
.resources = rtc_resources,
.id = PLATFORM_DEVID_NONE,
},
};
static const struct mfd_cell rk817s[] = {
{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-clkout", },
{ .name = "rk808-regulator", },
{
.name = "rk805-pwrkey",
.num_resources = ARRAY_SIZE(rk817_pwrkey_resources),
.resources = &rk817_pwrkey_resources[0],
.id = PLATFORM_DEVID_NONE,
},
{
.name = "rk808-rtc",
.num_resources = ARRAY_SIZE(rk817_rtc_resources),
.resources = &rk817_rtc_resources[0],
.id = PLATFORM_DEVID_NONE,
},
{ .name = "rk817-codec", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk817-codec", },
{
.name = "rk817-charger",
.num_resources = ARRAY_SIZE(rk817_charger_resources),
.resources = &rk817_charger_resources[0],
.id = PLATFORM_DEVID_NONE,
},
};
static const struct mfd_cell rk818s[] = {
{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
{ .name = "rk808-clkout", },
{ .name = "rk808-regulator", },
{
.name = "rk808-rtc",
.num_resources = ARRAY_SIZE(rtc_resources),
.resources = rtc_resources,
.id = PLATFORM_DEVID_NONE,
},
};
......@@ -684,7 +676,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
pre_init_reg[i].addr);
}
ret = devm_mfd_add_devices(dev, 0, cells, nr_cells, NULL, 0,
ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, nr_cells, NULL, 0,
regmap_irq_get_domain(rk808->irq_data));
if (ret)
return dev_err_probe(dev, ret, "failed to add MFD devices\n");
......
......@@ -1667,7 +1667,7 @@ static void sm501_pci_remove(struct pci_dev *dev)
pci_disable_device(dev);
}
static int sm501_plat_remove(struct platform_device *dev)
static void sm501_plat_remove(struct platform_device *dev)
{
struct sm501_devdata *sm = platform_get_drvdata(dev);
......@@ -1675,8 +1675,6 @@ static int sm501_plat_remove(struct platform_device *dev)
iounmap(sm->regs);
release_mem_region(sm->io_res->start, 0x100);
return 0;
}
static const struct pci_device_id sm501_pci_tbl[] = {
......@@ -1707,7 +1705,7 @@ static struct platform_driver sm501_plat_driver = {
.of_match_table = of_sm501_match_tbl,
},
.probe = sm501_plat_probe,
.remove = sm501_plat_remove,
.remove_new = sm501_plat_remove,
.suspend = pm_sleep_ptr(sm501_plat_suspend),
.resume = pm_sleep_ptr(sm501_plat_resume),
};
......
......@@ -306,7 +306,7 @@ static int stm32_timers_probe(struct platform_device *pdev)
return ret;
}
static int stm32_timers_remove(struct platform_device *pdev)
static void stm32_timers_remove(struct platform_device *pdev)
{
struct stm32_timers *ddata = platform_get_drvdata(pdev);
......@@ -316,8 +316,6 @@ static int stm32_timers_remove(struct platform_device *pdev)
*/
of_platform_depopulate(&pdev->dev);
stm32_timers_dma_remove(&pdev->dev, ddata);
return 0;
}
static const struct of_device_id stm32_timers_of_match[] = {
......@@ -328,7 +326,7 @@ MODULE_DEVICE_TABLE(of, stm32_timers_of_match);
static struct platform_driver stm32_timers_driver = {
.probe = stm32_timers_probe,
.remove = stm32_timers_remove,
.remove_new = stm32_timers_remove,
.driver = {
.name = "stm32-timers",
.of_match_table = stm32_timers_of_match,
......
......@@ -105,6 +105,10 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
}
syscon_config.name = kasprintf(GFP_KERNEL, "%pOFn@%pa", np, &res.start);
if (!syscon_config.name) {
ret = -ENOMEM;
goto err_regmap;
}
syscon_config.reg_stride = reg_io_width;
syscon_config.val_bits = reg_io_width * 8;
syscon_config.max_register = resource_size(&res) - reg_io_width;
......
......@@ -298,7 +298,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)
return err;
}
static int ti_tscadc_remove(struct platform_device *pdev)
static void ti_tscadc_remove(struct platform_device *pdev)
{
struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev);
......@@ -308,8 +308,6 @@ static int ti_tscadc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
mfd_remove_devices(tscadc->dev);
return 0;
}
static int __maybe_unused ti_tscadc_can_wakeup(struct device *dev, void *data)
......@@ -381,7 +379,7 @@ static struct platform_driver ti_tscadc_driver = {
.of_match_table = ti_tscadc_dt_ids,
},
.probe = ti_tscadc_probe,
.remove = ti_tscadc_remove,
.remove_new = ti_tscadc_remove,
};
......
......@@ -36,6 +36,7 @@ static const struct regmap_config tps65086_regmap_config = {
.val_bits = 8,
.cache_type = REGCACHE_MAPLE,
.volatile_table = &tps65086_volatile_table,
.max_register = TPS65086_OC_STATUS,
};
static const struct regmap_irq tps65086_irqs[] = {
......
......@@ -140,15 +140,13 @@ static int tps65911_comparator_probe(struct platform_device *pdev)
return ret;
}
static int tps65911_comparator_remove(struct platform_device *pdev)
static void tps65911_comparator_remove(struct platform_device *pdev)
{
struct tps65910 *tps65910;
tps65910 = dev_get_drvdata(pdev->dev.parent);
device_remove_file(&pdev->dev, &dev_attr_comp2_threshold);
device_remove_file(&pdev->dev, &dev_attr_comp1_threshold);
return 0;
}
static struct platform_driver tps65911_comparator_driver = {
......@@ -156,7 +154,7 @@ static struct platform_driver tps65911_comparator_driver = {
.name = "tps65911-comparator",
},
.probe = tps65911_comparator_probe,
.remove = tps65911_comparator_remove,
.remove_new = tps65911_comparator_remove,
};
static int __init tps65911_comparator_init(void)
......
......@@ -433,6 +433,9 @@ int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
tps6594_irq_chip.name = devm_kasprintf(dev, GFP_KERNEL, "%s-%ld-0x%02x",
dev->driver->name, tps->chip_id, tps->reg);
if (!tps6594_irq_chip.name)
return -ENOMEM;
ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT,
0, &tps6594_irq_chip, &tps->irq_data);
if (ret)
......
......@@ -258,12 +258,10 @@ static int twl4030_audio_probe(struct platform_device *pdev)
return ret;
}
static int twl4030_audio_remove(struct platform_device *pdev)
static void twl4030_audio_remove(struct platform_device *pdev)
{
mfd_remove_devices(&pdev->dev);
twl4030_audio_dev = NULL;
return 0;
}
static const struct of_device_id twl4030_audio_of_match[] = {
......@@ -278,7 +276,7 @@ static struct platform_driver twl4030_audio_driver = {
.of_match_table = twl4030_audio_of_match,
},
.probe = twl4030_audio_probe,
.remove = twl4030_audio_remove,
.remove_new = twl4030_audio_remove,
};
module_platform_driver(twl4030_audio_driver);
......
......@@ -24,10 +24,10 @@
#include <linux/kthread.h>
#include <linux/mfd/twl.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/suspend.h>
#include <linux/of.h>
#include <linux/irqdomain.h>
#include <linux/of_device.h>
#include "twl-core.h"
......@@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num)
int nr_irqs;
int status;
u8 mask[3];
const int *irq_tbl;
const struct of_device_id *of_id;
irq_tbl = device_get_match_data(dev);
if (!irq_tbl) {
of_id = of_match_device(twl6030_of_match, dev);
if (!of_id || !of_id->data) {
dev_err(dev, "Unknown TWL device model\n");
return -EINVAL;
}
......@@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier;
atomic_set(&twl6030_irq->wakeirqs, 0);
twl6030_irq->irq_mapping_tbl = irq_tbl;
twl6030_irq->irq_mapping_tbl = of_id->data;
twl6030_irq->irq_domain =
irq_domain_add_linear(node, nr_irqs,
......
......@@ -405,7 +405,7 @@ enum max77693_haptic_reg {
MAX77693_HAPTIC_REG_END,
};
/* max77693-pmic LSCNFG configuraton register */
/* max77693-pmic LSCNFG configuration register */
#define MAX77693_PMIC_LOW_SYS_MASK 0x80
#define MAX77693_PMIC_LOW_SYS_SHIFT 7
......
......@@ -198,7 +198,7 @@ enum max77843_irq_muic {
#define MAX77843_MCONFIG_MEN_MASK BIT(MCONFIG_MEN_SHIFT)
#define MAX77843_MCONFIG_PDIV_MASK (0x3 << MCONFIG_PDIV_SHIFT)
/* Max77843 charger insterrupts */
/* Max77843 charger interrupts */
#define MAX77843_CHG_BYP_I BIT(0)
#define MAX77843_CHG_BATP_I BIT(2)
#define MAX77843_CHG_BAT_I BIT(3)
......
......@@ -10,7 +10,7 @@
#ifndef __SI476X_PLATFORM_H__
#define __SI476X_PLATFORM_H__
/* It is possible to select one of the four adresses using pins A0
/* It is possible to select one of the four addresses using pins A0
* and A1 on SI476x */
#define SI476X_I2C_ADDR_1 0x60
#define SI476X_I2C_ADDR_2 0x61
......
......@@ -749,7 +749,7 @@
#define VDDCTRL_ST_SHIFT 0
/*Register VDDCTRL_OP (0x28) bit definitios */
/*Register VDDCTRL_OP (0x28) bit definitions */
#define VDDCTRL_OP_CMD_MASK 0x80
#define VDDCTRL_OP_CMD_SHIFT 7
#define VDDCTRL_OP_SEL_MASK 0x7F
......
......@@ -31,6 +31,7 @@
#define PM8998_SUBTYPE 0x14
#define PMI8998_SUBTYPE 0x15
#define PM8005_SUBTYPE 0x18
#define PM8937_SUBTYPE 0x19
#define PM660L_SUBTYPE 0x1a
#define PM660_SUBTYPE 0x1b
#define PM8150_SUBTYPE 0x1e
......
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