~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/extcon/extcon-adc-jack.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * include/linux/extcon/extcon-adc-jack.h
  4  *
  5  * Analog Jack extcon driver with ADC-based detection capability.
  6  *
  7  * Copyright (C) 2012 Samsung Electronics
  8  * MyungJoo Ham <myungjoo.ham@samsung.com>
  9  */
 10 
 11 #ifndef _EXTCON_ADC_JACK_H_
 12 #define _EXTCON_ADC_JACK_H_ __FILE__
 13 
 14 #include <linux/module.h>
 15 #include <linux/extcon.h>
 16 
 17 /**
 18  * struct adc_jack_cond - condition to use an extcon state
 19  *                      denotes the last adc_jack_cond element among the array)
 20  * @id:                 the unique id of each external connector
 21  * @min_adc:            min adc value for this condition
 22  * @max_adc:            max adc value for this condition
 23  *
 24  * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means
 25  * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and
 26  * 1 are attached (1<<0 | 1<<1 == 0x3)
 27  *
 28  * Note that you don't need to describe condition for "no cable attached"
 29  * because when no adc_jack_cond is met, state = 0 is automatically chosen.
 30  */
 31 struct adc_jack_cond {
 32         unsigned int id;
 33         u32 min_adc;
 34         u32 max_adc;
 35 };
 36 
 37 /**
 38  * struct adc_jack_pdata - platform data for adc jack device.
 39  * @name:               name of the extcon device. If null, "adc-jack" is used.
 40  * @consumer_channel:   Unique name to identify the channel on the consumer
 41  *                      side. This typically describes the channels used within
 42  *                      the consumer. E.g. 'battery_voltage'
 43  * @cable_names:        array of extcon id for supported cables.
 44  * @adc_contitions:     array of struct adc_jack_cond conditions ending
 45  *                      with .state = 0 entry. This describes how to decode
 46  *                      adc values into extcon state.
 47  * @irq_flags:          irq flags used for the @irq
 48  * @handling_delay_ms:  in some devices, we need to read ADC value some
 49  *                      milli-seconds after the interrupt occurs. You may
 50  *                      describe such delays with @handling_delay_ms, which
 51  *                      is rounded-off by jiffies.
 52  * @wakeup_source:      flag to wake up the system for extcon events.
 53  */
 54 struct adc_jack_pdata {
 55         const char *name;
 56         const char *consumer_channel;
 57 
 58         const unsigned int *cable_names;
 59 
 60         /* The last entry's state should be 0 */
 61         struct adc_jack_cond *adc_conditions;
 62 
 63         unsigned long irq_flags;
 64         unsigned long handling_delay_ms; /* in ms */
 65         bool wakeup_source;
 66 };
 67 
 68 #endif /* _EXTCON_ADC_JACK_H */
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php