This patch changes internal hardware DP_CON/DM_CON switch according to
cable type. The SM5502 MUIC device can set hardware switch as following:
- OPEN (not connected state) / USB / UART / AUDIO
Also, this patch set VBUSIN switch according to cable type.
Signed-off-by: Chanwoo Choi <[email protected]>
This patch detect whether cable is connected or not and the cable type
after completing kernel/platform booting using system_power_efficient_wq.
Signed-off-by: Chanwoo Choi <[email protected]>
This patch add new SM5502 MUIC(Micro-USB Interface Controller) device by using
EXTCON subsystem. The extcon-sm5502 driver is capable of identifying the type
of the external power source and attached accessory. An external power sources,
such as Deticated Charger or a standard USB port, are able to charge the battery
in the smart phone via the connector.
Signed-off-by: Chanwoo Choi <[email protected]>
Previously we would do a regulator get against the main Arizona device
to obtain the MICVDD regulator. Arizona is an MFD device and normally
MICVDD will be supplied by one of its children (the arizona-micsupp
regulator). As devres destruction for the MFD device will run after all
its children have been destroyed, the regulator will be destroyed before
devres calls regulator_put. This causes a warning from both the
destruction of the child node, as the regulator is still open, and from
the put of the regulator as the regulator device has already been
destroyed.
A simple fix here is to get the regulator against the extcon device
itself such that devres runs when the child is destroyed. This has the
additional benefit that if for some reason the extcon driver is unloaded
the regulator reference won't hang around until the MFD is unloaded.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message. The following
checkpatch warning is also removed.
WARNING: Possible unnecessary 'out of memory' message
Signed-off-by: Jingoo Han <[email protected]>
[Acked by Charles Keepax for arizona part]
Acked-by: Charles Keepax <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
This patch modifies mfd driver to use regmap for handling interrupts.
It allows to simplify irq handling process. This modifications needed
to make small changes in function drivers, which use interrupts.
Signed-off-by: Robert Baldyga <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
This patch removes wrapper functions used to access regmap, and
make driver using regmap_*() functions instead.
Signed-off-by: Robert Baldyga <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Mark Brown <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
The higher levels of impedance have a higher minimum value than the
first level. As the same value was used for all levels, higher impedances
were reported with a very low level of accuracy. This patch applies the
approriate lower threshold for each level, whilst we are changing things
add a define for the maximum value at each level to improve readability.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
We can use the bypass mode on the MICVDD reg for button detection, as
the comment in the code states, however the code was mistakenly
disabling bypass. This patch corrects this and allows bypass mode during
button detection.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use extcon cable API instead of state API as it is much more
idiomatic.
Signed-off-by: Nikesh Oswal <[email protected]>
Signed-off-by: Charles Keepax <[email protected]>
[Modify patch title by Chanwoo Choi]
Signed-off-by: Chanwoo Choi <[email protected]>
devm_input_allocate_device already sets the parent device to be that
passed to it, we also set this manually in arizona_extcon_probe. This
patch removes the redundant set from arizona_extcon_probe.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Array of struct of_device_id may be be const as expected by
of_match_table field.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: Graeme Gregory <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Add config option for inverted jack detect switch that
opens when jack is inserted.
Signed-off-by: Richard Fitzgerald <[email protected]>
[Acked by Lee Jones for MFD part]
Acked-by: Lee Jones <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
This patch use devm_extcon_dev_allocate() to simplify the memory control
of extcon device.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch use devm_extcon_dev_allocate() to simplify the memory control
of extcon device.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch use devm_extcon_dev_allocate() to simplify the memory control
of extcon device.
Cc: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch use devm_extcon_dev_allocate() to simplify the memory control
of extcon device.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch use devm_extcon_dev_allocate() to simplify the memory control
of extcon device.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch add device managed devm_extcon_dev_{allocate,free} to automatically
free the memory of extcon_dev structure without handling free operation.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
This patch add APIs to control the extcon device on extcon provider driver.
The extcon_dev_allocate() allocates the memory of extcon device and initializes
supported cables. And then extcon_dev_free() decrement the reference of the
device of extcon device and free the memory of the extcon device. This APIs
must need to implement devm_extcon_dev_allocate()/free() APIs.
Signed-off-by: Chanwoo Choi <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.
Signed-off-by: Sangjung Woo <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Add resource-managed extcon device register function for convenience.
For example, if a extcon device is attached with new
devm_extcon_dev_register(), that extcon device is automatically
unregistered on driver detach.
Signed-off-by: Sangjung Woo <[email protected]>
[Fix bug about devm_extcon_dev_match/release() and code clean by Chanwoo Choi]
Signed-off-by: Chanwoo Choi <[email protected]>
The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe
in both situations.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
In probe the driver queued delayed work for cable detection and
returned the result of queue_delayed_work() call. However the return
value of queue_delayed_work() does not indicate an error and in normal
condition it returns true which means successful work queue.
This effectively resulted in probe failure:
[ 2.088204] max14577-muic: probe of max77836-muic failed with error 1
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: <[email protected]>
Fixes: 962e56bfcf ("extcon: max14577: Add extcon-max14577 driver...")
Signed-off-by: Chanwoo Choi <[email protected]>
Schedule delayed cable detection work on power efficient workqueue
so the scheduler won't wake up idle core for that work.
This extends the idle time for CPU cores and conserves power.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Schedule delayed cable detection work on power efficient workqueue
so the scheduler won't wake up idle core for that work.
This extends the idle time for CPU cores and conserves power.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Fix NULL pointer exception when platform data is not supplied. The
driver dereferenced pdata pointer where it could be NULL.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: <[email protected]>
Fixes: 810d601f07
Signed-off-by: Chanwoo Choi <[email protected]>
Add support for MAX77836 chipset to the max14577 extcon driver. The
MAX77836 MUIC has additional interrupts (VIDRM, ADC1K) so IRQ handling
is split up into two functions: max14577_parse_irq() and
max77836_parse_irq().
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Tested-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
This patch continues the preparation for adding support for max77836
device to existing max14577 driver.
During probe choose muic_irqs according to device type. Currently there
are only "max14577_muic_irqs" but later patch will add max77836
interrupts.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Tested-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Add max14577 prefix to muic_irqs array. This prepares for max77836
support in this extcon driver.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Tested-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
This patch use device name to make sysfs path according to device type:
max14577-muic
- /sys/class/extcon/max14577-muic/
max77836-muic
- /sys/class/extcon/max77836-muic/
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Tested-by: Chanwoo Choi <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
commit ca488 (extcon: of: Remove unnecessary function call by using the
name of device_node) started using node name instead of device name
to get the extcon device. This breaks dwc3-omap since it's not able to
get the extcon device anymore. Fixed it by setting edev name of
palmas to be the same as its node name.
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Reported-by: Felipe Balbi <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
This patch move simply OF helper function to extcon core and change function
name as following:
- of_extcon_get_extcon_dev() -> extcon_get_edev_by_phandle()
Signed-off-by: Chanwoo Choi <[email protected]>
Acked-by: Felipe Balbi <[email protected]>
This patch remove unnecessary function call in of_extcon_get_extcon_dev()
by using the name of device_node structure.
Signed-off-by: Chanwoo Choi <[email protected]>
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
The snd_soc_dapm_xxxx_pin all require the dapm_mutex to be held when
they are called as they edit the dirty list, however very few of the
callers do so.
This patch adds unlocked versions of all the functions replacing the
existing implementations with one that holds the lock internally. We
also fix up the places where the lock was actually held on the caller
side.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]