summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
Commit message (Collapse)AuthorAgeFilesLines
...
* extcon: arizona: Wait for any running HPDETs to complete on jack removalCharles Keepax2017-04-061-0/+46
| | | | | | | | | | As the HPDET can't be aborted mid way through we should not allow any new insertion to be processed until the previous HPDET has finished. It is very unlikely but with low enough debounce settings you could start a new HPDET before the old one has completed, which results in an erroneous reading. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* Merge branch 'ib-extcon-4.12' into HEADChanwoo Choi2017-04-063-0/+130
|\
| * extcon: Add new extcon_register_notifier_all() to monitor all external ↵Chanwoo Choi2017-04-043-0/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connectors The extcon core already provides the extcon_register_notifier() function in order to register the notifier block which is used to monitor the state change for the specific external connector such as EXTCON_USB, EXTCON_USB_HOST and so on. The extcon consumer uses the this function. The extcon consumer might need to monitor the all supported external connectors from the extcon device. In this case, The extcon consumer should have each notifier_block structure for each external connector. This patch adds the new extcon_register_notifier_all() function that extcon consumer is able to monitor the state change of all supported external connectors by using only one notifier_block structure. - List of new added functions: int extcon_register_notifier_all(struct extcon_dev *edev, struct notifier_block *nb); int extcon_unregister_notifier_all(struct extcon_dev *edev, struct notifier_block *nb); int devm_extcon_register_notifier_all(struct device *dev, struct extcon_dev *edev, struct notifier_block *nb); void devm_extcon_unregister_notifier_all(struct device *dev, struct extcon_dev *edev, struct notifier_block *nb); Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
* | Revert "extcon: usb-gpio: add support for ACPI gpio interface"Andy Shevchenko2017-03-271-2/+1
|/ | | | | | | | | | | | The commit 942c7924a51e introduced a check for ACPI handle for the device that never appears on any ACPI-enabled platform so far. It seems a confusion with extcon-intel-int3496 which does support ACPI-enabled platforms. Revert commit 942c7924a51e to avoid any confusion in the future. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Set the id pin to direction-input if necessaryHans de Goede2017-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | With the new more strict ACPI gpio code the dsdt's IoRestriction flags are honored on gpiod_get, but in some dsdt's it is wrong, so explicitly call gpiod_direction_input on the id gpio if necessary. This fixes the following errors when the int3496 code is used together with the new more strict ACPI gpio code: [ 2382.484415] gpio gpiochip1: (INT33FF:01): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ [ 2382.484425] gpio gpiochip1: (INT33FF:01): unable to lock HW IRQ 3 for IRQ [ 2382.484429] genirq: Failed to request resources for INT3496:00 (irq 174) on irqchip chv-gpio [ 2382.484518] intel-int3496 INT3496:00: can't request IRQ for USB ID GPIO: -22 [ 2382.500359] intel-int3496: probe of INT3496:00 failed with error -22 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Use gpiod_get instead of gpiod_get_indexHans de Goede2017-03-221-9/+3
| | | | | | | | | Now that we've an acpi mapping table we should be using gpiod_get instead of gpiod_get_index. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Add dependency on X86 as it's Intel specificPeter Robinson2017-03-221-1/+1
| | | | | | | | Add dependency on X86 so it doesn't show up on other arches and add a option for compile test so it still gets build coverage. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Add GPIO ACPI mapping tableAndy Shevchenko2017-03-221-0/+20
| | | | | | | | | | | | In order to make GPIO ACPI library stricter prepare users of gpiod_get_index() to correctly behave when there no mapping is provided by firmware. Here we add explicit mapping between _CRS GpioIo() resources and their names used in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Rename GPIO pins in accordance with bindingAndy Shevchenko2017-03-221-2/+2
| | | | | | | | Update GPIO pin names in extcon-intel-int3496.c driver to follow the existing extcon binding. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Propagate error code of gpiod_to_irq()Andy Shevchenko2017-03-131-2/+2
| | | | | | | | gpiod_to_irq() doesn't return 0. Thus, we just adjust condition and replace -EINVAL by actual error code it returns. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* scripts/spelling.txt: add "swithc" pattern and fix typo instancesMasahiro Yamada2017-02-271-1/+1
| | | | | | | | | | | | | Fix typos and add the following to the scripts/spelling.txt: swithc||switch swithced||switched swithcing||switching Link: http://lkml.kernel.org/r/1481573103-11329-3-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* extcon: palmas: Use dev_dbg macro for the debug messagesRoger Quadros2017-01-251-8/+8
| | | | | | | | User is not interested in USB cable events appearing on the console. Use dev_dbg() instead of dev_info() for these events. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Modify the name of EXTCON_USB_HOST connectorChanwoo Choi2017-01-091-1/+1
| | | | | | | | This patch renames the EXTCON_USB_HOST by using '-' char because the name of all external connector use the '-' char instead of '_' char. - "USB_HOST" -> "USB-HOST" Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Add new EXTCON_CHG_USB_PD type for USB Power DeliveryChanwoo Choi2017-01-091-0/+5
| | | | | | | | | | | This patch adds the new EXTCON_CHG_USB_PD for USB PD (Power Delivery)[1]. The USB Power Delivery specification specifies that USB cable provides the increased power more than 7.5W to device with larger power demand. The EXTCON_CHG_USB_PD has the EXTCON_TYPE_CHG and EXTCON_TYPE_USB type. [1] https://en.wikipedia.org/wiki/USB#PD Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: usb-gpio: Add pinctrl operation during system PMPeter Chen2017-01-091-0/+7
| | | | | | | | | | | At some systems, the pinctrl setting will be lost or needs to set as "sleep" state to save power consumption. So, we need to configure pinctrl as "sleep" state when system enters suspend, and as "default" state after system resumes. In this way, the pinctrl value can be recovered as "default" state after resuming. Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Move defintion of struct extcon_dev to driver/extcon directoryChanwoo Choi2017-01-093-2/+65
| | | | | | | | | | This patch moves the 'struct extcon_dev' of extcon subsystem to driver/extcon/extcon.h header file because the struct extcon_dev have to be handled by extcon API to guarantee the consistency of strcut extcon_dev. If external drivers are able to touch the struct extcon_dev directly, it might cause the critical and unknown problem. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: adc-jack: Use the internal data instead of using struct extcon_devChanwoo Choi2017-01-091-1/+1
| | | | | | | | This patch uses the internal dev instance instead of using the field of struct extcon_dev because the core structure (extcon_dev) of extcon have to be touched by only extcon core driver. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: int3496: Add Intel INT3496 ACPI device extcon driverDavid Cohen2017-01-093-0/+190
| | | | | | | | | | | Add an extcon driver for USB OTG ports controlled by an Intel INT3496 ACPI device (e.g. Baytrail, Cherrytrail devices). Signed-off-by: David Cohen <david.a.cohen@intel.com> [hdgoede@redhat.com: Port to current kernel, cleanup, submit upstream] [hdgoede@redhat.com: Add Documentation/extcon/intel-int3496.txt] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Set EXTCON_USB when EXTCON_CHG_USB_SDP was setBaolin Wang2017-01-091-0/+8
| | | | | | | | According to the documentation, we should set the EXTCON_USB when one SDP charger connector was reported. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Remove potential problem when calling extcon_register_notifier()Chanwoo Choi2017-01-091-26/+7
| | | | | | | | | | This patch removes the potential problem of extcon_register_notifier() when edev parameter is NULL. When edev is NULL, this function returns the first extcon device which includes the sepecific external connector of second paramter. But, it don't guarantee the same operation in all cases. To remove this confusion and potential problem, this patch fixes it. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Fix the module not auto-loadingHans de Goede2017-01-091-0/+7
| | | | | | | | Add a MODULE_DEVICE_TABLE to fix the module not auto-loading. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Remove unnecessary irq?_en register writesHans de Goede2017-01-091-16/+3
| | | | | | | | | | Setting the irq_enable bits is taken care of by the irq chip when we request the irqs and the driver should not be meddling with the irq?_en registers itself. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Use vbus-valid instead of -present to determine cable presenceHans de Goede2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | The vbus-present bit in the power status register also gets set to 1 when a usb-host cable (id-pin shorted to ground) is plugged in and a 5v boost converter is supplying 5v to the otg usb bus. This causes a "disconnect or unknown or ID event" warning in dmesg as well as the extcon device to report the last detected charger cable type as being connected even though none is connected. This commit switches to checking the vbus-valid bit instead, which is only 1 when both vbus is present and the vbus-path is enabled in the vbus-path control register (the vbus-path gets disabled when a usb-host cable is detected, to avoid the pmic drawing power from the 5v boost converter). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Fix possibly reporting 2 cables in state trueHans de Goede2017-01-091-2/+8
| | | | | | | | | | | | | | When the charger type changes from e.g. SDP to CDP, without Vbus being seen as low in between axp288_handle_chrg_det_event would set the state for the new cable type to true, without clearing the state of the previous cable type to false. This commit fixes this and also gets rid of the function local static cable variable, properly storing all drv state in the axp288_extcon_info struct. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Simplify axp288_handle_chrg_det_eventHans de Goede2017-01-091-25/+12
| | | | | | | | | | | | | | axp288_handle_chrg_det_event only gets called on change interrupts (so not that often), extcon_set_state_sync() checks itself if there are any actual changes before notifying listeners, and gpiod_set_value is not really expensive either. So we can simply always do both on each interrupt removing a bunch of somewhat magic looking code from axp288_handle_chrg_det_event. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Remove usb_phy notification codeHans de Goede2017-01-091-12/+0
| | | | | | | | | | | | | | | | | The usb_phy based intel-usb-phy code never got merged into the mainline kernel, so the devm_usb_get_phy() call will always fail, blocking the driver from loading. Since new drivers should use the generic-phy framework, not the old-style usb_phy stuff, keeping this around is not useful. Therefor this patch removes the usb_phy notification bits, which together with the patch to remove the platform_data dependency, makes this driver actually successfully probe on systems with an axp288 pmic. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: axp288: Remove dependency on non-existing platform_dataHans de Goede2017-01-091-15/+10
| | | | | | | | | | | | | | | | | | | | | | | When the extcon_axp288 driver was originally merged, it was merged with a dependency on some other driver providing platform data for it. However such another driver was never merged, so the extcon_axp288 as merged upstream has never worked, its probe method simply always returns -ENODEV. This commit drops the dependency on the pdata always being there, instead it treats not having pdata as the pdata having a NULL gpio_mux_control, something which the code was already prepared to handle. Note that the code for controlling the mux_control gpio is left in place, as this may be necessary to allow the axp288 pmic to properly detect the charger type (instead of assuming 500mA max charge current) on some tablets. This will make it easier for future patches to add support for this gpio by getting the gpio info from somewhere. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: palmas: Check the parent instance to prevent the NULLRoger Quadros2017-01-091-0/+5
| | | | | | | | | | | extcon-palmas must be child of palmas and expects parent's drvdata to be valid. Check for non NULL parent drvdata and fail if it is NULL. Not doing so will result in a NULL pointer dereference later in the probe() parent drvdata is NULL (e.g. misplaced extcon-palmas node in device tree). Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Restructure multi-line comments to follow codingstyleSrikant Ritolia2017-01-095-18/+36
| | | | | | | | Aligning all block comments in extcon subsystem as per linux coding style. Found using checkpatch.pl script. Signed-off-by: Srikant Ritolia <s.ritolia@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: Return error code on failurePan Bian2017-01-091-1/+1
| | | | | | | | | | | | | Function get_zeroed_page() returns a NULL pointer if there is no enough memory. In function extcon_sync(), it returns 0 if the call to get_zeroed_page() fails. The return value 0 indicates success in the context, which is incosistent with the execution status. This patch fixes the bug by returning -ENOMEM. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188611 Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* extcon: arizona: Simplify micd_pol_gpio handlingCharles Keepax2017-01-091-12/+8
| | | | | | | | | Currently we handle both old style GPIO and new style GPIOD differently simplify this slightly by converting the old style GPIO to a GPIOD and just using that from then on. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* Merge tag 'sound-4.10-rc1' of ↵Linus Torvalds2016-12-141-3/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "No dramatic changes are found in this development cycle, but as usual, many commits are applied in a wide range of drivers. Most of big changes are in ASoC, where a few bits of framework work and quite a lot of cleanups and improvements to existing code have been done. The rest are usual stuff, a few HD-audio and USB-audio quirks and fixes, as well as the drop of kthread usages in the whole subsystem. Below are some highlights: ASoC: - support for stereo DAPM controls - some initial work on the of-graph sound card - regmap conversions of the remaining AC'97 drivers - a new version of the topology ABI; this should be backward compatible - updates / cleanups of rsnd, sunxi, sti, nau8825, samsung, arizona, Intel skylake, atom-sst - new drivers for Cirrus Logic CS42L42, Qualcomm MSM8916-WCD, and Realtek RT5665 USB-audio: - yet another race fix at disconnection - tolerated packet size calculation for some Android devices - quirks for Axe-Fx II, QuickCam, TEAC 501/503 HD-audio: - improvement of Dell pin fixup mapping - quirks for HP Z1 Gen3, Alienware 15 R2 2016 and ALC622 headset mic Misc: - replace all kthread usages with simple works" * tag 'sound-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (296 commits) ALSA: hiface: Fix M2Tech hiFace driver sampling rate change ALSA: usb-audio: Eliminate noise at the start of DSD playback. ALSA: usb-audio: Add native DSD support for TEAC 501/503 DAC ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path ASoC: topology: avoid uninitialized kcontrol_type ALSA: usb-audio: Add QuickCam Communicate Deluxe/S7500 to volume_control_quirks ALSA: usb-audio: add implicit fb quirk for Axe-Fx II ASoC: zte: spdif: correct ZX_SPDIF_CLK_RAT define ASoC: zte: spdif and i2s drivers are not zx296702 specific ASoC: rsnd: setup BRGCKR/BRRA/BRRB when starting ASoC: rsnd: enable/disable ADG when suspend/resume timing ASoC: rsnd: tidyup ssi->usrcnt counter check in hw_params ALSA: cs46xx: add a new line ASoC: Intel: update bxt_da7219_max98357a to support quad ch dmic capture ASoC: nau8825: disable sinc filter for high THD of ADC ALSA: usb-audio: more tolerant packetsize ALSA: usb-audio: avoid setting of sample rate multiple times on bus ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting ALSA: hda - Gate the mic jack on HP Z1 Gen3 AiO ALSA: hda: when comparing pin configurations, ignore assoc in addition to seq ...
| *-. Merge remote-tracking branches 'asoc/topic/dpcm', 'asoc/topic/es8328', ↵Mark Brown2016-12-121-3/+5
| |\ \ | | | | | | | | | | | | 'asoc/topic/extcon' and 'asoc/topic/fsl' into asoc-next
| | | * extcon: arizona: Use SoC component pin control functionsRichard Fitzgerald2016-12-011-3/+5
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name of a codec pin can have an optional prefix string, which is defined by the SoC machine driver. The snd_soc_dapm_x_pin functions take the fully-specified name including the prefix and so the existing code would fail to find the pin if the audio machine driver had added a prefix. Switch to using the snd_soc_component_x_pin equivalent functions that take a specified SoC component and automatically add the name prefix to the provided pin name. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | / extcon: usb-gpio: Add VBUS detection supportRoger Quadros2016-11-201-40/+129
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver can now work with both ID and VBUS pins or either one of them. There can be the following 3 cases 1) Both ID and VBUS GPIOs are available: ID = LOW -> USB_HOST active, USB inactive ID = HIGH -> USB_HOST inactive, USB state is same as VBUS. 2) Only ID GPIO is available: ID = LOW -> USB_HOST active, USB inactive ID = HIGH -> USB_HOST inactive, USB active 3) Only VBUS GPIO is available: VBUS = LOW -> USB_HOST inactive, USB inactive VBUS = HIGH -> USB_HOST inactive, USB active Signed-off-by: Roger Quadros <rogerq@ti.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* / extcon: qcom-spmi-misc: Sync the extcon state on interruptStephen Boyd2016-10-261-1/+1
|/ | | | | | | | | | | | | The driver was changed after submission to use the new style APIs like extcon_set_state(). Unfortunately, that only sets the state, and doesn't notify any consumers that the cable state has changed. Use extcon_set_state_sync() here instead so that we notify cable consumers of the state change. This fixes USB host-device role switching on the db8074 platform. Fixes: 38085c987f52 ("extcon: Add support for qcom SPMI PMIC USB id detection hardware") Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
* Merge branch 'next' into resolutionKishon Vijay Abraham I2016-09-151-0/+1
|\ | | | | | | | | | | | | | | Conflicts: drivers/extcon/extcon-adc-jack.c drivers/extcon/extcon-arizona.c drivers/extcon/extcon-gpio.c include/linux/extcon.h
| * extcon: Add new EXTCON_CHG_WPT for Wireless Power Transfer deviceChanwoo Choi2016-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | This patchs add the new EXTCON_CHG_WPT for Wireless Power Transfer[1]. The Wireless Power Transfer is the transmission of electronical energy from a power source. The EXTCON_CHG_WPT has the EXTCON_TYPE_CHG. [1] https://en.wikipedia.org/wiki/Wireless_power_transfer Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: Add new EXTCON_DISP_HMD for Head-mounted Display deviceChanwoo Choi2016-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | This patch adds the new EXTCON_DISP_HMD id for Head-mounted Display[1] device. The HMD device is usually for USB connector type So, the HMD connector has the two extcon types of both EXTCON_TYPE_DISP and EXTCON_TYPE_USB. [1] https://en.wikipedia.org/wiki/Head-mounted_display Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: Add EXTCON_DISP_DP and the property for USB Type-CChris Zhong2016-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Add EXTCON_DISP_DP for the Display external connector. For Type-C connector the DisplayPort can work as an Alternate Mode(VESA DisplayPort Alt Mode on USB Type-C Standard). The Type-C support both normal and flipped orientation, so add a property to extcon. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Add the synchronization extcon APIs to support the notificationChanwoo Choi2016-09-101-75/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the synchronization extcon APIs to support the notifications for both state and property. When extcon_*_sync() functions is called, the extcon informs the information from extcon provider to extcon client. The extcon driver may need to change the both state and multiple properties at the same time. After setting the data of a external connector, the extcon send the notification to client driver with the extcon_*_sync(). The list of new extcon APIs as following: - extcon_sync() : Send the notification for each external connector to synchronize the information between extcon provider driver and extcon client driver. - extcon_set_state_sync() : Set the state of external connector with noti. - extcon_set_property_sync() : Set the property of external connector with noti. For example, case 1, change the state of external connector and synchronized the data. extcon_set_state_sync(edev, EXTCON_USB, 1); case 2, change both the state and property of external connector and synchronized the data. extcon_set_state(edev, EXTCON_USB, 1); extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS 1); extcon_sync(edev, EXTCON_USB); case 3, change the property of external connector and synchronized the data. extcon_set_property(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); extcon_sync(edev, EXTCON_USB); case 4, change the property of external connector and synchronized the data. extcon_set_property_sync(edev, EXTCON_USB, EXTCON_PROP_USB_VBUS, 0); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Rename the extcon_set/get_state() to maintain the function naming ↵Chanwoo Choi2016-09-101-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pattern This patch just renames the existing extcon_get/set_cable_state_() as following because of maintaining the function naming pattern like as extcon APIs for property. - extcon_set_cable_state_() -> extcon_set_state() - extcon_get_cable_state_() -> extcon_get_state() But, this patch remains the old extcon_set/get_cable_state_() functions to prevent the build break. After altering new APIs, remove the old APIs. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Add the support for the capability of each propertyChanwoo Choi2016-09-101-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the support of the property capability setting. This function decides the supported properties of each external connector on extcon provider driver. Ths list of new extcon APIs to get/set the capability of property as following: - int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); - int extcon_set_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Add the support for extcon property according to extcon typeChanwoo Choi2016-09-101-1/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch support the extcon property for the external connector because each external connector might have the property according to the H/W design and the specific characteristics. - EXTCON_PROP_USB_[property name] - EXTCON_PROP_CHG_[property name] - EXTCON_PROP_JACK_[property name] - EXTCON_PROP_DISP_[property name] Add the new extcon APIs to get/set the property value as following: - int extcon_get_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value *prop_val) - int extcon_set_property(struct extcon_dev *edev, unsigned int id, unsigned int prop, union extcon_property_value prop_val) Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Add the extcon_type to gather each connector into five categoryChanwoo Choi2016-09-101-29/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the new extcon type to group the each connecotr into following five category. This type would be used to handle the connectors as a group unit instead of a connector unit. - EXTCON_TYPE_USB : USB connector - EXTCON_TYPE_CHG : Charger connector - EXTCON_TYPE_JACK : Jack connector - EXTCON_TYPE_DISP : Display connector - EXTCON_TYPE_MISC : Miscellaneous connector Also, each external connector is possible to belong to one more extcon type. In caes of EXTCON_CHG_USB_SDP, it have the EXTCON_TYPE_CHG and EXTCON_TYPE_USB. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Reviewed-by: Guenter Roeck <groeck@chromium.org>
| * extcon: Fix compile time warningManinder Singh2016-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes below compilation warning:- drivers/extcon/extcon.c: In function extcon_register_notifier: drivers/extcon/extcon.c:455:6: warning: idx may be used uninitialized in this function [-Wmaybe-uninitialized] if (idx >= 0) { Signed-off-by: Vaneet Narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> [cw00.choi : Modify the patch title using the a captical letter for first char] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: Block the bit masking operation for cable state except for extcon coreChanwoo Choi2016-09-101-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch restrict the usage of extcon_update_state() in the extcon core because the extcon_update_state() use the bit masking to change the state of external connector. When this function is used in device drivers, it may occur the probelm with the handling mistake of bit masking. Also, this patch removes the extcon_get/set_state() functions because these functions use the bit masking which is reluctant way. Instead, extcon provides the extcon_set/get_cable_state_() functions. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: Remove the state_store() to prevent the wrong accessChanwoo Choi2016-09-101-20/+1
| | | | | | | | | | | | | | | | This patch removes the state_store() which change the state of external connectors with bit masking on user-space. It is wrong access to modify the change the state of external connectors. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: gpio: Remove the usage of extcon_set_state()Chanwoo Choi2016-09-101-1/+1
| | | | | | | | | | | | | | | | This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
| * extcon: adc-jack: Remove the usage of extcon_set_state()Chanwoo Choi2016-09-101-12/+14
| | | | | | | | | | | | | | | | This patch removes the usage of extcon_set_state() because it uses the bit masking to change the state of external connectors. The extcon framework should handle the state by extcon_set/get_cable_state_() with extcon id. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>