1. 22 5月, 2015 1 次提交
    • C
      extcon: Use the unique id for external connector instead of string · 2a9de9c0
      Chanwoo Choi 提交于
      This patch uses the unique id to identify the type of external connector instead
      of string name. The string name have the many potential issues. So, this patch
      defines the 'extcon' enumeration which includes all supported external connector
      on EXTCON subsystem. If new external connector is necessary, the unique id of
      new connector have to be added in 'extcon' enumeration. There are current
      supported external connector in 'enum extcon' as following:
      
      enum extcon {
      	EXTCON_NONE		= 0x0,
      
      	/* USB external connector */
      	EXTCON_USB		= 0x1,
      	EXTCON_USB_HOST		= 0x2,
      
      	/* Charger external connector */
      	EXTCON_TA		= 0x10,
      	EXTCON_FAST_CHARGER	= 0x11,
      	EXTCON_SLOW_CHARGER	= 0x12,
      	EXTCON_CHARGE_DOWNSTREAM = 0x13,
      
      	/* Audio and video external connector */
      	EXTCON_LINE_IN		= 0x20,
      	EXTCON_LINE_OUT		= 0x21,
      	EXTCON_MICROPHONE	= 0x22,
      	EXTCON_HEADPHONE	= 0x23,
      
      	EXTCON_HDMI		= 0x30,
      	EXTCON_MHL		= 0x31,
      	EXTCON_DVI		= 0x32,
      	EXTCON_VGA		= 0x33,
      	EXTCON_SPDIF_IN		= 0x34,
      	EXTCON_SPDIF_OUT	= 0x35,
      	EXTCON_VIDEO_IN		= 0x36,
      	EXTCON_VIDEO_OUT	= 0x37,
      
      	/* Miscellaneous external connector */
      	EXTCON_DOCK		= 0x50,
      	EXTCON_JIG		= 0x51,
      	EXTCON_MECHANICAL	= 0x52,
      
      	EXTCON_END,
      };
      
      For example in extcon-arizona.c:
      To use unique id removes the potential issue about handling
      the inconsistent name of external connector with string.
      - Previously, use the string to register the type of arizona jack connector
      static const char *arizona_cable[] = {
      	"Mechanical",
      	"Microphone",
      	"Headphone",
      	"Line-out",
      };
      - Newly, use the unique id to register the type of arizona jack connector
      static const enum extcon arizona_cable[] = {
      	EXTCON_MECHANICAL,
      	EXTCON_MICROPHONE,
      	EXTCON_HEADPHONE,
      	EXTCON_LINE_OUT,
      
      	EXTCON_NONE,
      };
      
      And this patch modify the prototype of extcon_{get|set}_cable_state_() which
      uses the 'enum extcon id' instead of 'cable_index'. Because although one more
      extcon drivers support USB cable, each extcon driver might has the differnt
      'cable_index' for USB cable. All extcon drivers can use the unique id number
      for same external connector with modified extcon_{get|set}_cable_state_().
      
      - Previously, use 'cable_index' on these functions:
      extcon_get_cable_state_(struct extcon_dev*, int cable_index)
      extcon_set_cable_state_(struct extcon_dev*, int cable_index, bool state)
      
      -Newly, use 'enum extcon id' on these functions:
      extcon_get_cable_state_(struct extcon_dev*, enum extcon id)
      extcon_set_cable_state_(struct extcon_dev*, enum extcon id, bool state)
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
      Acked-by: NRoger Quadros <rogerq@ti.com>
      Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Acked-by: NRamakrishna Pallala <ramakrishna.pallala@intel.com>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      [arnd: Report the build break about drivers/usb/phy/phy-tahvo.c after using the
      unique id for external connector insteadf of string]
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      [dan.carpenter: Report the build warning of extcon_{set|get}_cable_state_()]
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      2a9de9c0
  2. 22 9月, 2014 2 次提交
  3. 23 7月, 2014 2 次提交
  4. 19 3月, 2014 1 次提交
  5. 09 1月, 2014 1 次提交
  6. 27 9月, 2013 2 次提交
  7. 05 8月, 2013 1 次提交
  8. 14 2月, 2013 1 次提交
  9. 06 9月, 2012 1 次提交
    • A
      extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices · 19939860
      anish kumar 提交于
      External connector devices that decides connection information based on
      ADC values may use adc-jack device driver. The user simply needs to
      provide a table of adc range and connection states. Then, extcon
      framework will automatically notify others.
      
      Changes in V1:
      added Lars-Peter Clausen suggested changes:
      Using macros to get rid of boiler plate code such as devm_kzalloc
      and module_platform_driver.Other changes suggested are related to
      coding guidelines.
      
      Changes in V2:
      Removed some unnecessary checks and changed the way we are un-regitering
      extcon and freeing the irq while removing.
      
      Changes in V3:
      Renamed the files to comply with extcon naming.
      
      Changes in V4:
      Added the cancel_work_sync during removing of driver.
      
      Changes in V5:
      Added the dependency of IIO in Kconfig.
      
      Changes in V6:
      Some nitpicks related to naming.
      
      Changes in this version:
      V6 patch version patch broke the build:
      ERROR: "extcon_cable_name" [drivers/extcon/extcon-adc-jack.ko] undefined!
      
      Fixed it in this version.
      Acked-by: NJonathan Cameron <jic23@kernel.org>
      Reviewed-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: Nanish kumar <anish.singh@samsung.com>
      Signed-off-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19939860
  10. 17 8月, 2012 2 次提交
  11. 18 7月, 2012 1 次提交
  12. 21 4月, 2012 1 次提交
    • M
      Extcon: support generic GPIO extcon driver · be48308a
      MyungJoo Ham 提交于
      The generic GPIO extcon driver (an external connector device based on
      GPIO control) and imported from Android kernel.
      
      switch: switch class and GPIO drivers. (splitted)
      Author: Mike Lockwood <lockwood@android.com>
      
      switch: gpio: Don't call request_irq with interrupts disabled
      Author: Arve Hjønnevåg <arve@android.com>
      
      switch_gpio: Add missing #include <linux/interrupt.h>
      Author: Mike Lockwood <lockwood@android.com>
      Signed-off-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      
      --
      Changed from v7:
      - Style updates mentioned by Stephen Boyd and Mark Brown
      Changed from v5:
      - Splitted at v5 from the main extcon patch.
      - Added debounce time for irq handlers.
      - Use request_any_context_irq instead of request_irq
      - User needs to specify irq flags for GPIO interrupts (was fixed to
      IRQF_TRIGGER_LOW before)
      - Use module_platform_driver().
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be48308a
反馈
建议
客服 返回
顶部