Add support for the System Power Management Interface (SPMI)
Subsystems (5)
v6 cover Add support for the System Power Management Interface (SPMI)
Hey Greg-
Is it possible for you to pick this up for 3.15? It'd be nice if we could get an Ack from devicetree folks on patches 2 and 5, but there has been many months worth of opportunity for that.
Thanks,
Josh
---
The System Power Management Interface (SPMI) is a high-speed, low-latency, bi-directional, two-wire serial bus suitable for real-time control of voltage and frequency scaled multi-core application processors and its power management of auxiliary components. SPMI obsoletes a number of legacy, custom point-to-point interfaces and provides a low pin count, high-speed control bus for up to 4 Master and 16 Slave devices.
SPMI is specified by the MIPI (Mobile Industry Process Interface) Alliance [1].
This patchset is intended both to provide a core implementation of SPMI and also to provide a controller driver implementation.
- Patches 1-2 implement the SPMI core functionality and provide basic DT binding documentation
- Patches 3-5 provide an implementation of an SPMI controller, the Qualcomm SPMI PMIC Arbiter, currently used on the 8x74 SoCs.
- Patch 6 rounds out regmap support for SPMI
Changes from v5[2]:
- Changed PMIC Arbiter locking to use a raw_spinlock_t over the non-raw variant due to it's use in an irqchip implementation (feedback from Thomas Gleixner)
- Reworded descriptions of the reg and reg-names properties in the PMIC Arbiter devicetree binding document
Changes from v4[3]:
- Fixed a few minor error-handling bugs found with further testing
- Addressed Courtney Cavin's feedback regarding device tree bindings
- Reworked Kconfig options a bit (allow for building PMIC arb when COMPILE_TEST=y)
Changes from v3[4]:
- Dropped the pm8x41 PMIC driver and pm8xxx-rtc changes as part of this patchset. (will be sent out separately)
- Rebased on v3.13-rc2
- Move to simple_ida_* for controller ID allocation
- Addressed documentation fixes and nits
- Provide pm_runtime implementation, which leverages SPMI's SLEEP and WAKEUP commands
- Address spmi_controller object lifetime issues
Changes from v2[5]:
- Dropped RFC.
- Add basic regmap support at Mark Brown's suggestion
- Drop debugfs interface. Debugging SPMI accesses can happen via the regmap debugfs interface if necessary.
- Add second address-cell in SPMI generic device tree binding, encoding the address type (suggestion by Stephen Warren)
- Implement interrupt handling functionality within the PMIC Arbiter driver
- Provide basic MFD driver for the PMIC8x41 PMICs, demonstrating SPMI regmap client use
- Adapt existing pm8xxx-rtc driver to work as a child of the PM8x41 mfd device
Changes from v1[6]:
- Adopted patch (1/5) to #define for_each_available_node() shim in the !CONFIG_OF case
- Moved device tree logic out of drivers/of and into spmi.c core (this mirrors what SPI is doing, and what i2c will soon be doing)
- Move of_spmi_add_devices() call into spmi_device_add(), so drivers don't have to call it explicitly
- Unconditionally build in debugfs code (rely on the underlying CONFIG_DEBUG_FS switch to throw unused code away)
- Change pr_* print functions to their dev_* equivalents
- Fix copy_{to,from}_user error handling
- Renamed "board_lock" to "ctrl_idr_lock" to better describe it's purpose
- Rework device object lifetime management
- Rename PMIC arb binding document, add description of PMIC arb
- Add generic SPMI device tree bindings
[1]: http://www.mipi.org/specifications/system-power-management-interface
[2]: http://lkml.kernel.org/r/1391468739-20987-1-git-send-email-joshc at codeaurora.org [3]: http://lkml.kernel.org/r/cover.1389738151.git.joshc at codeaurora.org [4]: http://lkml.kernel.org/r/cover.1382985169.git.joshc at codeaurora.org [5]: http://lkml.kernel.org/r/cover.1377202730.git.joshc at codeaurora.org [6]: http://lkml.kernel.org/r/cover.1376596224.git.joshc at codeaurora.org
Josh Cartwright (4):
spmi: add generic SPMI controller binding documentation
spmi: pmic_arb: add support for interrupt handling
spmi: document the PMIC arbiter SPMI bindings
regmap: spmi: support base and extended register spaces
Kenneth Heitke (2):
spmi: Linux driver framework for SPMI
spmi: Add MSM PMIC Arbiter SPMI controller
.../bindings/spmi/qcom,spmi-pmic-arb.txt | 61 ++ Documentation/devicetree/bindings/spmi/spmi.txt | 41 ++ drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/base/regmap/regmap-spmi.c | 228 +++++- drivers/spmi/Kconfig | 27 + drivers/spmi/Makefile | 6 + drivers/spmi/spmi-pmic-arb.c | 778 +++++++++++++++++++++ drivers/spmi/spmi.c | 609 ++++++++++++++++ include/dt-bindings/spmi/spmi.h | 18 + include/linux/mod_devicetable.h | 8 + include/linux/regmap.h | 12 +- include/linux/spmi.h | 191 +++++ 13 files changed, 1947 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt create mode 100644 Documentation/devicetree/bindings/spmi/spmi.txt create mode 100644 drivers/spmi/Kconfig create mode 100644 drivers/spmi/Makefile create mode 100644 drivers/spmi/spmi-pmic-arb.c create mode 100644 drivers/spmi/spmi.c create mode 100644 include/dt-bindings/spmi/spmi.h create mode 100644 include/linux/spmi.h
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 1/6 spmi: Linux driver framework for SPMI
From: Kenneth Heitke <[email protected]>
System Power Management Interface (SPMI) is a specification developed by the MIPI (Mobile Industry Process Interface) Alliance optimized for the real time control of Power Management ICs (PMIC).
SPMI is a two-wire serial interface that supports up to 4 master devices and up to 16 logical slaves.
The framework supports message APIs, multiple busses (1 controller per bus) and multiple clients/slave devices per controller.
--- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/spmi/Kconfig | 9 + drivers/spmi/Makefile | 4 + drivers/spmi/spmi.c | 609 ++++++++++++++++++++++++++++++++++++++++ include/dt-bindings/spmi/spmi.h | 18 ++ include/linux/mod_devicetable.h | 8 + include/linux/spmi.h | 191 +++++++++++++ 8 files changed, 842 insertions(+) create mode 100644 drivers/spmi/Kconfig create mode 100644 drivers/spmi/Makefile create mode 100644 drivers/spmi/spmi.c create mode 100644 include/dt-bindings/spmi/spmi.h create mode 100644 include/linux/spmi.h
drivers/Kconfig +2 -0
@@ -52,6 +52,8 @@ source "drivers/i2c/Kconfig" source "drivers/spi/Kconfig" +source "drivers/spmi/Kconfig" + source "drivers/hsi/Kconfig" source "drivers/pps/Kconfig"
drivers/Makefile +1 -0
@@ -66,6 +66,7 @@ obj-$(CONFIG_ATA) += ata/ obj-$(CONFIG_TARGET_CORE) += target/ obj-$(CONFIG_MTD) += mtd/ obj-$(CONFIG_SPI) += spi/ +obj-$(CONFIG_SPMI) += spmi/ obj-y += hsi/ obj-y += net/ obj-$(CONFIG_ATM) += atm/
drivers/spmi/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +# +# SPMI driver configuration +# +menuconfig SPMI + tristate "SPMI support" + help + SPMI (System Power Management Interface) is a two-wire + serial interface between baseband and application processors + and Power Management Integrated Circuits (PMIC).
drivers/spmi/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# +# Makefile for kernel SPMI framework. +# +obj-$(CONFIG_SPMI) += spmi.o
drivers/spmi/spmi.c new file +609 -0
609 lines not on this page · raw message
include/dt-bindings/spmi/spmi.h new file +18 -0
@@ -0,0 +1,18 @@ +/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 and +* only version 2 as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +#ifndef __DT_BINDINGS_SPMI_H +#define __DT_BINDINGS_SPMI_H + +#define SPMI_USID 0 +#define SPMI_GSID 1 + +#endif
include/linux/mod_devicetable.h +8 -0
@@ -432,6 +432,14 @@ struct spi_device_id {kernel_ulong_t driver_data;/* Data private to the driver */ }; +#define SPMI_NAME_SIZE 32 +#define SPMI_MODULE_PREFIX "spmi:" + +struct spmi_device_id { +char name[SPMI_NAME_SIZE ]; +kernel_ulong_t driver_data;/* Data private to the driver */ +}; +/* dmi */ enum dmi_field {DMI_NONE ,
include/linux/spmi.h new file +191 -0
191 lines not on this page · raw message
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 2/6 spmi: add generic SPMI controller binding documentation
In reply to Josh Cartwright--- Documentation/devicetree/bindings/spmi/spmi.txt | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/spmi/spmi.txt
Documentation/devicetree/bindings/spmi/spmi.txt new file +41 -0
@@ -0,0 +1,41 @@ +System Power Management Interface (SPMI) Controller + +This document defines a generic set of bindings for use by SPMI controllers. A +controller is modelled in device tree as a node with zero or more child nodes, +each representing a unique slave on the bus. + +Required properties: +- #address-cells : must be set to 2 +- #size-cells : must be set to 0 + +Child nodes: + +An SPMI controller node can contain zero or more child nodes representing slave +devices on the bus. Child 'reg' properties are specified as an address, type +pair. The address must be in the range 0-15 (4 bits). The type must be one of +SPMI_USID (0) or SPMI_GSID (1) for Unique Slave ID or Group Slave ID respectively. +These are the identifiers "statically assigned by the system integrator", as +per the SPMI spec. + +Each child node must have one and only one 'reg' entry of type SPMI_USID. + +#include <dt-bindings/spmi/spmi.h> + + spmi at .. { + compatible = "..."; + reg = <...>; + + #address-cells = <2>; + #size-cells <0>; + + child at 0 { + compatible = "..."; + reg = <0 SPMI_USID>; + }; + + child at 7 { + compatible = "..."; + reg = <7 SPMI_USID + 3 SPMI_GSID>; + }; + };
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 3/6 spmi: Add MSM PMIC Arbiter SPMI controller
In reply to Josh CartwrightFrom: Kenneth Heitke <[email protected]>
Qualcomm's PMIC Arbiter SPMI controller functions as a bus master and is used to communication with one or more PMIC (slave) devices on the SPMI bus. The PMIC Arbiter is actually a hardware wrapper around the SPMI controller that provides concurrent and autonomous PMIC access to various entities that need to communicate with the PMIC.
The SPMI controller hardware handles all of the SPMI bus activity (bus arbitration, sequence start condition, transmission of frames, etc). This software driver uses the PMIC Arbiter register interface to initiate command sequences on the SPMI bus. The status register is read to determine when the command sequence has completed and whether or not it completed successfully.
--- drivers/spmi/Kconfig | 17 ++ drivers/spmi/Makefile | 2 + drivers/spmi/spmi-pmic-arb.c | 405 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 424 insertions(+) create mode 100644 drivers/spmi/spmi-pmic-arb.c
drivers/spmi/Kconfig +17 -0
@@ -7,3 +7,20 @@ menuconfig SPMI SPMI (System Power Management Interface) is a two-wire serial interface between baseband and application processors and Power Management Integrated Circuits (PMIC). + +if SPMI + +config SPMI_MSM_PMIC_ARB + tristate "Qualcomm MSM SPMI Controller (PMIC Arbiter)" + depends on ARM + depends on ARCH_MSM || COMPILE_TEST + default ARCH_MSM + help + If you say yes to this option, support will be included for the + built-in SPMI PMIC Arbiter interface on Qualcomm MSM family + processors. + + This is required for communicating with Qualcomm PMICs and + other devices that have the SPMI interface. + +endif
drivers/spmi/Makefile +2 -0
@@ -2,3 +2,5 @@ # Makefile for kernel SPMI framework. # obj-$(CONFIG_SPMI) += spmi.o + +obj-$(CONFIG_SPMI_MSM_PMIC_ARB) += spmi-pmic-arb.o
drivers/spmi/spmi-pmic-arb.c new file +405 -0
405 lines not on this page · raw message
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 4/6 spmi: pmic_arb: add support for interrupt handling
In reply to Josh CartwrightThe Qualcomm PMIC Arbiter, in addition to being a basic SPMI controller, also implements interrupt handling for slave devices. Note, this is outside the scope of SPMI, as SPMI leaves interrupt handling completely unspecified.
Extend the driver to provide a irq_chip implementation and chained irq handling which allows for these interrupts to be used.
---
Thomas-
You've looked at this before[1], but I conservatively didn't turn your "Looks sane otherwise" comment into full Ack. The only thing that has changed is now a raw spinlock is used for locking.
Thanks,
Josh
[1]: http://marc.info/?l=linux-kernel&m=139154465617561&w=2
drivers/spmi/Kconfig | 1 + drivers/spmi/spmi-pmic-arb.c | 377 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 376 insertions(+), 2 deletions(-)
drivers/spmi/Kconfig +1 -0
@@ -13,6 +13,7 @@ if SPMI config SPMI_MSM_PMIC_ARB tristate "Qualcomm MSM SPMI Controller (PMIC Arbiter)" depends on ARM + depends on IRQ_DOMAIN depends on ARCH_MSM || COMPILE_TEST default ARCH_MSM help
drivers/spmi/spmi-pmic-arb.c +375 -2
445 lines not on this page · raw message
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 5/6 spmi: document the PMIC arbiter SPMI bindings
In reply to Josh Cartwright--- .../bindings/spmi/qcom,spmi-pmic-arb.txt | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt
Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.txt new file +61 -0
@@ -0,0 +1,61 @@ +Qualcomm SPMI Controller (PMIC Arbiter) + +The SPMI PMIC Arbiter is found on the Snapdragon 800 Series. It is an SPMI +controller with wrapping arbitration logic to allow for multiple on-chip +devices to control a single SPMI master. + +The PMIC Arbiter can also act as an interrupt controller, providing interrupts +to slave devices. + +See spmi.txt for the generic SPMI controller binding requirements for child +nodes. + +See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for +generic interrupt controller binding documentation. + +Required properties: +- compatible : should be "qcom,spmi-pmic-arb". +- reg-names : must contain: + "core" - core registers + "intr" - interrupt controller registers + "cnfg" - configuration registers +- reg : address + size pairs describing the PMIC arb register sets; order must + correspond with the order of entries in reg-names +- #address-cells : must be set to 2 +- #size-cells : must be set to 0 +- qcom,ee : indicates the active Execution Environment identifier (0-5) +- qcom,channel : which of the PMIC Arb provided channels to use for accesses (0-5) +- interrupts : interrupt list for the PMIC Arb controller, must contain a + single interrupt entry for the peripheral interrupt +- interrupt-names : corresponding interrupt names for the interrupts + listed in the 'interrupts' property, must contain: + "periph_irq" - summary interrupt for PMIC peripherals +- interrupt-controller : boolean indicator that the PMIC arbiter is an interrupt controller +- #interrupt-cells : must be set to 4. Interrupts are specified as a 4-tuple: + cell 1: slave ID for the requested interrupt (0-15) + cell 2: peripheral ID for requested interrupt (0-255) + cell 3: the requested peripheral interrupt (0-7) + cell 4: interrupt flags indicating level-sense information, as defined in + dt-bindings/interrupt-controller/irq.h + +Example: + + spmi { + compatible = "qcom,spmi-pmic-arb"; + reg-names = "core", "intr", "cnfg"; + reg = <0xfc4cf000 0x1000>, + <0xfc4cb000 0x1000>, + <0xfc4ca000 0x1000>; + + interrupt-names = "periph_irq"; + interrupts = <0 190 0>; + + qcom,ee = <0>; + qcom,channel = <0>; + + #address-cells = <2>; + #size-cells = <0>; + + interrupt-controller; + #interrupt-cells = <4>; + };
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
PATCH v6 6/6 regmap: spmi: support base and extended register spaces
In reply to Josh CartwrightSPMI states that a slave may contain two register spaces, the Base register space is a 5-bit byte-addressable space accessed via the Register Read/Write and Register Zero Write command sequences, and the Extended register space: a 16-bit byte-addressable space accessed via the Extended Read/Write and Extended Read/Write Long command sequences.
Provide support for accessing both of these spaces, taking advantage of the more bandwidth-efficient commands ('Register 0 Write' vs 'Register Write', and 'Extended Register Read/Write' vs 'Extended Register Read/Write Long') when possible.
--- drivers/base/regmap/regmap-spmi.c | 228 ++++++++++++++++++++++++++++++++------ include/linux/regmap.h | 12 +- 2 files changed, 205 insertions(+), 35 deletions(-)
drivers/base/regmap/regmap-spmi.c +197 -31
@@ -22,69 +22,235 @@#include <linux/module.h> #include <linux/init.h> -static int regmap_spmi_read (void *context, -const void *reg,size_t reg_size, -void *val,size_t val_size) +static int regmap_spmi_base_read (void *context, +const void *reg,size_t reg_size, +void *val,size_t val_size) { +u8 addr = *(u8 *)reg; +int err =0 ; + +BUG_ON (reg_size !=1 ); + +while (val_size-- && !err) + err =spmi_register_read (context, addr++, val++); + +return err; +} + +static int regmap_spmi_base_gather_write (void *context, +const void *reg,size_t reg_size, +const void *val,size_t val_size) +{ +const u8 *data = val; +u8 addr = *(u8 *)reg; +int err =0 ; + +BUG_ON (reg_size !=1 ); + +/* +* SPMI defines a more bandwidth-efficient 'Register 0 Write' sequence, +* use it when possible. +*/ +if (addr ==0 && val_size) { + err =spmi_register_zero_write (context, *data); +if (err) + goto err_out; + + data++; + addr++; + val_size--; + } + +while (val_size) { + err =spmi_register_write (context, addr, *data); +if (err) + goto err_out; + + data++; + addr++; + val_size--; + } + +err_out: +return err; +} + +static int regmap_spmi_base_write (void *context,const void *data, +size_t count) +{ +BUG_ON (count <1 ); +return regmap_spmi_base_gather_write (context, data,1 , data +1 , + count -1 ); +} + +static struct regmap_bus regmap_spmi_base = { + .read = regmap_spmi_base_read, + .write = regmap_spmi_base_write, + .gather_write = regmap_spmi_base_gather_write, + .reg_format_endian_default =REGMAP_ENDIAN_NATIVE , + .val_format_endian_default =REGMAP_ENDIAN_NATIVE , +}; + +/** +* regmap_init_spmi_base(): Create regmap for the Base register space +* @sdev: SPMI device that will be interacted with +* @config: Configuration for register map +* +* The return value will be an ERR_PTR() on error or a valid pointer to +* a struct regmap. +*/ +struct regmap *regmap_init_spmi_base (struct spmi_device *sdev, +const struct regmap_config *config) +{ +return regmap_init (&sdev->dev, ®map_spmi_base, sdev, config); +} +EXPORT_SYMBOL_GPL (regmap_init_spmi_base); + +/** +* devm_regmap_init_spmi_base(): Create managed regmap for Base register space +* @sdev: SPMI device that will be interacted with +* @config: Configuration for register map +* +* The return value will be an ERR_PTR() on error or a valid pointer +* to a struct regmap. The regmap will be automatically freed by the +* device management code. +*/ +struct regmap *devm_regmap_init_spmi_base (struct spmi_device *sdev, +const struct regmap_config *config) +{ +return devm_regmap_init (&sdev->dev, ®map_spmi_base, sdev, config); +} +EXPORT_SYMBOL_GPL (devm_regmap_init_spmi_base); + +static int regmap_spmi_ext_read (void *context, +const void *reg,size_t reg_size, +void *val,size_t val_size) +{ +int err =0 ; +size_t len; +u16 addr; +BUG_ON (reg_size !=2 ); -return spmi_ext_register_readl (context, *(u16 *)reg, - val, val_size); + + addr = *(u16 *)reg; + +/* +* Split accesses into two to take advantage of the more +* bandwidth-efficient 'Extended Register Read' command when possible +*/ +while (addr <=0xFF && val_size) { + len =min_t (size_t, val_size,16 ); + + err =spmi_ext_register_read (context, addr, val, len); +if (err) + goto err_out; + + addr += len; + val += len; + val_size -= len; + } + +while (val_size) { + len =min_t (size_t, val_size,8 ); + + err =spmi_ext_register_readl (context, addr, val, val_size); +if (err) + goto err_out; + + addr += len; + val += len; + val_size -= len; + } + +err_out: +return err; } -static int regmap_spmi_gather_write (void *context, -const void *reg,size_t reg_size, -const void *val,size_t val_size) +static int regmap_spmi_ext_gather_write (void *context, +const void *reg,size_t reg_size, +const void *val,size_t val_size) { +int err =0 ; +size_t len; +u16 addr; +BUG_ON (reg_size !=2 ); -return spmi_ext_register_writel (context, *(u16 *)reg, val, val_size); + + addr = *(u16 *)reg; + +while (addr <=0xFF && val_size) { + len =min_t (size_t, val_size,16 ); + + err =spmi_ext_register_write (context, addr, val, len); +if (err) + goto err_out; + + addr += len; + val += len; + val_size -= len; + } + +while (val_size) { + len =min_t (size_t, val_size,8 ); + + err =spmi_ext_register_writel (context, addr, val, len); +if (err) + goto err_out; + + addr += len; + val += len; + val_size -= len; + } + +err_out: +return err; } -static int regmap_spmi_write (void *context,const void *data, -size_t count) +static int regmap_spmi_ext_write (void *context,const void *data, +size_t count) {BUG_ON (count <2 ); -return regmap_spmi_gather_write (context, data,2 , data +2 , count -2 ); +return regmap_spmi_ext_gather_write (context, data,2 , data +2 , + count -2 ); } -static struct regmap_bus regmap_spmi = { - .read = regmap_spmi_read, - .write = regmap_spmi_write, - .gather_write = regmap_spmi_gather_write, +static struct regmap_bus regmap_spmi_ext = { + .read = regmap_spmi_ext_read, + .write = regmap_spmi_ext_write, + .gather_write = regmap_spmi_ext_gather_write, .reg_format_endian_default =REGMAP_ENDIAN_NATIVE , .val_format_endian_default =REGMAP_ENDIAN_NATIVE , };/** -* regmap_init_spmi(): Initialize register map -* -* @sdev: Device that will be interacted with -* @config: Configuration for register map +* regmap_init_spmi_ext(): Create regmap for Ext register space +* @sdev: Device that will be interacted with +* @config: Configuration for register map * * The return value will be an ERR_PTR() on error or a valid pointer to * a struct regmap. */ -struct regmap *regmap_init_spmi (struct spmi_device *sdev, -const struct regmap_config *config) +struct regmap *regmap_init_spmi_ext (struct spmi_device *sdev, +const struct regmap_config *config) { -return regmap_init (&sdev->dev, ®map_spmi, sdev, config); +return regmap_init (&sdev->dev, ®map_spmi_ext, sdev, config); } -EXPORT_SYMBOL_GPL (regmap_init_spmi); +EXPORT_SYMBOL_GPL (regmap_init_spmi_ext);/** -* devm_regmap_init_spmi(): Initialise managed register map -* -* @sdev: Device that will be interacted with -* @config: Configuration for register map +* devm_regmap_init_spmi_ext(): Create managed regmap for Ext register space +* @sdev: SPMI device that will be interacted with +* @config: Configuration for register map * * The return value will be an ERR_PTR() on error or a valid pointer * to a struct regmap. The regmap will be automatically freed by the * device management code. */ -struct regmap *devm_regmap_init_spmi (struct spmi_device *sdev, +struct regmap *devm_regmap_init_spmi_ext (struct spmi_device *sdev,const struct regmap_config *config) { -return devm_regmap_init (&sdev->dev, ®map_spmi, sdev, config); +return devm_regmap_init (&sdev->dev, ®map_spmi_ext, sdev, config); } -EXPORT_SYMBOL_GPL (devm_regmap_init_spmi); +EXPORT_SYMBOL_GPL (devm_regmap_init_spmi_ext);MODULE_LICENSE ("GPL" );
include/linux/regmap.h +8 -4
@@ -321,8 +321,10 @@ struct regmap *regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config);struct regmap *regmap_init_spi (struct spi_device *dev,const struct regmap_config *config); -struct regmap *regmap_init_spmi (struct spmi_device *dev, -const struct regmap_config *config); +struct regmap *regmap_init_spmi_base (struct spmi_device *dev, +const struct regmap_config *config); +struct regmap *regmap_init_spmi_ext (struct spmi_device *dev, +const struct regmap_config *config);struct regmap *regmap_init_mmio_clk (struct device *dev,const char *clk_id,void __iomem *regs,const struct regmap_config *config);
@@ -335,8 +337,10 @@ struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config);struct regmap *devm_regmap_init_spi (struct spi_device *dev,const struct regmap_config *config); -struct regmap *devm_regmap_init_spmi (struct spmi_device *dev, -const struct regmap_config *config); +struct regmap *devm_regmap_init_spmi_base (struct spmi_device *dev, +const struct regmap_config *config); +struct regmap *devm_regmap_init_spmi_ext (struct spmi_device *dev, +const struct regmap_config *config);struct regmap *devm_regmap_init_mmio_clk (struct device *dev,const char *clk_id,void __iomem *regs,const struct regmap_config *config);
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Greg Kroah-Hartman
maintainerQuoted 5 lines · Josh Cartwright
Hey Greg-
Is it possible for you to pick this up for 3.15? It'd be nice if we could get an Ack from devicetree folks on patches 2 and 5, but there has been many months worth of opportunity for that.
All now applied to my tree.
thanks,
greg k-h