12 Feb, 2019
1 commit
-
Add NXP PTN5150 Type-C CC logic chip, this chip supplies CC flip
function automatically, and the driver will notify extcon
consumer (USB controller driver) attach and detach events.Signed-off-by: Peter Chen
10 Sep, 2018
1 commit
-
commit 8a9dbb779fe882325b9a0238494a7afaff2eb444 upstream.
Previously, extcon used the spinlock before calling the notifier_call_chain
to prevent the scheduled out of task and to prevent the notification delay.
When spinlock is locked for sending the notification, deadlock issue
occured on the side of extcon consumer device. To fix this issue,
extcon consumer device should always use the work. it is always not
reasonable to use work.To fix this issue on extcon consumer device, release locking when sending
the notification of connector state.Fixes: ab11af049f88 ("extcon: Add the synchronization extcon APIs to support the notification")
Cc: stable@vger.kernel.org
Cc: Roger Quadros
Cc: Kishon Vijay Abraham I
Signed-off-by: Chanwoo Choi
Signed-off-by: Greg Kroah-Hartman
24 Apr, 2018
1 commit
-
commit ad49aee401dd1997ec71360df6e51a91ad3cf516 upstream.
Sometimes (firmware bug?) the V5 boost GPIO is not configured as output
by the BIOS, leading to the 5V boost convertor being permanently on,Explicitly set the direction and drv flags rather then inheriting them
from the firmware to fix this.Fixes: 585cb239f4de ("extcon: intel-cht-wc: Disable external 5v boost ...")
Cc: stable@vger.kernel.org
Reviewed-by: Andy Shevchenko
Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi
Signed-off-by: Greg Kroah-Hartman
28 Feb, 2018
1 commit
-
commit 0434352d3d2e950cf5e743f6062abd87de22f960 upstream.
Some other drivers may be waiting for our extcon to show-up, exiting their
probe methods with -EPROBE_DEFER until we show up.These drivers will typically get the cable state directly after getting
the extcon, this commit changes the int3496 code to wait for the initial
processing of the id-pin to complete before exiting probe() with 0, which
will cause devices waiting on the defered probe to get reprobed.This fixes a race where the initial work might still be running while other
drivers were already calling extcon_get_state().Fixes: 2f556bdb9f2e ("extcon: int3496: Add Intel INT3496 ACPI ... driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi
Signed-off-by: Greg Kroah-Hartman
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
25 Aug, 2017
1 commit
-
Without this patch extcon couldn't notify attaching MHL cable.
Signed-off-by: Maciej Purski
Signed-off-by: Chanwoo Choi
16 Aug, 2017
2 commits
-
The extcon files explains the detailed operation for functions and
what is meaning of extcon structure. There are different explanation
even if the same argument.So, it modifies the description for both functions and structures
in order to improve the readability and guide the role of functions
more well.Also, this patch fixes the mismatching license info as a GPL v2
and removes the inactive author information.Signed-off-by: Chanwoo Choi
-
This patch removes the unused CABLE_NAME_MAX definition.
Signed-off-by: Chanwoo Choi
07 Aug, 2017
1 commit
-
Return -ENOMEM in case of memory allocation failure. This avoids a NULL
pointer dereference.Fixes: c69831666109 ("extcon: cros-ec: Add extcon-cros-ec driver to support display out")
Signed-off-by: Christophe JAILLET
Signed-off-by: Chanwoo Choi
19 Jul, 2017
1 commit
-
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.Signed-off-by: Rob Herring
Signed-off-by: Chanwoo Choi
17 Jul, 2017
2 commits
-
This is the driver for the USB Type C cable detection mechanism
built into the ChromeOS Embedded Controller on systems that
have USB Type-C ports.At present, this allows for the presence of display out, but in
future, it may also be used to notify host and device type cables
and the presence of power.Signed-off-by: Benson Leung
Signed-off-by: Enric Balletbo i Serra
Acked-by: Chanwoo Choi
Acked-by: Lee Jones
Signed-off-by: Chanwoo Choi
16 Jul, 2017
1 commit
-
acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by work with
const acpi_device_id. So mark the non-const structs as const.File size before:
text data bss dec hex filename
1733 352 0 2085 825 drivers/extcon/extcon-intel-int3496.oFile size After adding 'const':
text data bss dec hex filename
1797 272 0 2069 815 drivers/extcon/extcon-intel-int3496.oSigned-off-by: Arvind Yadav
Signed-off-by: Chanwoo Choi
12 Jun, 2017
1 commit
-
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assingment if ->probe() fails.Signed-off-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi
23 May, 2017
4 commits
-
Depend on the architecture the device actuall is in, also add
dep on the compile test to ensure continued coverage.Signed-off-by: Peter Robinson
Signed-off-by: Chanwoo Choi -
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kcalloc".* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.Signed-off-by: Markus Elfring
Reviewed-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
Adjust three words in this description for a function.
Signed-off-by: Markus Elfring
Signed-off-by: Chanwoo Choi -
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kcalloc".Signed-off-by: Markus Elfring
Signed-off-by: Chanwoo Choi
06 Apr, 2017
10 commits
-
This patch just uses the BIT() macro to make the code simple.
Signed-off-by: Chanwoo Choi
-
When we leave host-mode because the id-pin is no longer connected to
ground, the 5v boost converter is normally still on, so we will see
Vbus, but it is not from a charger (normally) so the charger-type
detection will fail.This commit silences the cht_wc_extcon_get_charger() false-positive
errors when we're leaving host mode.Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi -
Disable the 5v boost converter on probe in case it was left on by
the BIOS, this fixes 2 problems:1) This gets seen by the external battery charger as a valid Vbus
supply and it then tries to feed Vsys from this creating a
feedback loop which causes aprox. 300 mA extra battery drain
(and unless we drive the external-charger-disable pin high it
also tries to charge the battery causing even more feedback).
2) This gets seen by the pwrsrc block as a SDP USB Vbus supplySince the external battery charger has its own 5v boost converter
which does not have these issues, we simply turn the separate
external 5v boost converter off and leave it off entirely.Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi -
This patch removes the porting compatibility for switch class
because there is no any usage and requirement of swich class
over a couple of years.Signed-off-by: Chanwoo Choi
-
Add a driver for charger detection / control on the Intel Cherrytrail
Whiskey Cove PMIC.Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi -
The USB cable state can change during suspend/resume
so be sure to check and update the extcon state.Signed-off-by: Roger Quadros
Signed-off-by: Chanwoo Choi -
We must check for ID/VBUS changes during resume irrespective
of whether our device wakeup is enabled or not.Without this we seem to be missing ID/VBUS events after
system suspend/resume.Signed-off-by: Roger Quadros
Signed-off-by: Chanwoo Choi -
Whether the USB port as a wakeup source should be determined by user,
but not enabled by default.Signed-off-by: Peter Chen
Signed-off-by: Chanwoo Choi -
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
Signed-off-by: Chanwoo Choi
04 Apr, 2017
1 commit
-
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
Signed-off-by: Chanwoo Choi
Tested-by: Hans de Goede
Acked-by: Hans de Goede
27 Mar, 2017
1 commit
-
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
Signed-off-by: Chanwoo Choi
22 Mar, 2017
5 commits
-
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 -22Signed-off-by: Hans de Goede
Reviewed-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi -
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
Reviewed-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi -
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
Signed-off-by: Chanwoo Choi -
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
Signed-off-by: Chanwoo Choi -
Update GPIO pin names in extcon-intel-int3496.c driver to follow
the existing extcon binding.Signed-off-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi
13 Mar, 2017
1 commit
-
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
Signed-off-by: Chanwoo Choi
28 Feb, 2017
1 commit
-
Fix typos and add the following to the scripts/spelling.txt:
swithc||switch
swithced||switched
swithcing||switchingLink: http://lkml.kernel.org/r/1481573103-11329-3-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jan, 2017
1 commit
-
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
Signed-off-by: Chanwoo Choi
09 Jan, 2017
2 commits
-
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
-
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