All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Cc: linux-kernel@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com, lrg@ti.com,
	Graeme Gregory <gg@slimlogic.co.uk>,
	grant.likely@secretlab.ca
Subject: Re: [PATCHv2 5/5] TPS65911: Comparator: Add comparator driver
Date: Fri, 13 May 2011 18:59:32 +0200	[thread overview]
Message-ID: <20110513165931.GK8970@sortiz-mobl> (raw)
In-Reply-To: <A9ADABDA-9D43-44CC-92D8-113C42AA5EE0@slimlogic.co.uk>

Hi Jorge,

On Wed, May 04, 2011 at 07:21:46PM -0500, Jorge Eduardo Candelaria wrote:
> This driver adds functionality to the tps65911 chip driver.
> 
> Two of the comparators are configurable by software and measures
> VCCS voltage to detect high or low voltage scenarios.
A few comments:

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 65930a7..8c748f4 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -679,6 +679,13 @@ config MFD_TPS65910
>  	  if you say yes here you get support for the TPS65910 series of
>  	  Power Management chips.
>  
> +config TPS65911_COMPARATOR
> +	tristate "TPS65911 Comparator"
> +	depends on MFD_TPS65910
> +	help
> +	  if you say yes here you get support for the TPS65910 comparator
> +	  module.
> +
I still don't know what it compares and why I would want to enable that.


>  endif # MFD_SUPPORT
>  
>  menu "Multimedia Capabilities Port drivers"
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index c771eed..320de3e 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -89,3 +89,4 @@ obj-$(CONFIG_MFD_WL1273_CORE)	+= wl1273-core.o
>  obj-$(CONFIG_MFD_CS5535)	+= cs5535-mfd.o
>  obj-$(CONFIG_MFD_OMAP_USB_HOST)	+= omap-usb-host.o
>  obj-$(CONFIG_MFD_TPS65910)	+= tps65910.o tps65910-gpio.o tps65910-irq.o
> +obj-$(CONFIG_TPS65911_COMP)	+= tps65911-comparator.o
> diff --git a/drivers/mfd/tps65911-comparator.c b/drivers/mfd/tps65911-comparator.c
> new file mode 100644
> index 0000000..b8b985b
> --- /dev/null
> +++ b/drivers/mfd/tps65911-comparator.c
> @@ -0,0 +1,188 @@
> +/*
> + * tps65910.c  --  TI TPS6591x
> + *
> + * Copyright 2010 Texas Instruments Inc.
> + *
> + * Author: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
> + *
> + *  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.
> + *
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/slab.h>
> +#include <linux/err.h>
> +#include <linux/platform_device.h>
> +#include <linux/debugfs.h>
> +#include <linux/gpio.h>
> +#include <linux/mfd/tps65910.h>
> +
> +#define COMP					0
> +#define COMP1					1
> +#define COMP2					2
> +
> +/* Comparator 1 voltage selection table in milivolts */
> +static const u16 COMP_VSEL_TABLE[] = {
> +	0, 2500, 2500, 2500, 2500, 2550, 2600, 2650,
> +	2700, 2750, 2800, 2850, 2900, 2950, 3000, 3050,
> +	3100, 3150, 3200, 3250, 3300, 3350, 3400, 3450,
> +	3500,
> +};
> +
> +struct comparator {
> +	const char *name;
> +	int reg;
> +	int uV_max;
> +	const u16 *vsel_table;
> +};
> +
> +static struct comparator tps_comparators[] = {
> +	{
> +		.name = "COMP1",
> +		.reg = TPS65911_VMBCH,
> +		.uV_max = 3500,
> +		.vsel_table = COMP_VSEL_TABLE,
> +	},
> +	{
> +		.name = "COMP2",
> +		.reg = TPS65911_VMBCH2,
> +		.uV_max = 3500,
> +		.vsel_table = COMP_VSEL_TABLE,
> +	},
> +};
This driver really looks like it could belong to drivers/regulator.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  reply	other threads:[~2011-05-13 16:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  0:21 [PATCHv2 5/5] TPS65911: Comparator: Add comparator driver Jorge Eduardo Candelaria
2011-05-13 16:59 ` Samuel Ortiz [this message]
2011-05-14 22:29   ` Mark Brown
2011-05-22 20:40     ` Samuel Ortiz
2011-05-22 22:46       ` Mark Brown

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=20110513165931.GK8970@sortiz-mobl \
    --to=sameo@linux.intel.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=grant.likely@secretlab.ca \
    --cc=jedu@slimlogic.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    /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.