All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 12/16] cgtqmx6eval: Add PMIC support
Date: Mon, 13 Jul 2015 17:56:28 +0200	[thread overview]
Message-ID: <201507131756.28655.marex@denx.de> (raw)
In-Reply-To: <1436800998-21248-12-git-send-email-otavio@ossystems.com.br>

On Monday, July 13, 2015 at 05:23:14 PM, Otavio Salvador wrote:
> cgtqmx6eval has a PFUZE100 FSL PMIC connected to I2C2.
> 
> Add support for it.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---

[..]

> +/* setup board specific PMIC */
> +int power_init_board(void)
> +{
> +	struct pmic *p;
> +	u32 id1, id2, i;
> +	int ret;
> +	char const *lv_mipi;
> +
> +	/* configure I2C multiplexer */
> +	gpio_direction_output(MX6Q_QMX6_PFUZE_MUX, 1);
> +
> +	power_pfuze100_init(I2C_PMIC);
> +	p = pmic_get("PFUZE100");
> +	if (!p)
> +		return -EINVAL;
> +
> +	ret = pmic_probe(p);
> +	if (ret)
> +		return ret;
> +
> +	pmic_reg_read(p, PFUZE100_DEVICEID, &id1);
> +	pmic_reg_read(p, PFUZE100_REVID, &id2);
> +	printf("PFUZE100 Rev. [%02x/%02x] detected\n", id1, id2);
> +
> +	if (id2 >= 0x20) {

Please trim down the indent hell here ...

if (id2 < 0x20)
	return 0;
...

if (!lv_mipi)
	return 0;

for (...) {
	if (strcmp())
		continue;

}

> +		/* set level of MIPI if specified */
> +		lv_mipi = getenv("lv_mipi");
> +		if (lv_mipi) {
> +			for (i = 0; i < ARRAY_SIZE(mipi_levels); i++) {
> +				if (!strcmp(mipi_levels[i].name, lv_mipi)) {
> +					printf("set MIPI level %s\n",
> +					       mipi_levels[i].name);
> +					ret = pmic_reg_write(p, 
PFUZE100_VGEN4VOL,
> +							     
mipi_levels[i].value);
> +					if (ret)
> +						return ret;
> +				}
> +			}
> +		}
> +	}
> +
> +	return 0;
> +}
> +
[...]

  reply	other threads:[~2015-07-13 15:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 15:23 [U-Boot] [PATCH 01/16] mx53loco: Use generic 'load' command instead of 'fatload' Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 02/16] cgtqmx6eval: Use default prompt Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 03/16] cgtqmx6eval: Use the default CONFIG_SYS_PBSIZE Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 04/16] cgtqmx6eval: Staticize when possible Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 05/16] cgtqmx6eval: Improve the error handling Otavio Salvador
2015-07-13 15:59   ` Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 06/16] cgtqmx6eval: Fit into single lines Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 07/16] cgtqmx6eval: Add ESDHC3 support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 08/16] cgtqmx6eval: Add ESDHC write-protect support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 09/16] cgtqmx6eval: Add SPI NOR flash support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 10/16] cgtqmx6eval: Add Ethernet support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 11/16] cgtqmx6eval: Add thermal support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 12/16] cgtqmx6eval: Add PMIC support Otavio Salvador
2015-07-13 15:56   ` Marek Vasut [this message]
2015-07-13 15:23 ` [U-Boot] [PATCH 13/16] cgtqmx6eval: Add USB support Otavio Salvador
2015-07-13 15:54   ` Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 14/16] cgtqmx6eval: Add splash screen support Otavio Salvador
2015-07-13 15:53   ` Marek Vasut
2015-07-13 15:23 ` [U-Boot] [PATCH 15/16] cgtqmx6eval: Add SATA support Otavio Salvador
2015-07-13 15:23 ` [U-Boot] [PATCH 16/16] cgtqmx6eval: Use standard boot script Otavio Salvador
2015-07-13 15:51   ` Marek Vasut
2015-07-13 16:11     ` Otavio Salvador
2015-07-13 16:13       ` Marek Vasut
2015-07-13 17:15         ` Otavio Salvador
2015-07-13 21:28           ` Marek Vasut
2015-07-14 11:54             ` Otavio Salvador

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=201507131756.28655.marex@denx.de \
    --to=marex@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.