root/drivers/hwmon/abx500.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* SPDX-License-Identifier: GPL-2.0-only */
   2 /*
   3  * Copyright (C) ST-Ericsson 2010 - 2013
   4  * Author: Martin Persson <martin.persson@stericsson.com>
   5  *         Hongbo Zhang <hongbo.zhang@linaro.com>
   6  */
   7 
   8 #ifndef _ABX500_H
   9 #define _ABX500_H
  10 
  11 #define NUM_SENSORS 5
  12 
  13 struct abx500_temp;
  14 
  15 /*
  16  * struct abx500_temp_ops - abx500 chip specific ops
  17  * @read_sensor: reads gpadc output
  18  * @irq_handler: irq handler
  19  * @show_name: hwmon device name
  20  * @show_label: hwmon attribute label
  21  * @is_visible: is attribute visible
  22  */
  23 struct abx500_temp_ops {
  24         int (*read_sensor)(struct abx500_temp *, u8, int *);
  25         int (*irq_handler)(int, struct abx500_temp *);
  26         ssize_t (*show_name)(struct device *,
  27                         struct device_attribute *, char *);
  28         ssize_t (*show_label) (struct device *,
  29                         struct device_attribute *, char *);
  30         int (*is_visible)(struct attribute *, int);
  31 };
  32 
  33 /*
  34  * struct abx500_temp - representation of temp mon device
  35  * @pdev: platform device
  36  * @hwmon_dev: hwmon device
  37  * @ops: abx500 chip specific ops
  38  * @gpadc_addr: gpadc channel address
  39  * @min: sensor temperature min value
  40  * @max: sensor temperature max value
  41  * @max_hyst: sensor temperature hysteresis value for max limit
  42  * @min_alarm: sensor temperature min alarm
  43  * @max_alarm: sensor temperature max alarm
  44  * @work: delayed work scheduled to monitor temperature periodically
  45  * @work_active: True if work is active
  46  * @lock: mutex
  47  * @monitored_sensors: number of monitored sensors
  48  * @plat_data: private usage, usually points to platform specific data
  49  */
  50 struct abx500_temp {
  51         struct platform_device *pdev;
  52         struct device *hwmon_dev;
  53         struct abx500_temp_ops ops;
  54         u8 gpadc_addr[NUM_SENSORS];
  55         unsigned long min[NUM_SENSORS];
  56         unsigned long max[NUM_SENSORS];
  57         unsigned long max_hyst[NUM_SENSORS];
  58         bool min_alarm[NUM_SENSORS];
  59         bool max_alarm[NUM_SENSORS];
  60         struct delayed_work work;
  61         bool work_active;
  62         struct mutex lock;
  63         int monitored_sensors;
  64         void *plat_data;
  65 };
  66 
  67 int abx500_hwmon_init(struct abx500_temp *data);
  68 
  69 #endif /* _ABX500_H */

/* [<][>][^][v][top][bottom][index][help] */