All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 02/20] i2c: Add TPS6586X driver
Date: Sun, 15 Jan 2012 08:30:42 +0100	[thread overview]
Message-ID: <4F1280A2.5030305@denx.de> (raw)
In-Reply-To: <1326490535-3461-3-git-send-email-sjg@chromium.org>

Hello Simon,

Simon Glass wrote:
> This power management chip supports battery charging and a large number
> of power supplies. This initial driver only provides the ability to adjust
> the two synchronous buck converters SM0 and SM1 in a stepwise manner.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v2:
> - Split PMU code into separate TPS6586X driver
> 
>  drivers/power/Makefile   |    1 +
>  drivers/power/tps6586x.c |  293 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/tps6586x.h       |   68 +++++++++++
>  3 files changed, 362 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/power/tps6586x.c
>  create mode 100644 include/tps6586x.h
> 
> diff --git a/drivers/power/Makefile b/drivers/power/Makefile
> index ead00f8..9db8ea2 100644
> --- a/drivers/power/Makefile
> +++ b/drivers/power/Makefile
> @@ -28,6 +28,7 @@ LIB 	:= $(obj)libpower.o
>  COBJS-$(CONFIG_FTPMU010_POWER)	+= ftpmu010.o
>  COBJS-$(CONFIG_TWL4030_POWER)	+= twl4030.o
>  COBJS-$(CONFIG_TWL6030_POWER)	+= twl6030.o
> +COBJS-$(CONFIG_TPS6586X_POWER)	+= tps6586x.o

please hold lists sorted.

>  COBJS	:= $(COBJS-y)
>  SRCS 	:= $(COBJS:.o=.c)
> diff --git a/drivers/power/tps6586x.c b/drivers/power/tps6586x.c
> new file mode 100644
> index 0000000..5915d6f
> --- /dev/null
> +++ b/drivers/power/tps6586x.c
> @@ -0,0 +1,293 @@
> +/*
> + * Copyright (c) 2011 The Chromium OS Authors.
> + * (C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <common.h>
> +#include <tps6586x.h>
> +#include <asm/io.h>
> +#include <i2c.h>
> +
> +/*
> + * abs() handles unsigned ints, shorts and chars and returns a signed long.
> + * TODO: Move this into common?
> + */
> +#define abs(x) ({						\
> +		long ret;					\
> +		{						\
> +			typeof((x)) __x = (x);			\
> +			ret = (__x < 0) ? -__x : __x;		\
> +		}						\
> +		ret;						\
> +	})

I thought we have such a define, but couldn't find it ... I vote
for moving it to common ...

[...]
> diff --git a/include/tps6586x.h b/include/tps6586x.h
> new file mode 100644
> index 0000000..ab88082
> --- /dev/null
> +++ b/include/tps6586x.h
> @@ -0,0 +1,68 @@
[...]
> +
> +/**

wrong comment style.

> + * Enable PWM mode for selected SM0-2
> + *
> + * @param mask	Mask of synchronous converter to enable (TPS6586X_PWM_...)
> + * @return 0 if ok, -1 on error
> + */
> +int tps6586x_set_pwm_mode(int mask);
> +
> +/**

here too, please fix globally.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2012-01-15  7:30 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 21:35 [U-Boot] [PATCH v2 0/20] tegra: warmboot (suspend / resume) support Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 02/20] i2c: Add TPS6586X driver Simon Glass
2012-01-15  7:30   ` Heiko Schocher [this message]
2012-03-30 19:21     ` Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 03/20] Add AES crypto library Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 04/20] tegra: Move ap20.h header into arch location Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 05/20] tegra: Add functions to access low-level Osc/PLL details Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 06/20] tegra: Add crypto library for warmboot code Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 07/20] tegra: Add flow, gp_padctl, fuse, sdram headers Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 08/20] tegra: Add tegra_get_chip_type() to detect SKU Simon Glass
2012-01-19 21:43   ` Stephen Warren
2012-01-13 21:35 ` [U-Boot] [PATCH v2 09/20] tegra: Add EMC support for optimal memory timings Simon Glass
2012-01-19 21:58   ` Stephen Warren
2012-01-19 23:59     ` Simon Glass
2012-01-20  0:10       ` Stephen Warren
2012-04-13 13:31         ` Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 10/20] tegra: Add PMU to manage power supplies Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 11/20] tegra: Set up PMU for Nvidia boards Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 12/20] tegra: Add warmboot implementation Simon Glass
2012-01-19 22:09   ` Stephen Warren
2012-01-13 21:35 ` [U-Boot] [PATCH v2 13/20] tegra: Setup PMC scratch info from ap20 setup Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 14/20] tegra: Set up warmboot code on Nvidia boards Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 15/20] Tegra2: Turn off power detect in board init Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 16/20] tegra: Add EMC settings for Seaboard Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 18/20] tegra: i2c: Add function to find DVC bus Simon Glass
2012-01-15  7:28   ` Heiko Schocher
2012-02-03 23:29     ` Simon Glass
2012-02-06  7:11       ` Heiko Schocher
     [not found] ` <1326490535-3461-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-01-13 21:35   ` [PATCH v2 01/20] fdt: Add function to locate an array in the device tree Simon Glass
2012-01-13 21:35     ` [U-Boot] " Simon Glass
2012-01-13 21:35   ` [PATCH v2 17/20] fdt: tegra: Add EMC node to " Simon Glass
2012-01-13 21:35     ` [U-Boot] " Simon Glass
2012-01-13 21:35   ` [PATCH v2 19/20] tegra: fdt: Add EMC data for Tegra2 Seaboard Simon Glass
2012-01-13 21:35     ` [U-Boot] " Simon Glass
2012-01-13 21:51     ` Simon Glass
2012-01-13 21:51       ` [U-Boot] " Simon Glass
2012-01-13 21:35 ` [U-Boot] [PATCH v2 20/20] tegra: Enable LP0 on Seaboard Simon Glass
2012-01-15  4:11   ` Mike Frysinger
2012-01-19 22:15   ` Stephen Warren
2012-01-15  4:06 ` [U-Boot] [PATCH v2 0/20] tegra: warmboot (suspend / resume) support Mike Frysinger
2012-03-30 19:24   ` Simon Glass
2012-03-30 21:00     ` Tom Warren

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=4F1280A2.5030305@denx.de \
    --to=hs@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.