Skip to content

Commit

Permalink
Merge branch 'pm-avs'
Browse files Browse the repository at this point in the history
* pm-avs:
  MAINTAINERS: update entry for drivers/power/avs
  PM / AVS: rockchip-io: add driver handling Rockchip io domains
  regulator: core: Add REGULATOR_EVENT_PRE_VOLTAGE_CHANGE (and ABORT)
  • Loading branch information
Rafael J. Wysocki committed Oct 6, 2014
2 parents 0f4685d + 7961bb7 commit 4734c6e
Show file tree
Hide file tree
Showing 7 changed files with 521 additions and 9 deletions.
83 changes: 83 additions & 0 deletions Documentation/devicetree/bindings/power/rockchip-io-domain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Rockchip SRAM for IO Voltage Domains:
-------------------------------------

IO domain voltages on some Rockchip SoCs are variable but need to be
kept in sync between the regulators and the SoC using a special
register.

A specific example using rk3288:
- If the regulator hooked up to a pin like SDMMC0_VDD is 3.3V then
bit 7 of GRF_IO_VSEL needs to be 0. If the regulator hooked up to
that same pin is 1.8V then bit 7 of GRF_IO_VSEL needs to be 1.

Said another way, this driver simply handles keeping bits in the SoC's
general register file (GRF) in sync with the actual value of a voltage
hooked up to the pins.

Note that this driver specifically doesn't include:
- any logic for deciding what voltage we should set regulators to
- any logic for deciding whether regulators (or internal SoC blocks)
should have power or not have power

If there were some other software that had the smarts of making
decisions about regulators, it would work in conjunction with this
driver. When that other software adjusted a regulator's voltage then
this driver would handle telling the SoC about it. A good example is
vqmmc for SD. In that case the dw_mmc driver simply is told about a
regulator. It changes the regulator between 3.3V and 1.8V at the
right time. This driver notices the change and makes sure that the
SoC is on the same page.


Required properties:
- compatible: should be one of:
- "rockchip,rk3188-io-voltage-domain" for rk3188
- "rockchip,rk3288-io-voltage-domain" for rk3288
- rockchip,grf: phandle to the syscon managing the "general register files"


You specify supplies using the standard regulator bindings by including
a phandle the the relevant regulator. All specified supplies must be able
to report their voltage. The IO Voltage Domain for any non-specified
supplies will be not be touched.

Possible supplies for rk3188:
- ap0-supply: The supply connected to AP0_VCC.
- ap1-supply: The supply connected to AP1_VCC.
- cif-supply: The supply connected to CIF_VCC.
- flash-supply: The supply connected to FLASH_VCC.
- lcdc0-supply: The supply connected to LCD0_VCC.
- lcdc1-supply: The supply connected to LCD1_VCC.
- vccio0-supply: The supply connected to VCCIO0.
- vccio1-supply: The supply connected to VCCIO1.
Sometimes also labeled VCCIO1 and VCCIO2.

Possible supplies for rk3288:
- audio-supply: The supply connected to APIO4_VDD.
- bb-supply: The supply connected to APIO5_VDD.
- dvp-supply: The supply connected to DVPIO_VDD.
- flash0-supply: The supply connected to FLASH0_VDD. Typically for eMMC
- flash1-supply: The supply connected to FLASH1_VDD. Also known as SDIO1.
- gpio30-supply: The supply connected to APIO1_VDD.
- gpio1830 The supply connected to APIO2_VDD.
- lcdc-supply: The supply connected to LCDC_VDD.
- sdcard-supply: The supply connected to SDMMC0_VDD.
- wifi-supply: The supply connected to APIO3_VDD. Also known as SDIO0.


Example:

io-domains {
compatible = "rockchip,rk3288-io-voltage-domain";
rockchip,grf = <&grf>;

audio-supply = <&vcc18_codec>;
bb-supply = <&vcc33_io>;
dvp-supply = <&vcc_18>;
flash0-supply = <&vcc18_flashio>;
gpio1830-supply = <&vcc33_io>;
gpio30-supply = <&vcc33_pmuio>;
lcdc-supply = <&vcc33_lcd>;
sdcard-supply = <&vccio_sd>;
wifi-supply = <&vcc18_wl>;
};
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8414,11 +8414,11 @@ S: Maintained
F: Documentation/security/Smack.txt
F: security/smack/

SMARTREFLEX DRIVERS FOR ADAPTIVE VOLTAGE SCALING (AVS)
DRIVERS FOR ADAPTIVE VOLTAGE SCALING (AVS)
M: Kevin Hilman <khilman@kernel.org>
M: Nishanth Menon <nm@ti.com>
S: Maintained
F: drivers/power/avs/smartreflex.c
F: drivers/power/avs/
F: include/linux/power/smartreflex.h
L: linux-pm@vger.kernel.org

Expand Down
8 changes: 8 additions & 0 deletions drivers/power/avs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ menuconfig POWER_AVS
AVS is also called SmartReflex on OMAP devices.

Say Y here to enable Adaptive Voltage Scaling class support.

config ROCKCHIP_IODOMAIN
tristate "Rockchip IO domain support"
depends on ARCH_ROCKCHIP && OF
help
Say y here to enable support io domains on Rockchip SoCs. It is
necessary for the io domain setting of the SoC to match the
voltage supplied by the regulators.
1 change: 1 addition & 0 deletions drivers/power/avs/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
obj-$(CONFIG_POWER_AVS_OMAP) += smartreflex.o
obj-$(CONFIG_ROCKCHIP_IODOMAIN) += rockchip-io-domain.o
Loading

0 comments on commit 4734c6e

Please sign in to comment.