| Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ | 
| Sachin Kamat | 2ac1dfc | 2013-12-27 11:40:13 +0530 | [diff] [blame] | 2 | /* | 
| Ben Dooks | bff7865 | 2009-07-18 10:12:28 +0100 | [diff] [blame] | 3 |  * Copyright 2005 Simtec Electronics | 
 | 4 |  *	Ben Dooks <ben@simtec.co.uk> | 
 | 5 |  *	http://armlinux.simtec.co.uk/ | 
 | 6 |  * | 
 | 7 |  * S3C - HWMon interface for ADC | 
| Ben Dooks | bff7865 | 2009-07-18 10:12:28 +0100 | [diff] [blame] | 8 | */ | 
 | 9 |  | 
| Sachin Kamat | 2ac1dfc | 2013-12-27 11:40:13 +0530 | [diff] [blame] | 10 | #ifndef __HWMON_S3C_H__ | 
 | 11 | #define __HWMON_S3C_H__ | 
| Ben Dooks | bff7865 | 2009-07-18 10:12:28 +0100 | [diff] [blame] | 12 |  | 
 | 13 | /** | 
 | 14 |  * s3c_hwmon_chcfg - channel configuration | 
 | 15 |  * @name: The name to give this channel. | 
 | 16 |  * @mult: Multiply the ADC value read by this. | 
 | 17 |  * @div: Divide the value from the ADC by this. | 
 | 18 |  * | 
 | 19 |  * The value read from the ADC is converted to a value that | 
 | 20 |  * hwmon expects (mV) by result = (value_read * @mult) / @div. | 
 | 21 |  */ | 
 | 22 | struct s3c_hwmon_chcfg { | 
 | 23 | 	const char	*name; | 
 | 24 | 	unsigned int	mult; | 
 | 25 | 	unsigned int	div; | 
 | 26 | }; | 
 | 27 |  | 
 | 28 | /** | 
 | 29 |  * s3c_hwmon_pdata - HWMON platform data | 
 | 30 |  * @in: One configuration for each possible channel used. | 
 | 31 |  */ | 
 | 32 | struct s3c_hwmon_pdata { | 
 | 33 | 	struct s3c_hwmon_chcfg	*in[8]; | 
 | 34 | }; | 
 | 35 |  | 
| Maurus Cuelenaere | 6cd82ff | 2010-05-04 13:12:32 +0200 | [diff] [blame] | 36 | /** | 
 | 37 |  * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device | 
 | 38 |  * @pd: Platform data to register to device. | 
 | 39 |  * | 
 | 40 |  * Register the given platform data for use with the S3C HWMON device. | 
 | 41 |  * The call will copy the platform data, so the board definitions can | 
 | 42 |  * make the structure itself __initdata. | 
 | 43 |  */ | 
 | 44 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); | 
 | 45 |  | 
| Sachin Kamat | 2ac1dfc | 2013-12-27 11:40:13 +0530 | [diff] [blame] | 46 | #endif /* __HWMON_S3C_H__ */ |