aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
Commit message (Collapse)AuthorAgeFilesLines
* extcon: max14526: depends on I2C to prevent build warning/errorsRandy Dunlap2025-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | Make EXTCON_MAX14526 depend on I2C to address a kconfig warning and subsequent build errors: WARNING: unmet direct dependencies detected for REGMAP_I2C Depends on [m]: I2C [=m] Selected by [y]: - EXTCON_MAX14526 [=y] && EXTCON [=y] ld: vmlinux.o: in function `max14526_driver_init': extcon-max14526.c:(.init.text+0x77b0e): undefined reference to `i2c_register_driver' ld: vmlinux.o: in function `max14526_driver_exit': extcon-max14526.c:(.exit.text+0x467c): undefined reference to `i2c_del_driver' Fixes: 145af3ddd1cd ("extcon: Add basic support for Maxim MAX14526 MUIC") Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/
* extcon: max14526: avoid defined but not used warningRandy Dunlap2025-09-081-1/+1
| | | | | | | | | | | | | | SIMPLE_PM_DEV_OPS() is deprecated according to <linux/pm.h>. Use DEFINE_SIMPLE_PM_DEV_OPS() instead. This avoids a build warning when CONFIG_PM is not enabled: drivers/extcon/extcon-max14526.c:265:12: warning: ‘max14526_resume’ defined but not used [-Wunused-function] 265 | static int max14526_resume(struct device *dev) Fixes: 145af3ddd1cd ("extcon: Add basic support for Maxim MAX14526 MUIC") Signed-off-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Add basic support for Maxim MAX14526 MUICSvyatoslav Ryhel2025-09-083-0/+315
| | | | | | | | | | | | | | The MAX14526 is designed to simplify interface requirements on portable devices by multiplexing common inputs (USB, UART, Microphone, Stereo Audio and Composite Video) on a single micro/mini USB connector. The USB input supports Hi-Speed USB and the audio/video inputs feature negative rail signal operation allowing simple DC coupled accessories. These device allow a single micro/mini USB port to support all the common interfaces on Cellular phones and portable media players over the same external lines. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Svyatoslav Ryhel <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: adc-jack: Cleanup wakeup source only if it was enabledKrzysztof Kozlowski2025-09-081-1/+2
| | | | | | | | | | | | | Driver in the probe enables wakeup source conditionally, so the cleanup path should do the same - do not release the wakeup source memory if it was not allocated. Link: https://lore.kernel.org/lkml/[email protected]/ Reported-by: Christophe JAILLET <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 78b6a991eb6c ("extcon: adc-jack: Fix wakeup source leaks on device unbind") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: qcom-spmi-misc: Fix wakeup source leaks on device unbindKrzysztof Kozlowski2025-08-261-1/+1
| | | | | | | | | | Device can be unbound, so driver must also release memory for the wakeup source. Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: fsa9480: Fix wakeup source leaks on device unbindKrzysztof Kozlowski2025-08-261-1/+1
| | | | | | | | | | Device can be unbound, so driver must also release memory for the wakeup source. Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: axp288: Fix wakeup source leaks on device unbindKrzysztof Kozlowski2025-08-261-1/+1
| | | | | | | | | | Device can be unbound, so driver must also release memory for the wakeup source. Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: adc-jack: Fix wakeup source leaks on device unbindKrzysztof Kozlowski2025-08-261-0/+1
| | | | | | | | | | | Device can be unbound, so driver must also release memory for the wakeup source. Do not use devm interface, because it would change the order of cleanup. Link: https://lore.kernel.org/lkml/[email protected]/ Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* Merge tag 'extcon-next-for-6.14' of ↵Greg Kroah-Hartman2025-01-123-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Pull extcon updates from Chanwoo: Update extcon next for v6.14 Detailed description for this pull request: - Fix null pointer check of memory allocation on extcon-rtk-type-c.c. - Add EXTCON subsystem documentation including the detailed description/example. - Drop unneeded init of struct i2c_device_id:driver_data on extcon-fsa9480/pth5150.c. * tag 'extcon-next-for-6.14' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 Documentation: extcon: add documentation for Extcon subsystem extcon: realtek: fix NULL deref check in extcon_rtk_type_c_probe
| * extcon: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König2024-12-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
| * extcon: realtek: fix NULL deref check in extcon_rtk_type_c_probeCharles Han2024-12-081-0/+2
| | | | | | | | | | | | | | | | | | | | In extcon_rtk_type_c_probe() devm_kzalloc() may return NULL but this returned value is not checked. Fixes: 8a590d7371f0 ("extcon: add Realtek DHC RTD SoC Type-C driver") Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Charles Han <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* | Get rid of 'remove_new' relic from platform driver structLinus Torvalds2024-12-018-8/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | The continual trickle of small conversion patches is grating on me, and is really not helping. Just get rid of the 'remove_new' member function, which is just an alias for the plain 'remove', and had a comment to that effect: /* * .remove_new() is a relic from a prototype conversion of .remove(). * New drivers are supposed to implement .remove(). Once all drivers are * converted to not use .remove_new any more, it will be dropped. */ This was just a tree-wide 'sed' script that replaced '.remove_new' with '.remove', with some care taken to turn a subsequent tab into two tabs to make things line up. I did do some minimal manual whitespace adjustment for places that used spaces to line things up. Then I just removed the old (sic) .remove_new member function, and this is the end result. No more unnecessary conversion noise. Signed-off-by: Linus Torvalds <[email protected]>
* Merge tag 'char-misc-6.12-rc1' of ↵Linus Torvalds2024-09-263-0/+507
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc driver updates from Greg KH: "Here is the "big" set of char/misc and other driver subsystem changes for 6.12-rc1. Lots of changes in here, primarily dominated by the usual IIO driver updates and additions, but there are also small driver subsystem updates all over the place. Included in here are: - lots and lots of new IIO drivers and updates to existing ones - interconnect subsystem updates and new drivers - nvmem subsystem updates and new drivers - mhi driver updates - power supply subsystem updates - kobj_type const work for many different small subsystems - comedi driver fix - coresight subsystem and driver updates - fpga subsystem improvements - slimbus fixups - binder new feature addition for "frozen" notifications - lots and lots of other small driver updates and cleanups All of these have been in linux-next for a long time with no reported problems" * tag 'char-misc-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (354 commits) greybus: gb-beagleplay: Add firmware upload API arm64: dts: ti: k3-am625-beagleplay: Add bootloader-backdoor-gpios to cc1352p7 dt-bindings: net: ti,cc1352p7: Add bootloader-backdoor-gpios MAINTAINERS: Update path for U-Boot environment variables YAML nvmem: layouts: add U-Boot env layout comedi: ni_routing: tools: Check when the file could not be opened ocxl: Remove the unused declarations in headr file hpet: Fix the wrong format specifier uio: Constify struct kobj_type cxl: Constify struct kobj_type binder: modify the comment for binder_proc_unlock iio: adc: axp20x_adc: add support for AXP717 ADC dt-bindings: iio: adc: Add AXP717 compatible iio: adc: axp20x_adc: Add adc_en1 and adc_en2 to axp_data w1: ds2482: Drop explicit initialization of struct i2c_device_id::driver_data to 0 tools: iio: rm .*.cmd when make clean iio: adc: standardize on formatting for id match tables iio: proximity: aw96103: Add support for aw96103/aw96105 proximity sensor bus: mhi: host: pci_generic: Enable EDL trigger for Foxconn modems bus: mhi: host: pci_generic: Update EDL firmware path for Foxconn modems ...
| * extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPEStephen Rothwell2024-09-041-10/+5
| | | | | | | | | | | | | | | | | | | | | | commit 364ea7ccaef9("power: supply: Change usb_types from an array into a bitmask") changes usb_types from an array into a bitmask. Fix the build error of usb_types variables. Link: https://lore.kernel.org/lkml/[email protected]/ Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
| * Merge tag 'ib-psy-usb-types-signed' of ↵Chanwoo Choi2024-09-041-10/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply into extcon-next Immutable branch for usb_types change for v6.12 Changing usb_types type from array to bitmap in the power_supply_desc struct requires updating power-supply drivers living in different subsystem, so it is handled via an immutable branch.
| * | extcon: Add LC824206XA microUSB switch driverHans de Goede2024-09-043-0/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new driver for the ON Semiconductor LC824206XA microUSB switch and accessory detector chip. ON Semiconductor has an "Advance Information" datasheet available (ENA2222-D.PDF), but no full datasheet. So there is no documentation available for the registers. This driver is based on the register info from the extcon-fsa9285.c driver, from the Lollipop Android sources for the Lenovo Yoga Tablet 2 (Pro) 830 / 1050 / 1380 models. Note despite the name this is actually a driver for the LC824206XA not the FSA9285. This has only been tested on a Lenovo Yoga Tablet 2 Pro 1380 and using the driver on other setups may require additional work. So far this driver is only used on x86/ACPI (non devicetree) devs. Therefor there is no devicetree bindings documentation for this driver's "onnn,enable-miclr-for-dcp" property since this is not used in actual devicetree files and the dt bindings maintainers have requested properties with no actual dt users to _not_ be added to the dt bindings. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* | | Merge tag 'for-v6.12' of ↵Linus Torvalds2024-09-181-10/+5
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - introduce power_supply_show_enum_with_available() helper - change usb_types from an array into a bitmask - fix early usage of power_supply_property_is_writeable() resulting in sysfs files not being writable - fix missing temp1_max_alarm attribute in power-supply's hwmon devices Drivers: - max1720x: expose nvmem device - brcmstb: cleanup driver to use latest APIs - max77693: expose input and charging current limit - max17042_battery: fix state of charge reading for devices without current sensing - axp20x_battery: add AXP717 support - axp20x_battery: fix min/max voltage properties - axp20x_usb_power: add AXP717 support - axp20x_usb_power: add DT based input current limit Documentation updates Misc minor cleanups and fixes" * tag 'for-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (38 commits) power: supply: hwmon: Fix missing temp1_max_alarm attribute power: supply: Drop use_cnt check from power_supply_property_is_writeable() power: supply: ab8500: Constify struct kobj_type power: supply: max1720x: fix a double free on error in probe() power: supply: axp20x_battery: add support for AXP717 power: supply: axp20x_usb_power: Add support for AXP717 dt-bindings: power: supply: axp20x: Add AXP717 compatible dt-bindings: power: supply: axp20x: Add AXP717 compatible power: supply: axp20x_usb_power: Fix spelling mistake "reqested" -> "requested" power: supply: Change usb_types from an array into a bitmask power: supply: sysfs: Move power_supply_show_enum_with_available() up power: supply: sysfs: Add power_supply_show_enum_with_available() helper power: supply: rt9467-charger: Remove "usb_type" property write support power: supply: ucs1002: Adjust ucs1002_set_usb_type() to accept string values power: supply: "usb_type" property may be written to power: supply: max1720x: add read support for nvmem mfd: axp20x: Add ADC, BAT, and USB cells for AXP717 power: supply: core: constify psy_tzd_ops power: reset: brcmstb: Do not go into infinite loop if reset fails power: reset: brcmstb: Use devm_register_sys_off_handler() ...
| * | power: supply: Change usb_types from an array into a bitmaskHans de Goede2024-09-031-10/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bit_types array just hold a list of valid enum power_supply_usb_type values which map to 0 - 9. This can easily be represented as a bitmap. This reduces the size of struct power_supply_desc and further reduces the data section size by drivers no longer needing to store the array. This also unifies how usb_types are handled with charge_behaviours, which allows power_supply_show_usb_type() to be removed. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
* / extcon: axp288: Switch to new Intel CPU model definesTony Luck2024-09-041-1/+1
|/ | | | | | | | | New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* extcon: adc-jack: Document missing struct membersYang Li2024-05-081-0/+2
| | | | | | | | | | This patch adds kernel-doc comments for the previously undocumented members `dev` and `wakeup_source` in the struct adc_jack_data in adc-jack device driver. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Yang Li <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: realtek: Remove unused of_gpio.hAndy Shevchenko2024-05-081-1/+0
| | | | | | | | | of_gpio.h is deprecated and subject to remove. The driver doesn't use it, simply remove the unused header. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: usbc-cros-ec: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/52d0a4317d5372f1135259d4fbbd2822b86ba8f4.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: usb-gpio: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/8914cd71b32e1f6298e65b84fb84370c73b4fe37.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: max77843: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/30097beba928bf2073645f85d21fb9c1aee64991.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: max3355: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/2c017ea490f721646bd472e7d427eb377e4e8423.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: intel-mrfld: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/7223e19152980ef553e38cf56c2b38ec099586e0.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: intel-cht-wc: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/lkml/87f0b8f158565cb9ea68b42db2bb018f82a7ee27.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: adc-jack: Convert to platform remove callback returning voidUwe Kleine-König2024-05-081-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. LinkL: https://lore.kernel.org/lkml/14d30788ecd288b1b0983a8ea224499bbaa5de19.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: intel-mrfld: Don't shadow error from devm_extcon_dev_allocate()Andy Shevchenko2024-05-081-1/+1
| | | | | | | | Don't shadow error from devm_extcon_dev_allocate() and return it as is. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: max8997: select IRQ_DOMAIN instead of depending on itRandy Dunlap2024-05-081-1/+2
| | | | | | | | | | | | | | | | | | | IRQ_DOMAIN is a hidden (not user visible) symbol. Users cannot set it directly thru "make *config", so drivers should select it instead of depending on it if they need it. Relying on it being set for a dependency is risky. Consistently using "select" or "depends on" can also help reduce Kconfig circular dependency issues. Therefore, change EXTCON_MAX8997's use of "depends on" for IRQ_DOMAIN to "select". Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: dca1a71e4108 ("extcon: Add support irq domain for MAX8997 muic") Signed-off-by: Randy Dunlap <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: intel-mrfld: Switch to use dev_err_probe()Andy Shevchenko2024-05-081-12/+6
| | | | | | | | | | Switch to use dev_err_probe() to simplify the error path and unify a message template. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: MyungJoo Ham <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: qcom-spmi-misc: don't use kernel-doc marker for commentRandy Dunlap2023-12-121-1/+1
| | | | | | | | | | | Do not use "/**" for non-kernel-doc comments. This prevents a warning from scripts/kernel-doc: warning: expecting prototype for extcon(). Prototype was for USB_ID_DEBOUNCE_MS() instead Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: usbc-tusb320: Set interrupt polarity based on device-treeLukas Funke2023-12-051-1/+8
| | | | | | | | | | | | Remove 'IRQF_TRIGGER_FALLING' request which is not allowed on every interrupt controller (i.e. arm64 GIC). Replace flag by a request that depends on the actual device-tree setting. Link: https://lore.kernel.org/all/[email protected]/ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Lukas Funke <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: fix possible name leak in extcon_dev_register()Yaxiong Tian2023-12-041-2/+1
| | | | | | | | | | In the error path after calling dev_set_name(), the device name is leaked. To fix this, moving dev_set_name() after the error path and before device_register. Link: https://lore.kernel.org/lkml/TYZPR01MB4784ADCD3E951E0863F3DB72D5B8A@TYZPR01MB4784.apcprd01.prod.exchangelabs.com/ Signed-off-by: Yaxiong Tian <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: realtek: add the error handler for nvmem_cell_readStanley Chang2023-10-171-36/+38
| | | | | | | | | | | | | | | | There are following smatch warning: drivers/extcon/extcon-rtk-type-c.c:905 __updated_type_c_parameter_by_efuse() error: 'buf' dereferencing possible ERR_PTR() The nvmem_cell_read may fail to read. So, driver must handle failure cases. Link: https://lore.kernel.org/all/[email protected]/ Fixes: 8a590d7371f0 ("extcon: add Realtek DHC RTD SoC Type-C driver") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Stanley Chang <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: max77843: add device-tree compatible stringMarek Szyprowski2023-10-061-0/+7
| | | | | | | | | | | | Add the needed device-tree compatible string to the MAX77843 extcon driver, so it can be automatically loaded when compiled as a kernel module and given device-tree contains separate 'muic' node under the main MAX77843 PMIC node. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: max77693: add device-tree compatible stringMarek Szyprowski2023-10-061-0/+7
| | | | | | | | | | | | | | | | | Commit 57f706bf7307 ("ARM: dts: samsung: exynos4412-midas: add USB connector and USB OTG") added a 'muic' node to the MAX77693 PMIC definition in various device-tree files. Since that commit, the newly created MFD cell gained its own of_node and compatible string. This changed its modalias, what in turn broke automated loading of the driver module, because the new modalias is based on the of_node compatible string, not the platform device name. Fix this by adding the needed device-tree compatible string. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: add Realtek DHC RTD SoC Type-C driverStanley Chang2023-10-063-0/+1804
| | | | | | | | | | | This patch adds the extcon driver for Realtek DHC (digital home center) RTD SoCs type-c module. This can be used to detect whether the port is configured as a downstream or upstream facing port. And notify the status of extcon to listeners. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Stanley Chang <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: cht_wc: add POWER_SUPPLY dependencyArnd Bergmann2023-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | The driver fails to link when CONFIG_POWER_SUPPLY is disabled: x86_64-linux-ld: vmlinux.o: in function `cht_wc_extcon_psy_get_prop': extcon-intel-cht-wc.c:(.text+0x15ccda7): undefined reference to `power_supply_get_drvdata' x86_64-linux-ld: vmlinux.o: in function `cht_wc_extcon_pwrsrc_event': extcon-intel-cht-wc.c:(.text+0x15cd3e9): undefined reference to `power_supply_changed' x86_64-linux-ld: vmlinux.o: in function `cht_wc_extcon_probe': extcon-intel-cht-wc.c:(.text+0x15cd596): undefined reference to `devm_power_supply_register' It should be possible to change the driver to not require this at compile time and still provide other functions, but adding a hard Kconfig dependency does not seem to have any practical downsides and is simpler since the option is normally enabled anyway. Fixes: 66e31186cd2aa ("extcon: intel-cht-wc: Add support for registering a power_supply class-device") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-06-015-5/+5
| | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Drop unneeded assignmentsAndy Shevchenko2023-05-291-3/+3
| | | | | | | | | In one case the assignment is duplicative, in the other, it's better to move it into the loop — the user of it. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Chanwoo Choi <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use sizeof(*pointer) instead of sizeof(type)Andy Shevchenko2023-05-291-8/+5
| | | | | | | | | It is preferred to use sizeof(*pointer) instead of sizeof(type). The type of the variable can change and one needs not change the former (unlike the latter). No functional change intended. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use unique number for the extcon device IDAndy Shevchenko2023-05-292-3/+15
| | | | | | | | | | | | The use of atomic variable is still racy when we do not control which device has been unregistered and there is a (theoretical) possibility of the overflow that may cause a duplicate extcon device ID number to be allocated next time a device is registered. Replace above mentioned approach by using IDA framework. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Remove dup device name in the message and unneeded error checkAndy Shevchenko2023-05-291-3/+2
| | | | | | | | | The device name is already printed with dev_err(), no need to repeat. The device pointer itself is not supposed to be an error point, drop that check. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use dev_of_node(dev) instead of dev->of_nodeAndy Shevchenko2023-05-291-8/+4
| | | | | | | | | The dev_of_node function should be preferred. In the result we may drop unneeded NULL check of the pointer to the device object. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use device_match_of_node() helperAndy Shevchenko2023-05-291-1/+1
| | | | | | | Instead of open coding, use device_match_of_node() helper. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Amend kernel documentation of struct extcon_devAndy Shevchenko2023-05-291-3/+3
| | | | | | | | | First of all, the @lock description is missing. Add it. Second, correct the terminator value for the mutual exclusive cabling. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use sysfs_emit() to instead of sprintf()Andy Shevchenko2023-05-291-9/+9
| | | | | | | | | Follow the advice of the Documentation/filesystems/sysfs.rst that show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Use DECLARE_BITMAP() to declare bit arraysAndy Shevchenko2023-05-291-4/+4
| | | | | | | | Bit arrays has a specific type helper for the declaration. Use it instead of homegronw equivalent. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
* extcon: Fix kernel doc of property capability fields to avoid warningsAndy Shevchenko2023-05-291-0/+4
| | | | | | | | | | | | | | | | Kernel documentation has to be synchronized with a code, otherwise the validator is not happy: Function parameter or member 'usb_bits' not described in 'extcon_cable' Function parameter or member 'chg_bits' not described in 'extcon_cable' Function parameter or member 'jack_bits' not described in 'extcon_cable' Function parameter or member 'disp_bits' not described in 'extcon_cable' Describe the fields added in the past. Fixes: ceaa98f442cf ("extcon: Add the support for the capability of each property") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>