Blame view

include/linux/hwmon-sysfs.h 1.95 KB
0a3e7eeab   Yani Ioannou   [PATCH] I2C: add ...
1
  /*
10c08f810   Jean Delvare   [PATCH] I2C: rena...
2
   *  hwmon-sysfs.h - hardware monitoring chip driver sysfs defines
0a3e7eeab   Yani Ioannou   [PATCH] I2C: add ...
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
   *
   *  Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com>
   *
   *  This program is free software; you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation; either version 2 of the License, or
   *  (at your option) any later version.
   *
   *  This program is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *  GNU General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
10c08f810   Jean Delvare   [PATCH] I2C: rena...
20
21
  #ifndef _LINUX_HWMON_SYSFS_H
  #define _LINUX_HWMON_SYSFS_H
0a3e7eeab   Yani Ioannou   [PATCH] I2C: add ...
22
23
24
25
26
27
28
  
  struct sensor_device_attribute{
  	struct device_attribute dev_attr;
  	int index;
  };
  #define to_sensor_dev_attr(_dev_attr) \
  	container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
42d3b83fe   Jim Cromie   [PATCH] hwmon: Al...
29
30
31
32
33
34
35
  #define SENSOR_ATTR(_name, _mode, _show, _store, _index)	\
  	{ .dev_attr = __ATTR(_name, _mode, _show, _store),	\
  	  .index = _index }
  
  #define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index)	\
  struct sensor_device_attribute sensor_dev_attr_##_name		\
  	= SENSOR_ATTR(_name, _mode, _show, _store, _index)
0a3e7eeab   Yani Ioannou   [PATCH] I2C: add ...
36

5563e27d3   Rudolf Marek   [PATCH] I2C: W837...
37
38
39
40
41
42
43
  struct sensor_device_attribute_2 {
  	struct device_attribute dev_attr;
  	u8 index;
  	u8 nr;
  };
  #define to_sensor_dev_attr_2(_dev_attr) \
  	container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr)
70adca5a9   Jim Cromie   [PATCH] hwmon: Re...
44
45
46
47
  #define SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index)	\
  	{ .dev_attr = __ATTR(_name, _mode, _show, _store),	\
  	  .index = _index,					\
  	  .nr = _nr }
5563e27d3   Rudolf Marek   [PATCH] I2C: W837...
48
  #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index)	\
70adca5a9   Jim Cromie   [PATCH] hwmon: Re...
49
50
  struct sensor_device_attribute_2 sensor_dev_attr_##_name		\
  	= SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index)
5563e27d3   Rudolf Marek   [PATCH] I2C: W837...
51

10c08f810   Jean Delvare   [PATCH] I2C: rena...
52
  #endif /* _LINUX_HWMON_SYSFS_H */