[U-Boot] [PATCH 09/12] sandbox: add: sandbox PMIC device drivers: I2C emul, pmic, regulator

Simon Glass
2015-05-10T13:57:04Z

Hi Przemyslaw,

On 8 May 2015 at 10:20, Przemyslaw Marczak <p.marczak@samsung.com> wrote:
> This commit adds emulation of sandbox PMIC device, which includes:
> - PMIC I2C emulation driver
> - PMIC I/O driver (UCLASS_PMIC)
> - PMIC regulator driver (UCLASS_REGULATOR)
>
> The sandbox PMIC has 12 significant registers and 4 as padding to 16 bytes,
> which allows using 'i2c md' command with the default count (16).
>
> The sandbox PMIC provides regulators:
> - 2x BUCK
> - 2x LDO
>
> Each, with adjustable output:
> - Enable state
> - Voltage
> - Current limit (LDO1/BUCK1 only)
> - Operation mode (different for BUCK and LDO)
>
> Each attribute has it's own register, beside the enable state, which depends
> on operation mode.
>
> The header file: sandbox_pmic.h includes PMIC's default register values,
> which are set on i2c pmic emul driver's probe() method.
>
> Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
> ---
> doc/device-tree-bindings/pmic/sandbox.txt | 35 +++
> doc/device-tree-bindings/regulator/sandbox.txt | 45 ++++
> drivers/power/pmic/Kconfig | 25 ++
> drivers/power/pmic/Makefile | 3 +-
> drivers/power/pmic/i2c_pmic_emul.c | 145 ++++++++++
> drivers/power/pmic/sandbox.c | 79 ++++++
> drivers/power/regulator/Kconfig | 30 +++
> drivers/power/regulator/Makefile | 1 +
> drivers/power/regulator/sandbox.c | 355 +++++++++++++++++++++++++
> include/power/sandbox_pmic.h | 189 +++++++++++++
> 10 files changed, 906 insertions(+), 1 deletion(-)
> create mode 100644 doc/device-tree-bindings/pmic/sandbox.txt
> create mode 100644 doc/device-tree-bindings/regulator/sandbox.txt
> create mode 100644 drivers/power/pmic/i2c_pmic_emul.c
> create mode 100644 drivers/power/pmic/sandbox.c
> create mode 100644 drivers/power/regulator/sandbox.c
> create mode 100644 include/power/sandbox_pmic.h

Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>

I expected i2c_pmic_emul to get its settings from the device tree too
- is that not possible for some reason?

Regards,
Simon