Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112399
b: refs/heads/master
c: f16177c
h: refs/heads/master
i:
  112397: f6c78bf
  112395: 10a8a86
  112391: 931e687
  112383: 4eb0d39
v: v3
  • Loading branch information
Eric Miao authored and Russell King committed Sep 23, 2008
1 parent 3fc2989 commit 2bb9af8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55b951e7e6b9f983286c40925e340124d79bb0f7
refs/heads/master: f16177c20c42e1bd780b35259a995f7718986dd4
9 changes: 9 additions & 0 deletions trunk/arch/arm/mach-pxa/sharpsl_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,17 @@ int sharpsl_pm_pxa_read_max1111(int channel)
if (machine_is_tosa()) // Ugly, better move this function into another module
return 0;

#ifdef CONFIG_SENSORS_MAX1111
extern int max1111_read_channel(int);

/* max1111 accepts channels from 0-3, however,
* it is encoded from 0-7 here in the code.
*/
return max1111_read_channel(channel >> 1);
#else
return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
| MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
#endif
}

void sharpsl_pm_pxa_init(void)
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/hwmon/max1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ static int max1111_read(struct device *dev, int channel)
return (v1 << 2) | (v2 >> 6);
}

#ifdef CONFIG_SHARPSL_PM
static struct max1111_data *the_max1111;

int max1111_read_channel(int channel)
{
return max1111_read(&the_max1111->spi->dev, channel);
}
EXPORT_SYMBOL(max1111_read_channel);
#endif

/*
* NOTE: SPI devices do not have a default 'name' attribute, which is
* likely to be used by hwmon applications to distinguish between
Expand Down Expand Up @@ -181,6 +191,9 @@ static int __devinit max1111_probe(struct spi_device *spi)
goto err_remove;
}

#ifdef CONFIG_SHARPSL_PM
the_max1111 = data;
#endif
return 0;

err_remove:
Expand Down

0 comments on commit 2bb9af8

Please sign in to comment.