public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 08/12] sunxi: Add axp209 pmic support
Date: Mon, 09 Jun 2014 10:25:43 +0200	[thread overview]
Message-ID: <53956F87.2000700@redhat.com> (raw)
In-Reply-To: <1401993642.15729.176.camel@hastur.hellion.org.uk>

Hi,

On 06/05/2014 08:40 PM, Ian Campbell wrote:
> On Tue, 2014-06-03 at 21:41 +0200, Hans de Goede wrote:
>> +int axp209_set_ldo3(int mvolt)
>> +{
>> +	int cfg = axp209_mvolt_to_cfg(mvolt, 700, 2275, 25);
>> +
>> +	if (mvolt == -1)
>> +		cfg = 0x80;	/* determined by LDO3IN pin */
> 
> Thus would seem more natural as 
> 	if (mvolt == -1)
> 		cfg = 0x80;	/* comment... */
> 	else
> 		cfg = axp209_mvolt_to_cfg(mvolt, 700, 2275, 25);
> 

I Agree that that would be better, fixed in my tree:

https://github.com/jwrdegoede/u-boot-sunxi/commits/sunxi-upstreaming

Note I often rebase + force push this branch.

> BTW, I've just noticed that cfg is often an int but axp209_write etc all
> deal in u8's. Do you not want to be dealing with u8's throughout?

Agreed that this should be u8 everywhere, fixed this for both the axp209
and axp152 code.

Note I won't be re-posting these until the i2c controller conversion to
the CONFIG_SYS_I2C framework is sorted out.

>> +void axp209_poweroff(void)
>> +{
>> +	u8 val;
>> +
>> +	if (axp209_read(AXP209_SHUTDOWN, &val) != 0)
>> +		return;
>> +
>> +	val |= AXP209_POWEROFF;
>> +
>> +	if (axp209_write(AXP209_SHUTDOWN, val) != 0)
>> +		return;
>> +
>> +	udelay(10000);		/* wait for power to drain */
> 
> Is this essentially a "wait to die" loop? i.e. we expect power to
> disappear while in the middle of it. In which case shouldn't it be
> infinite? What would happen if we were to return from this function?
> Nothing actually calls it AFAICT so maybe you can just punt on the whole
> thing and drop the function for now...

I agree that just dropping this function for now is best, done.

Regards,

Hans

  reply	other threads:[~2014-06-09  8:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03 19:41 [U-Boot] [PATCH v2 00/12] sunxi: Bug fixes, sun4i and sun5i support, pmic support and network improvements Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 01/12] sunxi: mksunxiboot: Fix loading of files with a size which is not a multiple of 4 Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 02/12] sunxi: Fix u-boot-spl.lds to refer to .vectors Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 03/12] sunxi: Remove mmc DMA support Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 04/12] sunxi: Implement reset_cpu Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 05/12] sunxi: Add sun4i support Hans de Goede
2014-06-05 18:13   ` Ian Campbell
2014-06-03 19:41 ` [U-Boot] [PATCH v2 06/12] sunxi: Add sun5i support Hans de Goede
2014-06-05 18:14   ` Ian Campbell
2014-06-03 19:41 ` [U-Boot] [PATCH v2 07/12] sunxi: Add i2c support Hans de Goede
2014-06-04  4:34   ` Heiko Schocher
2014-06-09 14:48     ` Hans de Goede
2014-06-03 19:41 ` [U-Boot] [PATCH v2 08/12] sunxi: Add axp209 pmic support Hans de Goede
2014-06-05 18:40   ` Ian Campbell
2014-06-09  8:25     ` Hans de Goede [this message]
2014-06-09  8:50       ` Ian Campbell
2014-06-09  8:59         ` Hans de Goede
2014-06-09  9:06           ` Albert ARIBAUD
2014-06-09  9:08             ` Hans de Goede
2014-06-09 10:09           ` Ian Campbell
2014-06-03 19:41 ` [U-Boot] [PATCH v2 09/12] sunxi: Add axp152 " Hans de Goede
2014-06-05 18:48   ` Ian Campbell
2014-06-03 19:42 ` [U-Boot] [PATCH v2 10/12] net: Rename and cleanup sunxi (Allwinner) emac driver Hans de Goede
2014-06-03 19:42 ` [U-Boot] [PATCH v2 11/12] sunxi: Add emac glue, enable emac on the cubieboard Hans de Goede
2014-06-05 18:49   ` Ian Campbell
2014-06-03 19:42 ` [U-Boot] [PATCH v2 12/12] sunxi: Add support for using MII phy-s with the GMAC nic Hans de Goede
2014-06-05 18:50   ` Ian Campbell

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=53956F87.2000700@redhat.com \
    --to=hdegoede@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox