1/* 2 * Copyright 2005 Simtec Electronics 3 * Ben Dooks <ben@simtec.co.uk> 4 * http://armlinux.simtec.co.uk/ 5 * 6 * S3C - HWMon interface for ADC 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License version 2 as 10 * published by the Free Software Foundation. 11*/ 12 13#ifndef __HWMON_S3C_H__ 14#define __HWMON_S3C_H__ 15 16/** 17 * s3c_hwmon_chcfg - channel configuration 18 * @name: The name to give this channel. 19 * @mult: Multiply the ADC value read by this. 20 * @div: Divide the value from the ADC by this. 21 * 22 * The value read from the ADC is converted to a value that 23 * hwmon expects (mV) by result = (value_read * @mult) / @div. 24 */ 25struct s3c_hwmon_chcfg { 26 const char *name; 27 unsigned int mult; 28 unsigned int div; 29}; 30 31/** 32 * s3c_hwmon_pdata - HWMON platform data 33 * @in: One configuration for each possible channel used. 34 */ 35struct s3c_hwmon_pdata { 36 struct s3c_hwmon_chcfg *in[8]; 37}; 38 39/** 40 * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device 41 * @pd: Platform data to register to device. 42 * 43 * Register the given platform data for use with the S3C HWMON device. 44 * The call will copy the platform data, so the board definitions can 45 * make the structure itself __initdata. 46 */ 47extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); 48 49#endif /* __HWMON_S3C_H__ */ 50