mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 09:56:46 +00:00
thermal: armada: Pass the platform_device to init_sensor()
In order to perform SoC-specific quirks on platforms that need them, this commit adds a new parameter to the init_sensor() function. This will be used to support early silicons of the Armada 375 SoC, to workaround some hardware issues. Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
This commit is contained in:
parent
1fcacca40a
commit
04bf3d7e5b
@ -46,7 +46,8 @@ struct armada_thermal_priv {
|
|||||||
|
|
||||||
struct armada_thermal_data {
|
struct armada_thermal_data {
|
||||||
/* Initialize the sensor */
|
/* Initialize the sensor */
|
||||||
void (*init_sensor)(struct armada_thermal_priv *);
|
void (*init_sensor)(struct platform_device *pdev,
|
||||||
|
struct armada_thermal_priv *);
|
||||||
|
|
||||||
/* Test for a valid sensor value (optional) */
|
/* Test for a valid sensor value (optional) */
|
||||||
bool (*is_valid)(struct armada_thermal_priv *);
|
bool (*is_valid)(struct armada_thermal_priv *);
|
||||||
@ -62,7 +63,8 @@ struct armada_thermal_data {
|
|||||||
unsigned int is_valid_shift;
|
unsigned int is_valid_shift;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void armadaxp_init_sensor(struct armada_thermal_priv *priv)
|
static void armadaxp_init_sensor(struct platform_device *pdev,
|
||||||
|
struct armada_thermal_priv *priv)
|
||||||
{
|
{
|
||||||
unsigned long reg;
|
unsigned long reg;
|
||||||
|
|
||||||
@ -87,7 +89,8 @@ static void armadaxp_init_sensor(struct armada_thermal_priv *priv)
|
|||||||
writel(reg, priv->sensor);
|
writel(reg, priv->sensor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void armada370_init_sensor(struct armada_thermal_priv *priv)
|
static void armada370_init_sensor(struct platform_device *pdev,
|
||||||
|
struct armada_thermal_priv *priv)
|
||||||
{
|
{
|
||||||
unsigned long reg;
|
unsigned long reg;
|
||||||
|
|
||||||
@ -204,7 +207,7 @@ static int armada_thermal_probe(struct platform_device *pdev)
|
|||||||
return PTR_ERR(priv->control);
|
return PTR_ERR(priv->control);
|
||||||
|
|
||||||
priv->data = (struct armada_thermal_data *)match->data;
|
priv->data = (struct armada_thermal_data *)match->data;
|
||||||
priv->data->init_sensor(priv);
|
priv->data->init_sensor(pdev, priv);
|
||||||
|
|
||||||
thermal = thermal_zone_device_register("armada_thermal", 0, 0,
|
thermal = thermal_zone_device_register("armada_thermal", 0, 0,
|
||||||
priv, &ops, NULL, 0, 0);
|
priv, &ops, NULL, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user