Linux-Kernel-PMIC-Drivers

Rohm power management IC drivers for Linux kernel.

Drivers Home

This project is maintained by RohmSemiconductor

ROHM Power Management IC BD72720

The ROHM BD72720 is a Power Management IC which can be controlled using I2C. Features integrated in the PMIC include: 10 BUCK regulators and 11 LDOs. 3000mA single-cell switching charger. An ADC with an accumulator for current/voltage sensing (and a coulomb counter). RTC and 32.768 kHz clock gate Power control inputs for power-button and HALL sensor. Interrupt capable GPIOs*.

(*)Available functions depend on OTP configuration. The pins are shared and amount of available GPIOs depend on what are the other enabled functions

The device-tree

The PMIC drivers (as well as the drivers consuming regulator-output, GPIOs or other resources provided by the PMIC) will require information about the hardware from the device-tree. The device-tree is a hardware description which must be written to describe the connections and devices in the board where the PMIC is placed. In some cases the device-tree also needs to describe the used PMIC’s OTP configuration so drivers know what features are provided by the PMIC. Correctly written device-tree is mandatory for the drivers to work.

Device-tree binding documents describe the properties that can be added to the device-tree. These documents are written in YAML format, so that the actual device-tree can be verified using scripts/tools.

The PMIC specific bindings:

The bindings are provided for documentory purposes only, “as is” and with no warranty.

Linux:

Source Code:

Downstream

Here is an unmaintained reference driver which you can try. Please note that this reference driver is provided as is, without a warranty. It is not a “production ready quality”, and you are required to do all porting, fixing and testing while writing your driver using it as a starting point.

The driver is currently implementing:

NOTE: The fuel-gauge relies on battery parameters which must be specified based on the used battery. Furthermore, the accuracy can’t be guaranteed as the coulomb counter calibration procedure can depend on the device usage.

Please, read the tag message.

Configuration:

Configuration options one may want to enable for kernel build are:

- CONFIG_MFD_ROHM_BD71828
- CONFIG_REGULATOR_BD71828
- CONFIG_COMMON_CLK_BD718XX
- CONFIG_GPIO_BD72720
- CONFIG_RTC_DRV_BD70528
- CONFIG_KEYBOARD_GPIO
- CONFIG_BD71828_HALL
- CONFIG_LEDS_BD71828
- CONFIG_CHARGER_BD71828
config description subsystem
CONFIG_MFD_ROHM_BD71828 Enables the MFD core driver which handles interrupts and bus access. The core driver also launches the sub device drivers. mfd
CONFIG_REGULATOR_BD71828 Enables the regulator driver which allows the kernel to control PMIC’s regulatos. regulator
CONFIG_COMMON_CLK_BD718XX Enables the clk driver which provides control for the clock gate. clk
CONFIG_GPIO_BD72720 Enables the GPIO driver which provides control for the PMIC’s generic purpose input/output pins. gpio
CONFIG_RTC_DRV_BD70528 Enables the RTC driver which provides the control for the real time clock on PMIC. The RTC can maintain the time when SOC is turned off and provide timed events. Timed wake-up is also supported. rtc
CONFIG_KEYBOARD_GPIO Enables the gpio-keys driver for power-button events. input
CONFIG_BD71828_HALL Enables a driver for sending LID events from HALL sensor. misc
CONFIG_LEDS_BD71828 Enables the LED driver which provides control for the LEDs. led
CONFIG_CHARGER_BD71828 Enables the power-supply driver for charger / battery control. power-supply