Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2005 Simtec Electronics
0004  *  Ben Dooks <ben@simtec.co.uk>
0005  *  http://armlinux.simtec.co.uk/
0006  *
0007  * S3C - HWMon interface for ADC
0008 */
0009 
0010 #ifndef __HWMON_S3C_H__
0011 #define __HWMON_S3C_H__
0012 
0013 /**
0014  * s3c_hwmon_chcfg - channel configuration
0015  * @name: The name to give this channel.
0016  * @mult: Multiply the ADC value read by this.
0017  * @div: Divide the value from the ADC by this.
0018  *
0019  * The value read from the ADC is converted to a value that
0020  * hwmon expects (mV) by result = (value_read * @mult) / @div.
0021  */
0022 struct s3c_hwmon_chcfg {
0023     const char  *name;
0024     unsigned int    mult;
0025     unsigned int    div;
0026 };
0027 
0028 /**
0029  * s3c_hwmon_pdata - HWMON platform data
0030  * @in: One configuration for each possible channel used.
0031  */
0032 struct s3c_hwmon_pdata {
0033     struct s3c_hwmon_chcfg  *in[8];
0034 };
0035 
0036 /**
0037  * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device
0038  * @pd: Platform data to register to device.
0039  *
0040  * Register the given platform data for use with the S3C HWMON device.
0041  * The call will copy the platform data, so the board definitions can
0042  * make the structure itself __initdata.
0043  */
0044 extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd);
0045 
0046 #endif /* __HWMON_S3C_H__ */