blob: 0e3cce130fe26f812fb46e99c936b698f8433e3b [file] [log] [blame]
Sachin Kamat2ac1dfc2013-12-27 11:40:13 +05301/*
Ben Dooksbff78652009-07-18 10:12:28 +01002 * 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
Sachin Kamat2ac1dfc2013-12-27 11:40:13 +053013#ifndef __HWMON_S3C_H__
14#define __HWMON_S3C_H__
Ben Dooksbff78652009-07-18 10:12:28 +010015
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
Maurus Cuelenaere6cd82ff2010-05-04 13:12:32 +020039/**
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
Sachin Kamat2ac1dfc2013-12-27 11:40:13 +053049#endif /* __HWMON_S3C_H__ */