From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] power: Add support for LTC3676 PMIC
Date: Thu, 24 Apr 2014 10:05:38 +0200 [thread overview]
Message-ID: <5358C5D2.3080207@denx.de> (raw)
In-Reply-To: <1398228839-29780-4-git-send-email-tharvey@gateworks.com>
Hi Tim,
On 23/04/2014 06:53, Tim Harvey wrote:
> The LTC3676 PMIC includes four DC/DC converters, and three 300mA
> LDO Regulators (two Adjustable). The DC/DC converters are adjustable based
> on a resistor devider (board-specific).
>
> This adds support for the LTC3676 by creating a namespace unique init function
> that uses the PMIC API to allocate a pmic and defines the registers.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
> drivers/power/pmic/Makefile | 1 +
> drivers/power/pmic/pmic_ltc3676.c | 32 ++++++++++++++++++++++++
> include/power/ltc3676_pmic.h | 51 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 84 insertions(+)
> create mode 100644 drivers/power/pmic/pmic_ltc3676.c
> create mode 100644 include/power/ltc3676_pmic.h
>
> diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
> index 4129bda..920bbdc 100644
> --- a/drivers/power/pmic/Makefile
> +++ b/drivers/power/pmic/Makefile
> @@ -5,6 +5,7 @@
> # SPDX-License-Identifier: GPL-2.0+
> #
>
> +obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o
> obj-$(CONFIG_POWER_MAX8998) += pmic_max8998.o
> obj-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
> obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
> diff --git a/drivers/power/pmic/pmic_ltc3676.c b/drivers/power/pmic/pmic_ltc3676.c
> new file mode 100644
> index 0000000..9b874cb
> --- /dev/null
> +++ b/drivers/power/pmic/pmic_ltc3676.c
> @@ -0,0 +1,32 @@
> +/*
> + * Copyright (C) 2014 Gateworks Corporation
> + * Tim Harvey <tharvey@gateworks.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include <common.h>
> +#include <errno.h>
> +#include <i2c.h>
> +#include <power/pmic.h>
> +#include <power/ltc3676_pmic.h>
> +
> +int power_ltc3676_init(unsigned char bus)
> +{
> + static const char name[] = "LTC3676_PMIC";
> + struct pmic *p = pmic_alloc();
> +
> + if (!p) {
> + printf("%s: POWER allocation error!\n", __func__);
> + return -ENOMEM;
> + }
> +
> + p->name = name;
> + p->interface = PMIC_I2C;
> + p->number_of_regs = LTC3676_NUM_OF_REGS;
> + p->hw.i2c.addr = CONFIG_POWER_LTC3676_I2C_ADDR;
> + p->hw.i2c.tx_num = 1;
> + p->bus = bus;
> +
> + return 0;
> +}
> diff --git a/include/power/ltc3676_pmic.h b/include/power/ltc3676_pmic.h
> new file mode 100644
> index 0000000..dcaa985
> --- /dev/null
> +++ b/include/power/ltc3676_pmic.h
> @@ -0,0 +1,51 @@
> +/*
> + * Copyright (C) 2014 Gateworks Corporation
> + * Tim Harvey <tharvey@gateworks.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#ifndef __LTC3676_PMIC_H_
> +#define __LTC3676_PMIC_H_
> +
> +/* LTC3676 registers */
> +enum {
> + LTC3676_BUCK1 = 0x01,
> + LTC3676_BUCK2 = 0x02,
> + LTC3676_BUCK3 = 0x03,
> + LTC3676_BUCK4 = 0x04,
> + LTC3676_LDOA = 0x05,
> + LTC3676_LDOB = 0x06,
> + LTC3676_SQD1 = 0x07,
> + LTC3676_SQD2 = 0x08,
> + LTC3676_CNTRL = 0x09,
> + LTC3676_DVB1A = 0x0A,
> + LTC3676_DVB1B = 0x0B,
> + LTC3676_DVB2A = 0x0C,
> + LTC3676_DVB2B = 0x0D,
> + LTC3676_DVB3A = 0x0E,
> + LTC3676_DVB3B = 0x0F,
> + LTC3676_DVB4A = 0x10,
> + LTC3676_DVB4B = 0x11,
> + LTC3676_MSKIRQ = 0x12,
> + LTC3676_MSKPG = 0x13,
> + LTC3676_USER = 0x14,
> + LTC3676_HRST = 0x1E,
> + LTC3676_CLIRQ = 0x1F,
> + LTC3676_IRQSTAT = 0x15,
> + LTC3676_PGSTATL = 0x16,
> + LTC3676_PGSTATR = 0x17,
> + LTC3676_NUM_OF_REGS = 0x20,
> +};
> +
> +/*
> + * SW Configuration
> + */
> +
> +#define LTC3676_DVB_MASK 0x1f
> +#define LTC3676_PGOOD_MASK (1<<5)
> +#define LTC3676_REF_SELA (0<<5)
> +#define LTC3676_REF_SELB (1<<5)
> +
> +int power_ltc3676_init(unsigned char bus);
> +#endif
>
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
next prev parent reply other threads:[~2014-04-24 8:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 4:53 [U-Boot] [PATCH 0/4] ventana: Add LTC3676 PMIC support Tim Harvey
2014-04-23 4:53 ` [U-Boot] [PATCH 1/4] power: make pfuze100 be able to coexist with other pmics Tim Harvey
2014-04-24 8:03 ` Stefano Babic
2014-04-24 8:19 ` Tim Harvey
2014-04-24 8:30 ` Stefano Babic
2014-05-09 12:44 ` Stefano Babic
2014-04-23 4:53 ` [U-Boot] [PATCH 2/4] ventana: use non-generic pfuze100 init Tim Harvey
2014-05-09 12:44 ` Stefano Babic
2014-04-23 4:53 ` [U-Boot] [PATCH 3/4] power: Add support for LTC3676 PMIC Tim Harvey
2014-04-24 8:05 ` Stefano Babic [this message]
2014-05-09 12:43 ` Stefano Babic
2014-04-23 4:53 ` [U-Boot] [PATCH 4/4] [PATCH] ventana: Add support for the " Tim Harvey
2014-04-24 8:08 ` Stefano Babic
2014-05-05 15:22 ` Tim Harvey
2014-05-09 12:42 ` Stefano Babic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5358C5D2.3080207@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.