lkml.org 
[lkml]   [2011]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] TPS65911: Comparator: Add comparator driver
On Tue, May 03, 2011 at 11:19:07AM -0500, Jorge Eduardo Candelaria wrote:

> +/* Comparator 1 voltage selection table in milivolts */
> +static const u16 COMP1_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,
> +};
> +
> +/* Comparator 2 voltage selection table in milivolts */
> +static const u16 COMP2_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,
> +};

These look remarkably similar...

> +static DEVICE_ATTR(comp1_threshold, S_IRUGO, comp_threshold_show, NULL);
> +static DEVICE_ATTR(comp2_threshold, S_IRUGO, comp_threshold_show, NULL);

We should really have a proper API for this, it's a pretty common
feature on devices with an auxilliary ADC of some kind.


\
 
 \ /
  Last update: 2011-05-03 19:31    [from the cache]
©2003-2011 Jasper Spaans