Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205783
b: refs/heads/master
c: 440a520
h: refs/heads/master
i:
  205781: 103f923
  205779: f613298
  205775: 5d95aa7
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Jul 8, 2010
1 parent 285b798 commit 07659a5
Show file tree
Hide file tree
Showing 4 changed files with 722 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e29a0df16ddfcb971a1d498752a782a68e45281
refs/heads/master: 440a5200347734032f7ad0dc84ac3e9222dab9bd
3 changes: 3 additions & 0 deletions trunk/drivers/staging/iio/adc/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@
_show, \
NULL, \
_addr)

#define IIO_EVENT_CODE_IN_HIGH_THRESH(a) (IIO_EVENT_CODE_ADC_BASE + a)
#define IIO_EVENT_CODE_IN_LOW_THRESH(a) (IIO_EVENT_CODE_ADC_BASE + a + 32)
45 changes: 23 additions & 22 deletions trunk/drivers/staging/iio/adc/max1363.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@

/* Specific to the max1363 */
#define MAX1363_MON_RESET_CHAN(a) (1 << ((a) + 4))
#define MAX1363_MON_CONV_RATE_133ksps 0
#define MAX1363_MON_CONV_RATE_66_5ksps 0x02
#define MAX1363_MON_CONV_RATE_33_3ksps 0x04
#define MAX1363_MON_CONV_RATE_16_6ksps 0x06
#define MAX1363_MON_CONV_RATE_8_3ksps 0x08
#define MAX1363_MON_CONV_RATE_4_2ksps 0x0A
#define MAX1363_MON_CONV_RATE_2_0ksps 0x0C
#define MAX1363_MON_CONV_RATE_1_0ksps 0x0E
#define MAX1363_MON_INT_ENABLE 0x01

/* defined for readability reasons */
Expand Down Expand Up @@ -67,9 +59,8 @@

/**
* struct max1363_mode - scan mode information
* @name: Name used to identify the scan mode.
* @conf: The corresponding value of the configuration register
* @numvals: The number of values returned by a single scan
* @modemask: Bit mask corresponding to channels enabled in this mode
*/
struct max1363_mode {
int8_t conf;
Expand Down Expand Up @@ -122,15 +113,6 @@ struct max1363_mode {
.modemask = _mask \
}

/* Not currently handled */
#define MAX1363_MODE_MONITOR { \
.name = "monitor", \
.conf = MAX1363_CHANNEL_SEL(3) \
| MAX1363_CONFIG_SCAN_MONITOR_MODE \
| MAX1363_CONFIG_SE, \
.numvals = 10, \
}

/* This may seem an overly long winded way to do this, but at least it makes
* clear what all the various options actually do. Alternative suggestions
* that don't require user to have intimate knowledge of the chip welcomed.
Expand Down Expand Up @@ -190,7 +172,6 @@ struct max1363_chip_info {
struct attribute_group *scan_attrs;
};


/**
* struct max1363_state - driver instance specific data
* @indio_dev: the industrial I/O device
Expand All @@ -203,19 +184,39 @@ struct max1363_chip_info {
* @poll_work: bottom half of polling interrupt handler
* @protect_ring: used to ensure only one polling bh running at a time
* @reg: supply regulator
* @monitor_on: whether monitor mode is enabled
* @monitor_speed: parameter corresponding to device monitor speed setting
* @mask_high: bitmask for enabled high thresholds
* @mask_low: bitmask for enabled low thresholds
* @thresh_high: high threshold values
* @thresh_low: low threshold values
* @last_timestamp: timestamp of last event interrupt
* @thresh_work: bh work structure for event handling
*/
struct max1363_state {
struct iio_dev *indio_dev;
struct i2c_client *client;
char setupbyte;
char configbyte;
u8 setupbyte;
u8 configbyte;
const struct max1363_chip_info *chip_info;
const struct max1363_mode *current_mode;
u32 requestedmask;
struct work_struct poll_work;
atomic_t protect_ring;
struct iio_trigger *trig;
struct regulator *reg;

/* Using monitor modes and buffer at the same time is
currently not supported */
bool monitor_on;
unsigned int monitor_speed:3;
u8 mask_high;
u8 mask_low;
/* 4x unipolar first then the fours bipolar ones */
s16 thresh_high[8];
s16 thresh_low[8];
s64 last_timestamp;
struct work_struct thresh_work;
};

const struct max1363_mode
Expand Down
Loading

0 comments on commit 07659a5

Please sign in to comment.