~ubuntu-branches/debian/experimental/linux-tools/experimental

« back to all changes in this revision

Viewing changes to include/linux/extcon/extcon-adc-jack.h

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-02-02 16:57:49 UTC
  • mfrom: (1.1.10) (0.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20140202165749-tw94o9t1t0a8txk6
Tags: 3.13-1~exp2
Merge changes from sid up to 3.12.6-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
/**
22
22
 * struct adc_jack_cond - condition to use an extcon state
23
 
 * @state      - the corresponding extcon state (if 0, this struct denotes
24
 
 *             the last adc_jack_cond element among the array)
25
 
 * @min_adc    - min adc value for this condition
26
 
 * @max_adc    - max adc value for this condition
 
23
 * @state:              the corresponding extcon state (if 0, this struct
 
24
 *                      denotes the last adc_jack_cond element among the array)
 
25
 * @min_adc:            min adc value for this condition
 
26
 * @max_adc:            max adc value for this condition
27
27
 *
28
28
 * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means
29
29
 * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and
33
33
 * because when no adc_jack_cond is met, state = 0 is automatically chosen.
34
34
 */
35
35
struct adc_jack_cond {
36
 
        u32 state; /* extcon state value. 0 if invalid */
 
36
        u32 state;      /* extcon state value. 0 if invalid */
37
37
        u32 min_adc;
38
38
        u32 max_adc;
39
39
};
40
40
 
41
41
/**
42
42
 * struct adc_jack_pdata - platform data for adc jack device.
43
 
 * @name       - name of the extcon device. If null, "adc-jack" is used.
44
 
 * @consumer_channel - Unique name to identify the channel on the consumer
45
 
 *                   side. This typically describes the channels used within
46
 
 *                   the consumer. E.g. 'battery_voltage'
47
 
 * @cable_names        - array of cable names ending with null.
48
 
 * @adc_contitions     - array of struct adc_jack_cond conditions ending
49
 
 *                     with .state = 0 entry. This describes how to decode
50
 
 *                     adc values into extcon state.
51
 
 * @irq_flags  - irq flags used for the @irq
52
 
 * @handling_delay_ms  - in some devices, we need to read ADC value some
53
 
 *                     milli-seconds after the interrupt occurs. You may
54
 
 *                     describe such delays with @handling_delay_ms, which
55
 
 *                     is rounded-off by jiffies.
 
43
 * @name:               name of the extcon device. If null, "adc-jack" is used.
 
44
 * @consumer_channel:   Unique name to identify the channel on the consumer
 
45
 *                      side. This typically describes the channels used within
 
46
 *                      the consumer. E.g. 'battery_voltage'
 
47
 * @cable_names:        array of cable names ending with null.
 
48
 * @adc_contitions:     array of struct adc_jack_cond conditions ending
 
49
 *                      with .state = 0 entry. This describes how to decode
 
50
 *                      adc values into extcon state.
 
51
 * @irq_flags:          irq flags used for the @irq
 
52
 * @handling_delay_ms:  in some devices, we need to read ADC value some
 
53
 *                      milli-seconds after the interrupt occurs. You may
 
54
 *                      describe such delays with @handling_delay_ms, which
 
55
 *                      is rounded-off by jiffies.
56
56
 */
57
57
struct adc_jack_pdata {
58
58
        const char *name;
59
59
        const char *consumer_channel;
60
 
        /*
61
 
         * The last entry should be NULL
62
 
         */
 
60
 
 
61
        /* The last entry should be NULL */
63
62
        const char **cable_names;
 
63
 
64
64
        /* The last entry's state should be 0 */
65
65
        struct adc_jack_cond *adc_conditions;
66
66