29 May, 2020
4 commits
-
When arizona_request_irq() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced. For error paths after
this function, things are the same.Also, remove calls to pm_runtime_disable() when
pm_runtime_enable() has not been executed.Signed-off-by: Dinghao Liu
Signed-off-by: Chanwoo Choi -
Add device tree compatible strings and create proper modalias structures
to let this driver load automatically if compiled as module, because
max14577 MFD driver creates MFD cells with such compatible strings.Signed-off-by: Marek Szyprowski
Signed-off-by: Chanwoo Choi -
In some error handling paths, a call to 'iio_channel_get()' is not balanced
by a corresponding call to 'iio_channel_release()'.This can be achieved easily by using the devm_ variant of
'iio_channel_get()'.This has the extra benefit to simplify the remove function.
Fixes: 19939860dcae ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices")
Signed-off-by: Christophe JAILLET
Signed-off-by: Chanwoo Choi -
The variable idx is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King
Signed-off-by: Chanwoo Choi
04 Apr, 2020
1 commit
-
Pull char/misc driver updates from Greg KH:
"Here is the big set of char/misc/other driver patches for 5.7-rc1.Lots of things in here, and it's later than expected due to some
reverts to resolve some reported issues. All is now clean with no
reported problems in linux-next.Included in here is:
- interconnect updates
- mei driver updates
- uio updates
- nvmem driver updates
- soundwire updates
- binderfs updates
- coresight updates
- habanalabs updates
- mhi new bus type and core
- extcon driver updates
- some Kconfig cleanups
- other small misc driver cleanups and updatesAs mentioned, all have been in linux-next for a while, and with the
last two reverts, all is calm and good"* tag 'char-misc-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (174 commits)
Revert "driver core: platform: Initialize dma_parms for platform devices"
Revert "amba: Initialize dma_parms for amba devices"
amba: Initialize dma_parms for amba devices
driver core: platform: Initialize dma_parms for platform devices
bus: mhi: core: Drop the references to mhi_dev in mhi_destroy_device()
bus: mhi: core: Initialize bhie field in mhi_cntrl for RDDM capture
bus: mhi: core: Add support for reading MHI info from device
misc: rtsx: set correct pcr_ops for rts522A
speakup: misc: Use dynamic minor numbers for speakup devices
mei: me: add cedar fork device ids
coresight: do not use the BIT() macro in the UAPI header
Documentation: provide IBM contacts for embargoed hardware
nvmem: core: remove nvmem_sysfs_get_groups()
nvmem: core: use is_bin_visible for permissions
nvmem: core: use device_register and device_unregister
nvmem: core: add root_only member to nvmem device struct
extcon: axp288: Add wakeup support
extcon: Mark extcon_get_edev_name() function as exported symbol
extcon: palmas: Hide error messages if gpio returns -EPROBE_DEFER
dt-bindings: extcon: usbc-cros-ec: convert extcon-usbc-cros-ec.txt to yaml format
...
25 Mar, 2020
4 commits
-
On devices with an AXP288, we need to wakeup from suspend when a charger
is plugged in, so that we can do charger-type detection and so that the
axp288-charger driver, which listens for our extcon events, can configure
the input-current-limit accordingly.Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede
Signed-off-by: Chanwoo Choi -
extcon_get_edev_name() function provides client driver to request
extcon dev's name. If extcon driver and client driver are compiled
as loadable modules, extcon_get_edev_name() function symbol is not
visible to client driver. Hence mark extcon_find_edev_name() function
as exported symbol.Signed-off-by: Mayank Rana
Signed-off-by: Chanwoo Choi -
If the gpios are probed after this driver (e.g. if they
come from an i2c expander) there is no need to print an
error message.Signed-off-by: H. Nikolaus Schaller
Signed-off-by: Chanwoo Choi -
The new macro set has a consistent namespace and uses C99 initializers
instead of the grufty C89 ones.Signed-off-by: Thomas Gleixner
Signed-off-by: Borislav Petkov
Reviewed-by: Greg Kroah-Hartman
Link: https://lkml.kernel.org/r/20200320131510.075227793@linutronix.de
16 Dec, 2019
1 commit
-
Remove unneeded semicolon reported by coccinelle.
Signed-off-by: Xu Wang
[cw00.choi: Edit patch title and description]
Signed-off-by: Chanwoo Choi
09 Dec, 2019
10 commits
-
Continue refactoring the microphone detect handling by factoring
out the handling for microphone detection and button detection
into separate functions. This both makes the code a little clearer
and prepares for some planned future refactoring to make the state
handling in the driver more explicit.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
The microphone detection handler is very long, start breaking it up
by factoring out the actual reading of the impedance value into a
separate functions. Additionally, this also fixes a minor bug and
ensures that the microphone timeout will be rescheduled in all error
cases.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
Invert the check of hpdet_acc_id at the top of arizona_hpdet_do_id to
reduce the identation within the function.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
A WARN_ON is very strong for simply finding a button that is out of
range, downgrade this to a simple error message in the log.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
arizona_start_mic sets ACCDET_MODE as required for the microphone
detection as such it is redundant to set this outside of this function.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
Moving from microphone detection to headphone detection is done fairly
haphazardly at the moment, sometimes calling arizona_stop_mic at the
call site sometimes relying on a call inside arizona_identify_headphone.
Simplify all this and always call arizona_stop_mic at the top of
arizona_identify_headphone.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
It makes sense to clear the internal state of the jack detection
regardless of if the headphone detect based accessory detection or
the normal microphone detect based flow is used.No issues are currently known because of this but the change makes
more logical sense and eases future refactoring of the code.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
It makes no sense to be extracting values from pdata for the first time
in the jack detection handler function, move this to probe time where it
belongs.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
The special register sequences that are applied for rev A of wm5102
should be applied atomically with respect to any other register writes.
Use regmap_multi_reg_write to ensure all writes happen under the regmap
lock.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi -
In the error path of arizona_identify_headphone, neither the clamp nor
the PM runtime are cleaned up. Add calls to clean up both of these.Signed-off-by: Charles Keepax
Signed-off-by: Chanwoo Choi
28 Nov, 2019
1 commit
-
Pull char/misc driver updates from Greg KH:
"Here is the big set of char/misc and other driver patches for 5.5-rc1Loads of different things in here, this feels like the catch-all of
driver subsystems these days. Full details are in the shortlog, but
nothing major overall, just lots of driver updates and additions.All of these have been in linux-next for a while with no reported
issues"* tag 'char-misc-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (198 commits)
char: Fix Kconfig indentation, continued
habanalabs: add more protection of device during reset
habanalabs: flush EQ workers in hard reset
habanalabs: make the reset code more consistent
habanalabs: expose reset counters via existing INFO IOCTL
habanalabs: make code more concise
habanalabs: use defines for F/W files
habanalabs: remove prints on successful device initialization
habanalabs: remove unnecessary checks
habanalabs: invalidate MMU cache only once
habanalabs: skip VA block list update in reset flow
habanalabs: optimize MMU unmap
habanalabs: prevent read/write from/to the device during hard reset
habanalabs: split MMU properties to PCI/DRAM
habanalabs: re-factor MMU masks and documentation
habanalabs: type specific MMU cache invalidation
habanalabs: re-factor memory module code
habanalabs: export uapi defines to user-space
habanalabs: don't print error when queues are full
habanalabs: increase max jobs number to 512
...
04 Nov, 2019
1 commit
-
Getting handle to the USB role switch by first finding its
software fwnode.Signed-off-by: Heikki Krogerus
Reviewed-by: Hans de Goede
Tested-by: Hans de Goede
Link: https://lore.kernel.org/r/20191008122600.22340-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman
31 Oct, 2019
1 commit
-
The variable cable_type is being initialized with a value that
is never read and is being re-assigned a little later on. The
assignment is redundant and hence can be removed.Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King
Signed-off-by: Chanwoo Choi
11 Oct, 2019
1 commit
-
On some devices (e.g. Samsung Galaxy A5 (2015)), the bootloader
seems to keep interrupts enabled for SM5502 when booting Linux.
Changing the cable state (i.e. plugging in a cable) - until the driver
is loaded - will therefore produce an interrupt that is never read.In this situation, the cable state will be stuck forever on the
initial state because SM5502 stops sending interrupts.
This can be avoided by clearing those pending interrupts after
the driver has been loaded.One way to do this is to reset all registers to default state
by writing to SM5502_REG_RESET. This ensures that we start from
a clean state, with all interrupts disabled.Suggested-by: Chanwoo Choi
Signed-off-by: Stephan Gerhold
Signed-off-by: Chanwoo Choi
01 Oct, 2019
1 commit
-
Intel Cherry Trail Whiskey Cove extcon driver connect USB data lines to
PMIC at driver probing for further charger detection. This causes reset of
USB data sessions and removing all devices from bus. If system was
booted from Live CD or USB dongle, this makes system unusable.Check if USB ID pin is floating and re-route data lines in this case
only, don't touch otherwise.Reviewed-by: Hans de Goede
Reviewed-by: Andy Shevchenko
Signed-off-by: Yauhen Kharuzhy
[cw00.choi: Clean-up the minor coding style]
Signed-off-by: Chanwoo Choi
20 Sep, 2019
1 commit
-
…ernel/git/chrome-platform/linux
Pull chrome platform updates from Benson Leung:
"CrOS EC / MFD Migration:
- Move cros_ec core driver from mfd into chrome platform.Wilco EC:
- Add batt_ppid_info command to Wilco telemetry driver.CrOS EC:
- cros_ec_rpmsg : Add support to inform EC of suspend/resume status
- cros_ec_rpmsg : Fix race condition on probe failed
- cros_ec_chardev : Add a poll handler to receive MKBP eventsMisc:
- bugfixes in cros_usbpd_logger and cros_ec_ishtp"* tag 'tag-chrome-platform-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
platform/chrome: cros_usbpd_logger: null check create_singlethread_workqueue
platform/chrome: cros_ec_chardev: Add a poll handler to receive MKBP events
platform/chrome: cros_ec_rpmsg: Fix race with host command when probe failed
platform/chrome: chromeos_tbmc: Report wake events
mfd: cros_ec: Use mfd_add_hotplug_devices() helper
mfd: cros_ec: Add convenience struct to define autodetectable CrOS EC subdevices
mfd: cros_ec: Add convenience struct to define dedicated CrOS EC MCUs
mfd: cros_ec: Use kzalloc and cros_ec_cmd_xfer_status helper
mfd / platform: cros_ec: Reorganize platform and mfd includes
mfd / platform: cros_ec: Rename config to a better name
mfd: cros_ec: Switch to use the new cros-ec-chardev driver
mfd / platform: cros_ec: Miscellaneous character device to talk with the EC
mfd / platform: cros_ec: Move cros-ec core driver out from MFD
mfd / platform: cros_ec: Handle chained ECs as platform devices
platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
platform/chrome: chromeos_laptop: drop checks of NULL-safe functions
platform/chrome: wilco_ec: Add batt_ppid_info command to telemetry driver
02 Sep, 2019
2 commits
-
There is a bit of mess between cros-ec mfd includes and platform
includes. For example, we have a linux/mfd/cros_ec.h include that
exports the interface implemented in platform/chrome/cros_ec_proto.c. Or
we have a linux/mfd/cros_ec_commands.h file that is non related to the
multifunction device (in the sense that is not exporting any function of
the mfd device). This causes crossed includes between mfd and
platform/chrome subsystems and makes the code difficult to read, apart
from creating 'curious' situations where a platform/chrome driver includes
a linux/mfd/cros_ec.h file just to get the exported functions that are
implemented in another platform/chrome driver.In order to have a better separation on what the cros-ec multifunction
driver does and what the cros-ec core provides move and rework the
affected includes doing:- Move cros_ec_commands.h to include/linux/platform_data/cros_ec_commands.h
- Get rid of the parts that are implemented in the platform/chrome/cros_ec_proto.c
driver from include/linux/mfd/cros_ec.h to a new file
include/linux/platform_data/cros_ec_proto.h
- Update all the drivers with the new includes, so
- Drivers that only need to know about the protocol include
- linux/platform_data/cros_ec_proto.h
- linux/platform_data/cros_ec_commands.h
- Drivers that need to know about the cros-ec mfd device also include
- linux/mfd/cros_ec.hSigned-off-by: Enric Balletbo i Serra
Acked-by: Andy Shevchenko
Acked-by: Mark Brown
Acked-by: Wolfram Sang
Acked-by: Neil Armstrong
Acked-by: Alexandre Belloni
Acked-by: Jonathan Cameron
Acked-by: Benjamin Tissoires
Acked-by: Dmitry Torokhov
Acked-by: Sebastian Reichel
Acked-by: Chanwoo Choi
Reviewed-by: Gwendal Grignou
Tested-by: Gwendal Grignou
Series changes: 3
- Fix dereferencing pointer to incomplete type 'struct cros_ec_dev' (lkp)
Signed-off-by: Lee Jones -
Now, the ChromeOS EC core driver has nothing related to an MFD device, so
move that driver from the MFD subsystem to the platform/chrome subsystem.Signed-off-by: Enric Balletbo i Serra
Acked-by: Andy Shevchenko
Acked-by: Thierry Reding
Acked-by: Mark Brown
Acked-by: Wolfram Sang
Acked-by: Neil Armstrong
Acked-by: Alexandre Belloni
Acked-by: Jonathan Cameron
Acked-by: Benjamin Tissoires
Acked-by: Dmitry Torokhov
Acked-by: Sebastian Reichel
Acked-by: Chanwoo Choi
Reviewed-by: Gwendal Grignou
Tested-by: Gwendal Grignou
Signed-off-by: Lee Jones
31 Jul, 2019
1 commit
-
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.Signed-off-by: Stephen Boyd
[cw00.choi: Edit patch title and description for readability]
Signed-off-by: Chanwoo Choi
29 Jul, 2019
2 commits
-
This simplifies and standardizes axp288_extcon_log_rsi()
by using for_each_set_bit() library function.Signed-off-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi -
It seems from the very beginning the error check has been missed
in axp288_extcon_log_rsi(). Add it here.Signed-off-by: Andy Shevchenko
Signed-off-by: Chanwoo Choi
24 Jul, 2019
5 commits
-
Do not fire irq again until thread done
Signed-off-by: Vasyl Gomonovych
Signed-off-by: Chanwoo Choi -
The only thing that makes sense is to request a falling edge interrupt
if the line is active low and a rising edge interrupt if the line is
active high, so just do that and get rid of the assignment from
platform data. The GPIO descriptor knows if the line is active high
or low.Also make irq a local variable in probe(), it's not used anywhere else.
Signed-off-by: Linus Walleij
[cw00.choi: Fix build error of data->irq_flags]
Signed-off-by: Chanwoo Choi -
The older compatible variant of this chip is called FSA880
and works the same way, if we need some quirks in the future,
it is good to let it have its own compatible string.Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij
Signed-off-by: Chanwoo Choi -
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.Signed-off-by: Wolfram Sang
Signed-off-by: Chanwoo Choi -
Use use device_property_count_u32() directly, that makes code neater.
Signed-off-by: Andy Shevchenko
Acked-by: Charles Keepax
Signed-off-by: Chanwoo Choi
01 Jul, 2019
1 commit
-
…/chanwoo/extcon into char-misc-next
Chanwoo writes:
Update extcon for 5.3
Detailed description for this pull request:
1. Add new extcon-fsa9480 extcon provider driver
- It is extcon provide driver for Fairchild Semiconductor
FSA9480 microUSB switch and accessory detector chip which
detects the kind of external connector like usb, charger,
audio, video and so on.2.
- Add the exception handling code for extcon-arizona.c
when using the regmap interface.* tag 'extcon-next-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
extcon: fsa9480: Fix Kconfig warning and build errors
extcon: Add fsa9480 extcon driver
dt-bindings: extcon: Add support for fsa9480 switch
extcon: arizona: Correct error handling on regmap_update_bits_check
26 Jun, 2019
1 commit
-
Fix Kconfig dependency warning and subsequent build errors caused by
the Kconfig entry for EXTCON-FSA9480. It should not select
REGMAP_I2C unless I2C is already set/enabled.WARNING: unmet direct dependencies detected for REGMAP_I2C
Depends on [n]: I2C [=n]
Selected by [y]:
- EXTCON_FSA9480 [=y] && EXTCON [=y] && INPUT [=y]Signed-off-by: Randy Dunlap
[cw00.choi: adjust the patch title and remove the long warning messages]
Signed-off-by: Chanwoo Choi
22 Jun, 2019
1 commit
-
This patch adds extcon driver for Fairchild Semiconductor FSA9480
microUSB switch.Signed-off-by: Tomasz Figa
Signed-off-by: Jonathan Bakker
Signed-off-by: Paweł Chmiel
Signed-off-by: Chanwoo Choi
19 Jun, 2019
1 commit
-
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundationthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Enrico Weigelt
Reviewed-by: Kate Stewart
Reviewed-by: Allison Randal
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman