hwmon: add max1111_read_channel() for use by sharpsl_pm
This is not generic, and is added here for backward compatibility. It is made an individual commit here to make it easier for revert once the sharpsl_pm gets generic enough. Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
55b951e7e6
commit
f16177c20c
|
@ -132,8 +132,17 @@ int sharpsl_pm_pxa_read_max1111(int channel)
|
||||||
if (machine_is_tosa()) // Ugly, better move this function into another module
|
if (machine_is_tosa()) // Ugly, better move this function into another module
|
||||||
return 0;
|
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
|
return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
|
||||||
| MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
|
| MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void sharpsl_pm_pxa_init(void)
|
void sharpsl_pm_pxa_init(void)
|
||||||
|
|
|
@ -66,6 +66,16 @@ static int max1111_read(struct device *dev, int channel)
|
||||||
return (v1 << 2) | (v2 >> 6);
|
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
|
* NOTE: SPI devices do not have a default 'name' attribute, which is
|
||||||
* likely to be used by hwmon applications to distinguish between
|
* likely to be used by hwmon applications to distinguish between
|
||||||
|
@ -181,6 +191,9 @@ static int __devinit max1111_probe(struct spi_device *spi)
|
||||||
goto err_remove;
|
goto err_remove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_SHARPSL_PM
|
||||||
|
the_max1111 = data;
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_remove:
|
err_remove:
|
||||||
|
|
Loading…
Reference in New Issue