Commit Graph
100 Commits
Author SHA1 Message Date
Axel Lin bb9ad48484 platform/x86: intel-vbtn: Switch to use devm_input_allocate_device
Use devm_input_allocate_device to simplify the error handling code.
This conversion also makes input_register_device() to be called after
acpi_remove_notify_handler. This avoid a small window that it's possible
to call notify_handler after unregister input device.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
2016-12-13 09:29:01 -08:00
Axel Lin 3526ecadc8 platform/x86: Use ACPI_FAILURE at appropriate places
Use ACPI_FAILURE() to replace !ACPI_SUCCESS(), this avoid !! operations.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Henrique de Moraes Holschuh <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
2016-12-13 09:29:01 -08:00
Axel Lin 914657c2be ASoC: cs35l34: Simplify the logic to set CS35L34_MCLK_CTL setting
The logic of "value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_XXXXXX;" is
unnecessary complex. By setting CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_MASK
as the mask for regmap_update_bits() call, what the code does is exactly
the same as setting value = CS35L34_MCLK_RATE_XXXXXX.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-12-06 12:22:28 +00:00
Axel Lin 3498c5e15d regulator: twl6030: Remove unused fields from struct twlreg_info
The table_len, *table, remap and max_mV fields are not used, so remove
them.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-11-23 15:47:02 +00:00
Axel Lin 15cc95c442 regulator: twl: Remove unused fields from struct twlreg_info
The min_mV, max_mV and flags fields are not used, so remove them.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-11-23 15:46:43 +00:00
Axel Lin 6bbda2d4f8 PM / devfreq: exynos-ppmu: Remove unused mutex from struct exynos_ppmu
The mutex is not used at all, remove it.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
2016-11-17 11:31:28 +09:00
Axel Lin f8dbe363ba PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminated
The rest of the code uses ARRAY_SIZE to count the number of entries in
ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return
off-by-one value.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
2016-11-17 11:31:28 +09:00
Axel Lin f2826c1fe5 ASoC: rt5665: Use devm_gpio_request_one()
Simplify the code a bit.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-11-16 16:27:29 +00:00
Axel Lin 0c95666f0d ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrate
Reported-by: Julia Lawall <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-11-16 16:27:29 +00:00
Axel Lin b4f89a0cce ASoC: msm8916-wcd-analog: Update correct register setting for MIC BIAS Internal1
pm8916_wcd_analog_enable_micbias_int1() should set micbias1_cap_mode
rather than micbias2_cap_mode.

Also change the order of pm8916_wcd_analog_enable_micbias_int1/init2
functions for better readability.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-11-09 14:45:44 +00:00
Axel Lin 74a484ced2 clk: qcom: lcc-ipq806x: Fixup overriding val in regmap_read call
Drop the assignment of regmap_read return code to val, so the code checks
the value read.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2016-11-01 17:44:09 -07:00
Axel Lin 55060feefc ASoC: cs35l34: Remove CS35L34_CHIP_ID from cs35l34_readable_register
CS35L34_CHIP_ID is not a register address, it's the value read from
CS35L34_DEVID_AB/CD/E registers.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-10-25 20:27:50 +01:00
Axel Lin bf8e27621e regulator: rk808: Use rdev_get_id() to access id of regulator
RK808_ID_DCDC1 is 0, no need to do subtract RK808_ID_DCDC1.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-10-24 17:49:37 +01:00
Axel Lin e98d5fef85 regulator: tps6507x: Drop pointless static qualifier for *reg_data variable
There is no need to use static for this local variable.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-10-24 17:49:14 +01:00
Axel Lin fdf4332fde gpio: max77620: Remove unused fields from struct max77620_gpio
Current code does not use gpio_irq/irq_base/gpio_base fields from
struct max77620_gpio, so remove them.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Laxman Dewangan <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-10-24 16:33:11 +02:00
Axel Lin c699995663 pwm: meson: Add missing spin_lock_init()
The driver uses the spin_lock but does not initialize it. Fix it.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
2016-10-21 09:10:11 +02:00
Axel Lin 0f376c9cd8 PM / devfreq: Add proper locking around list_del()
Use devfreq_list_lock around list_del() to prevent list corruption.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: MyungJoo Ham <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2016-10-11 00:00:20 +02:00
Axel Lin 3b91f4b361 PM / devfreq: exynos-nocp: Remove redundant code
load_count/total_count are reset by devfreq_event_get_event(), so
remove the redundant code in exynos_nocp_get_event().

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
[ rjw: Subject/changelog ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
2016-10-10 23:56:22 +02:00
Axel Lin 69e67a0626 PM / devfreq: exynos-nocp: Select REGMAP_MMIO
This driver uses devm_regmap_init_mmio(), so select REGMAP_MMIO to avoid
build failure.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2016-10-10 23:53:48 +02:00
Axel Lin fe62c477df mfd: lp873x: Remove unused mutex lock from struct lp873x
The mutex is not used, so remove it.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2016-10-04 15:48:04 +01:00
Axel Lin 7f70495a51 mfd: altera-a10sr: Make altr_a10sr_regmap_config static const
It's only used in this driver and never get modified, make it static const.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Thor Thayer <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2016-10-04 15:48:01 +01:00
Axel Lin ea1a76bad8 platform/x86: intel_pmc_ipc: Convert to use platform_device_register_full
Use platform_device_register_full() instead of open-coded.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Darren Hart <[email protected]>
2016-09-28 16:33:04 -07:00
Axel Lin 1f6b0889d0 thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
devm_thermal_zone_of_sensor_register can fail, so check it's return value.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
2016-09-27 14:02:16 +08:00
Axel Lin d095c500fd Input: snvs_pwrkey - drop input_free_device call if input_register_device fails
Current code uses devm_input_allocate_device() so don't explicitly call
input_free_device if input_register_device fails.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
2016-09-26 20:01:59 -07:00
Axel Lin 473195f80f rtc: ac100: Add NULL checking for devm_kzalloc call
devm_kzalloc can return NULL, add NULL checking to prevent NULL pointer
dereference.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
2016-09-22 00:14:41 +02:00
Axel Lin 7ee2eaa364 HID: alps: Fix memory leak
A kfree(readbuf) call was missed if hid_hw_raw_request() fails, fix it.
Also avoid mixing direct return with goto in the error paths.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
2016-09-19 14:42:22 +02:00
Axel Lin da4a64481b PM / devfreq: rk3399_dmc: Remove explictly regulator_put call in .remove
Current code uses devm_regulator_get() in .probe so a regulator_put() will
be automatically called when unload the module. Remove the explictly
regulator_put() call and then we can also remove rk3399_dmcfreq_remove().

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Chanwoo Choi <[email protected]>
Acked-by: MyungJoo Ham <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2016-09-19 13:36:20 +02:00
Axel Lin 4253168663 spi: st-ssc4: Fix misuse of devm_gpio_request/devm_gpio_free APIs
devm_* API is supposed to be used only in probe function call.
The resource is allocated at 'probe' and free automatically at 'remove'.
Usage of devm_* functions outside probe sometimes leads to resource leak.
Thus avoid using devm_* APIs in .setup/.cleanup callbacks.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-09-14 16:05:35 +01:00
Axel Lin 0a8784e792 hwmon: (lm95241) Update module description to include LM95231
This driver also supports LM95231.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
2016-09-13 07:28:01 -07:00
Axel Lin ca05ab20f1 hwmon: (lm95245) Select REGMAP_I2C
This driver now uses regmap APIs, so it needs to select REGMAP_I2C.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
2016-09-13 07:27:34 -07:00
Axel Lin 5ed0e74104 phy: bcm-ns2-pcie: Set missing .owner field in ns2_pci_phy_ops
Add missing .owner field in ns2_pci_phy_ops, which is used for refcounting.
While at it, also makes ns2_pci_phy_ops const as it's never get modified.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-and-tested-by: Jon Mason <[email protected]>
Reviewed-by: Pramod Kumar <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
2016-09-10 16:48:36 +05:30
Axel Lin b9d0397fef phy: bcm-ns2-pcie: Get rid of struct ns2_pci_phy
By setting phy_set_drvdata(phy, mdiodev), struct ns2_pci_phy can be
removed.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-and-tested-by: Jon Mason <[email protected]>
Reviewed-by: Pramod Kumar <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
2016-09-10 16:48:36 +05:30
Axel Lin d223472505 phy: exynos5-usbdrd: Remove "static" from local variable
The 'reg' local variable does not need to be static.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
2016-09-10 16:48:25 +05:30
Axel Lin ec10396477 ASoC: nau8810: Fix memory leak in nau8810_eq_put error path
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-09-01 21:06:14 +01:00
Axel Lin bf8ca651e1 phy: brcm-sata: Return proper error if brcm_sata_phy_init fails
Return proper error instead of 0 if brcm_sata_phy_init fails.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
2016-08-12 14:59:10 +05:30
Axel Lin e094e8f3de ASoC: cs42l73: Constify cs42l73_mclk_coeffs and cs42l73_mclkx_coeffs tables
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Brian Austin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-08-08 11:54:30 +01:00
Axel Lin 6e8e9b9a46 ASoC: cs53l30: Constify cs53l30_mclk_coeffs and cs53l30_mclkx_coeffs tables
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-08-08 11:54:30 +01:00
Axel Lin 3597fced66 ASoC: cs53l30: Constify cs53l30_mclk_coeffs and cs53l30_mclkx_coeffs tables
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-08-08 11:54:26 +01:00
Axel Lin 634f41dcec regulator: mt6323: Constify struct regulator_ops
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-07-19 18:31:59 +01:00
Axel Lin 15b1dc9823 regulator: mt6323: Fix module description
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-07-19 18:31:59 +01:00
Axel Lin cc4618813e i2c: versatile: Convert to use resource managed devm_* APIs
Use devm_* APIs to simplify the code a bit.
This patch also fixes the memory leak when unload the module.

Signed-off-by: Axel Lin <[email protected]>
Tested-by: Liviu Dudau <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2016-07-14 21:21:56 +09:00
Axel Lin 9f6db9bfb5 i2c: versatile: Allow compile test build
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.

Signed-off-by: Axel Lin <[email protected]>
Tested-by: Liviu Dudau <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2016-07-14 21:19:55 +09:00
Axel Lin e9802c5793 ASoC: rt5514-spi: Convert to use devm_* API
Use devm_* API to simplify the code.
This patch also fixes the return value in probe error paths.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-07-14 10:56:54 +01:00
Axel Lin 5d78b027c0 ASoC: cs35l33: Fix display revision id
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-07-01 11:54:01 +02:00
Axel Lin 410fe39c6d ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
devm_gpiod_get_optional() returns NULL when the gpio is not assigned.
So the if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) test is always false.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-07-01 11:53:56 +02:00
Axel Lin 2be59755e6 mfd: max77620: Constify resources tables
These tables are never modified, so declare them as const.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2016-06-29 10:14:32 +01:00
Axel Lin 262329fcca ASoC: cs35l33: Remove setting dapm->bias_level in cs35l33_set_bias_level
This is done by ASoC core now.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-28 20:56:03 +01:00
Axel Lin beefe4a9f4 ASoC: cs35l33: Remove unnecessary free_irq call
Current code uses devm_request_threaded_irq() so it does not need to
explicitly call free_irq() in .probe error path and .remove.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-28 20:55:59 +01:00
Axel Lin f823a3fd4b [media] v4l: mt9v032: Remove duplicate test for I2C_FUNC_SMBUS_WORD_DATA functionality
Since commit b42261078a ("regmap: i2c: fallback to SMBus if the adapter
does not support standard I2C"), regmap-i2c will check the
I2C_FUNC_SMBUS_[BYTE|WORD]_DATA functionality based on the regmap_config
setting if the adapter does not support standard I2C.

So remove the I2C_FUNC_SMBUS_WORD_DATA functionality check in the driver code.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2016-06-28 07:58:10 -03:00
Axel Lin 68f86c75ca hwmon: (ads7871) Convert to devm_hwmon_device_register_with_groups
Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to
simplify the code a bit.

The update_lock mutex is not used, so remove it.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
2016-06-27 18:58:03 -07:00
Axel Lin 699f279d99 hwmon: (jz4740) Convert to devm_hwmon_device_register_with_groups
Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to
simplify the code a bit.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
2016-06-27 18:58:03 -07:00
Axel Lin 157926c013 hwmon: (ad7314) Convert to devm_hwmon_device_register_with_groups
Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to
simplify the code a bit.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
2016-06-27 18:58:03 -07:00
Axel Lin 0b305ccc1b gpio: 104-idi-48: Fix missing spin_lock_init for ack_lock
Fixes: 9ae482104c ("gpio: 104-idi-48: Clear pending interrupt once in IRQ handler")
Signed-off-by: Axel Lin <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-06-23 00:29:29 +02:00
Axel Lin 19b5a91764 pinctrl: tegra: Fix build dependency
I got below build error:
ERROR: "tegra_xusb_padctl_legacy_probe"
 [drivers/phy/tegra/phy-tegra-xusb.ko] undefined!
with below build configuration:
CONFIG_ARCH_TEGRA=y
CONFIG_PINCTRL_TEGRA_XUSB=y
CONFIG_PHY_TEGRA_XUSB=y

The problem is below line in drivers/pinctrl/Makefile
obj-$(CONFIG_PINCTRL_TEGRA)     += tegra/

So even CONFIG_PINCTRL_TEGRA_XUSB=y is set, kbuild still does not compile
the code in drivers/pinctrl/tegra folder if !CONFIG_PINCTRL_TEGRA.

phy-tegra-xusb.c does not use any symbol from pinctrl-tegra.c,
so build pinctrl-tegra.c only when CONFIG_PINCTRL_TEGRA is set.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Jon Hunter <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-06-22 17:58:07 +02:00
Axel Lin 4335f6537a regulator: lp873x: Drop _nlr parameter from LP873X_REGULATOR()
No need to pass _nlr to LP873X_REGULATOR(), use ARRAY_SIZE to calculate it.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Keerthy <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-21 18:43:48 +01:00
Axel Lin 43160ffd12 regulator: qcom_smd: Remove list_voltage callback for rpm_smps_ldo_ops_fixed
Use regulator_list_voltage_linear_range in rpm_smps_ldo_ops_fixed is
wrong because it is used for fixed regulator without any linear range.
The rpm_smps_ldo_ops_fixed is used for pm8941_lnldo which has fixed_uV
set and n_voltages = 1. In this case, regulator_list_voltage() can return
rdev->desc->fixed_uV without .list_voltage implementation.

Fixes: 3bfbb4d1a4 ("regulator: qcom_smd: add list_voltage callback")
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-06-15 10:18:50 +01:00
Axel Lin 33c77abcf4 i2c: robotfuzz-osif: Constify osif_table
osif_table is never modified, so declare it as const.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Andrew Lunn <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2016-06-13 22:32:09 +02:00
Axel Lin 053ae6499a gpio: 104-idi-48: Fix missing spin_lock_init for ack_lock
Fixes: 9ae482104c ("gpio: 104-idi-48: Clear pending interrupt once in IRQ handler")
Signed-off-by: Axel Lin <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-06-13 14:48:10 +02:00
Axel Lin c714a588fc regulator: tps51632: Fix setting ramp delay
According to the datasheet:

SLEW Register(Address = 07h)
b7      b6      b5      b4      b3      b2      b1      b0
48mV/us 42mV/us 36mV/us 30mV/us 24mV/us 18mV/us 12mV/us 6mV/us

Current code does not set correct slew rate in some cases:
e.g. Assume ramp_delay is 10000, current code sets slew register to 6mV/us.
Fix the logic to set slew register.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Laxman Dewangan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-31 16:38:01 +01:00
Axel Lin d0abd6f5f5 regulator: max8973: Fix setting ramp delay
Current code can set ramp delay to a wrong setting that the return value
from .set_voltage_time_sel is not enough for proper delay.
Fix the logic in .set_ramp_delay and also remove unused ret_val variable.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-30 17:00:56 +01:00
Axel Lin c8a28a0dbe regulator: pv880x0: Clean up unnecessary header inclusion
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-30 16:29:39 +01:00
Axel Lin af37d21a32 ASoC: max98371 Remove duplicate entry in max98371_reg
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-11 16:39:56 +01:00
Axel Lin 191ec11348 spi: pic32-sqi: Remove pic32_sqi_setup and pic32_sqi_cleanup
Current code does not use ctldata at all, so remove spi_set_ctldata call.

spi_setup() will set spi->bits_per_word = 8 if it was not set, so remove
!spi->max_speed_hz checking.

The spi core allows absent of spi->max_speed_hz setting, if it was not set
spi_setup() assigns spi->master->max_speed_hz to it.

spi core allows spi->max_speed_hz > spi->master->max_speed_hz, in this case
spi core will limit the transfer speed to ensure xfer->speed_hz won't
greater than spi->master->max_speed_hz so remove checking if
spi->max_speed_hz is higher than spi->master->max_speed_hz.

As a result, both pic32_sqi_setup() and pic32_sqi_cleanup() can be removed.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-06 18:18:27 +01:00
Axel Lin 46cb41534a spi: Drop unnecessary dependencies on relaxed I/O accessors
The relaxed I/O accessors are available on all architectures now.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-05-02 16:25:13 +01:00
Axel Lin 1051550e9d spi: st-ssc4: Fix missing spi_master_put in spi_st_probe error paths
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-04-29 18:16:25 +01:00
Axel Lin 83fefd2d5b spi: st-ssc4: Allow compile test build
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-04-29 18:16:25 +01:00
Axel Lin 866e48b099 spi: pic32: Fix checking return value of devm_ioremap_resource
devm_ioremap_resource() returns ERR_PTR on error.
Also remove the redundant dev_err message, the implementation of
devm_ioremap_resource() already print error messages on error paths.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-04-29 12:34:20 +01:00
Axel Lin 71c5e53b42 spi: Drop duplicate code to set master->dev.parent
It's done by spi_alloc_master().

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-04-26 11:56:09 +01:00
Axel Lin 2452ee2525 spi: pic32: Set proper bits_per_word_mask
This driver only supports 8/16/32 bits_per_word, so set
master->bits_per_word_mask accordingly. With this change, we can remove
the spi->bits_per_word checking in pic32_spi_setup as it's done by spi
core.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-04-26 11:14:35 +01:00
Axel Lin f6903783eb i2c: s3c2410: Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS instead of open-coded
Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS to simplify the code.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2016-04-24 23:15:11 +02:00
Axel Lin d4644becf8 i2c: exynos5: Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS instead of open-coded
Use SET_NOIRQ_SYSTEM_SLEEP_PM_OPS to simplify the code.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
2016-04-24 23:14:40 +02:00
Axel Lin 35b3fc8876 gpio: brcmstb: Return proper error if bank width is invalid
Return proper error in brcmstb_gpio_probe if bank width is invalid.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Gregory Fong <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-04-15 10:09:48 +02:00
Axel Lin a61b37ead5 mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
2016-04-08 09:30:11 +05:30
Axel Lin 6e66a6599a gpio: tpic2810: Make sure cached buffer has consistent status with h/w status
i2c_smbus_write_byte_data() can fail. To ensure the
cached buffer has consistent status with h/w status, don't
update the cached gpio->buffer if write fails.

Also refactor the code a bit by adding a tpic2810_set_mask_bits()
helper and use it to simplify the code.

Signed-off-by: Axel Lin <[email protected]>
Reviewed-by: Alexandre Courbot <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-31 15:14:37 +02:00
Axel Lin c6cc75fec0 gpio: xgene-sb: Use irq_domain_free_irqs_common()
Current code calls irq_domain_alloc_irqs_parent() in .alloc,
so it should call irq_domain_free_irqs_parent() accordingly in .free.
Fix it by switching to use irq_domain_free_irqs_common() instead.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-31 10:22:53 +02:00
Axel Lin 63cc787e71 irqdomain: Export irq_domain_free_irqs_common
Export irq_domain_free_irqs_common so it can be used by modules.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-31 10:22:32 +02:00
Axel Lin 2dfadff69e ASoC: rt5677: Avoid duplicate the same test in each switch case
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-03-30 10:38:01 -07:00
Axel Lin 8d8ee18cc7 gpio: xgene: Prevent NULL pointer dereference
platform_get_resource() can return NULL, thus add NULL test to prevent NULL
pointer dereference.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:39:39 +02:00
Axel Lin fd975a7b18 gpio: menz127: Drop lock field from struct men_z127_gpio
Current code uses a uninitialized spin lock.
bgpio_init() already initialized a spin lock, so let's switch to use
&gc->bgpio_lock instead and remove the lock from struct men_z127_gpio.

Fixes: f436bc2726 "gpio: add driver for MEN 16Z127 GPIO controller"
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:39:39 +02:00
Axel Lin b6d055b198 gpio: octeon: Constify octeon_gpio_match table
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:38:51 +02:00
Axel Lin 592569de4c gpio: octeon: Convert to use devm_ioremap_resource
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:38:51 +02:00
Axel Lin 574b782e7b gpio: amdpt: Convert to use gpio-generic
Use gpio-generic to simplify this driver.

Signed-off-by: Axel Lin <[email protected]>
Tested-by: YD Tseng <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:38:51 +02:00
Axel Lin f85834229b gpio: mb86s7x: Remove redundant platform_set_drvdata() call
Set it once is enough, so remove the second platform_set_drvdata() call.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:38:50 +02:00
Axel Lin 86d3f36768 gpio: menz127: Drop *mdev field from struct men_z127_gpio
No need to store *medv in struct men_z127_gpio.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-30 10:38:50 +02:00
Axel Lin 3ae36c8b67 spi: octeon: Convert to use devm_ioremap_resource
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-03-21 13:40:16 +00:00
Axel Lin 46f920d8a9 irqchip/tegra: Switch to use irq_domain_free_irqs_common
Current code calls irq_domain_alloc_irqs_parent() in .alloc,
so it should call irq_domain_free_irqs_parent() accordingly in .free.
Fix it by switching to use irq_domain_free_irqs_common() instead of
the open-coded private implementation.

Signed-off-by: Axel Lin <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
2016-03-20 20:08:28 +01:00
Axel Lin c2e04af072 mfd: Allow i2c modular drivers to build with I2C=m
These drivers can be built as module, so make them depend on I2C rather
than I2C=y.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Adam Thomson <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2016-03-09 12:58:52 +07:00
Axel Lin adf32eaa05 gpio: mpc8xxx: Slightly update the code for better readability
Setting gc->direction_output to gc->direction_output looks strange.
I think this change makes the intention more clear.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-09 10:44:13 +07:00
Axel Lin cd0d3f58a0 gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip
*read_reg and *write_reg can be removed because at all the places to call
them, we can just use gc->read_reg/gc->write_reg instead.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-09 10:43:09 +07:00
Axel Lin fa4007ca06 gpio: mpc8xxx: Fixup setting gpio direction output
For devtype with specific gpio_dir_out implementation, current code is
wrong because below code sets both gc->direction_output and
mpc8xxx_gc->direction_output to the same function.

gc->direction_output = devtype->gpio_dir_out ?: gc->direction_output;
mpc8xxx_gc->direction_output = gc->direction_output;

Set mpc8xxx_gc->direction_output = gc->direction_output first to fix it.
This way mpc8xxx_gc->direction_output actually calls the standard
bgpio_dir_out() to update register.

Fixes: commit 42178e2a1e ("drivers/gpio: Switch gpio-mpc8xxx to use gpio-generic")
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-09 10:41:23 +07:00
Axel Lin 3fab91ea28 gpio: lp3943: Drop pin_used and lp3943_gpio_request/lp3943_gpio_free
The implementation of lp3943_gpio_request/lp3943_gpio_free test pin_used
for tracing the pin usage. However, gpiolib already checks FLAG_REQUESTED
flag for the same purpose. So remove the redundant implementation.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-09 09:17:55 +07:00
Axel Lin 24030d9d95 gpio: moxart: Allow compile test build
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-07 11:38:34 +07:00
Axel Lin 0c271658aa gpio: moxart: Drop redundant code to set already initialized gpio_chip fields
These fields are initialized by bgpio_init() with exactly the same settings
so remove the redundant code.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-03-07 11:37:11 +07:00
Axel Lin c7e3c5f861 nvmem: imx-ocotp: Fix return value of imx_ocotp_read
imx_ocotp_read() should return 0 on success.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-03-05 12:20:29 -08:00
Axel Lin 4d92325125 regulator: max77620: Remove duplicate module alias
The same alias is already in .id_table.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-02-26 10:36:54 +09:00
Axel Lin aad76f743b regulator: max77620: Eliminate duplicate code
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-02-26 10:36:54 +09:00
Axel Lin 47dbdbf64f regulator: max77620: Remove unused fields
These fields are never used and not required at all, remove them.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2016-02-26 10:36:54 +09:00
Axel Lin 4fccbbde11 gpio: mb86s7x: Allow compile test build
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-02-25 16:00:25 +01:00
Axel Lin ea04a7cae3 gpio: pisosr: Use gpiod_set_value_cansleep in pisosr_gpio_refresh()
This driver has .can_sleep flag set.
So the pisosr_gpio_get() can be called from contexts that can sleep.
Thus use the cansleep() variant in pisosr_gpio_refresh().

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-02-25 15:20:46 +01:00
Axel Lin 21d08ab9c9 gpio: pisosr: Use devm_gpiod_get_optional for gpio->load_gpio
gpio->load_gpio is optional, so use devm_gpiod_get_optional instead.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Andrew F. Davis <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2016-02-25 15:20:46 +01:00