aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-03-23eeprom: at24: tweak newlinesBartosz Golaszewski1-1/+1
Remove the newline between the nvmem registration and its return value check. This is consistent with the rest of the driver code. Add a missing newline between two pdata checks to stay consistent with all the others. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: refactor at24_probe()Bartosz Golaszewski1-16/+18
The code in at24_probe() is pretty mangled. It can be cleaned up a bit by doing things one by one. Let's group the code by logic: parse and verify pdata, initialize the regmap, allocate and fill the fields of at24_data, allocate dummy i2c devices, initialize pm & register with nvmem. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: remove at24_platform_data from at24_dataBartosz Golaszewski1-9/+13
Not all fields from at24_platform_data are needed in at24_data. Let's keep just the ones we need and not carry the whole platform_data structure all the time. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: move platform data processing into a separate routineBartosz Golaszewski1-30/+40
This driver can receive its device data from different sources depending on the system. Move the entire code processing platform data, device tree and acpi into a separate function. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: switch to using probe_new() from the i2c frameworkBartosz Golaszewski1-2/+5
Use the new probe() style for i2c drivers. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: provide and use at24_base_client_dev()Bartosz Golaszewski1-2/+7
Use a helper function for accessing the device struct of the base i2c client. This routine is named in a way that reflects its purpose unlike the previously hand-coded dereferencing. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: readability tweak in at24_probe()Bartosz Golaszewski1-2/+3
Use a helper variable for the size we want to allocate with devm_kzalloc() and save an ugly line break. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: use a helper variable for devBartosz Golaszewski1-25/+23
We use the &client->dev construct all over in at24_probe(). Use a helper variable which is more readable and allows to avoid a couple unnecessary line breaks. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: rename chip to pdata in at24_probe()Bartosz Golaszewski1-21/+21
Reflect the purpose of this variable: it contains platform data so name it such. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: rename at24_get_pdata()Bartosz Golaszewski1-2/+3
As preparation for at24_probe() refactoring: rename at24_get_pdata() to at24_properties_to_pdata(). We're doing it because we'll move the pdata parsing code into a separate function which will be called at24_get_pdata(). Current routine with that name actually parses the device properties so change its name to reflect its purpose. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: don't check if byte_len is a power of 2Bartosz Golaszewski1-3/+0
We support certain models the size of which is not a power of 2. This is not a reason to emit a warning. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: make struct initialization uniform in at24_probe()Bartosz Golaszewski1-1/+1
When zeroing structs, use "{ }" everywhere. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: drop redundant variable in at24_write()Bartosz Golaszewski1-8/+6
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: drop redundant variable in at24_read()Bartosz Golaszewski1-8/+6
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: remove code separatorsBartosz Golaszewski1-4/+0
These are just two left-overs from times when this driver was bigger. They are not really useful anymore. Remove them. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: arrange local variablesBartosz Golaszewski1-10/+16
Arrange declarations of local variables by line length as visually it's easier to read. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: remove nvmem_config from at24_dataBartosz Golaszewski1-16/+16
This structure only needs to exist during the call to nvmem_register(). Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at24: disable regmap lockingBartosz Golaszewski1-0/+1
We use our own mutex for locking. Disable the regmap-specific locking. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-23eeprom: at25: sizeof t should be sizeof(t)Devang Panchal1-1/+1
Resolved checkpatch warning "sizeof t should be sizeof(t)" issue found by checkpatch. Signed-off-by: Devang Panchal <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-21Merge tag 'extcon-next-for-4.17' of ↵Greg Kroah-Hartman9-126/+315
git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for 4.17 Detailed description for this pull request: 1. Add exported extcon function in order to support OF graph binding - The extcon consumer driver used the "extcon = <&extcon's phandle" property in device-tree in order to bind between extcon provider and consumer driver. But, OF graph method is better than 'extcon' property. So, extcon subsystem adds the following function to support OF graph binding. : extcon_find_edev_by_node(struct device_node *node) - Create the immutable branch ("ib-extcon-drm-dt-v4.17") for both drm-misc and device-tree subsystem. This immutable branch contains the use-case of OF graph binding for EXTCON_HDMI connector between MHL device driver and extcon provider driver. 2. Fix minor issues of extcon device drivers - Remove platform_data and covert to fully use GPIO descriptor for extcon-gpio.c - Remove workaround code for id pin direction from extcon-inte-int3496.c because GPIO ACPI library does support it with generic way. - Set direction and drv flags for V5 boost GPIO because of fixing the firmware bug.
2018-03-21Merge branch 'ib-extcon-drm-dt-v4.17' into extcon-nextChanwoo Choi5-13/+258
2018-03-21extcon: gpio: Convert to fully use GPIO descriptorLinus Walleij1-51/+15
Since we are not getting the GPIO from any platform data and global GPIO numberspace, we simply get the named "extcon" GPIO directly from the device. Cut away "active low" since GPIO descriptors already know if the line is active high or low. Simplify a bit with a struct device *dev helper variable in probe() and cut the complex init() function. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
2018-03-21extcon: gpio: Move platform data into state containerLinus Walleij1-30/+33
This moves the platform data settings from the platform data struct and into the state container, saving some unnecessary references and simplifying things a bit. Signed-off-by: Linus Walleij <[email protected]> [cw00.choi: Add FIXME comment of extcon_id] Signed-off-by: Chanwoo Choi <[email protected]>
2018-03-21extcon: gpio: Localize platform dataLinus Walleij2-48/+21
Nothing in the entire kernel #includes <linux/extcon/extcon-gpio.h> so move the platform data declaration inside of the driver. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
2018-03-21extcon: int3496: Ignore incorrect IoRestriction for ID pinAndy Shevchenko1-4/+5
The commit 70216fd937fe ("extcon: int3496: Set the id pin to direction-input if necessary") introduced a workaround for incorrect IoRestriction mode in ACPI table. Now, when GPIO ACPI library does it in generic way, see the commit 1b2ca32ab0b8 ("gpiolib: acpi: Introduce NO_RESTRICTION quirk") for the details, just set an appropriate quirk flag instead. Reviewed-by: Hans de Goede <[email protected]> Tested-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
2018-03-21extcon: intel-cht-wc: Set direction and drv flags for V5 boost GPIOHans de Goede1-4/+7
Sometimes (firmware bug?) the V5 boost GPIO is not configured as output by the BIOS, leading to the 5V boost convertor being permanently on, Explicitly set the direction and drv flags rather then inheriting them from the firmware to fix this. Fixes: 585cb239f4de ("extcon: intel-cht-wc: Disable external 5v boost ...") Cc: [email protected] Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
2018-03-20Merge tag 'thunderbolt-for-v4.17' of ↵Greg Kroah-Hartman12-115/+1186
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into char-misc-next Mike writes: thunderbolt: Changes for v4.17 merge window New features: - Intel Titan Ridge Thunderbolt 3 controller support - Preboot ACL supported, allowing more secure way to boot from Thunderbolt devices - New "USB only" security level In addition there are a couple of fixes for increasing timeout when authenticating the ICM firmware and reading root switch config space. Preventing a crash on certain Lenovo systems where ICM firmware for some reason is not always properly starting up.
2018-03-15misc: aspeed-lpc-ctrl: Enable FWH and A2H bridge cyclesJoel Stanley1-2/+16
To date this driver has relied on prevous state from out of tree hacks and vendor u-boot trees in order to have the host be able to access data over the LPC bus. Now we explicitly enable the AHB to LPC bridge and FWH cycles from when the user first configures the address to map. We chose to do this then as before that time there is no way for the kernel to know where it is safe to point the LPC window. Tested-by: Lei YU <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Reviewed-by: Cyril Bur <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15misc: aspeed-lpc: Request and enable LPC clockJoel Stanley1-3/+23
The LPC device needs to ensure it's clock is enabled before it can do anything. In the past the clock was enabled and left running by u-boot, however Linux now has an upstream clock driver that disables unused clocks. Tested-by: Lei YU <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Reviewed-by: Cyril Bur <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15dt-bindings: aspeed-lpc: Document LPC Host Interface ControllerJoel Stanley1-0/+41
The LPC Host Interface Controller is part of a BMC SoC that is used for communication with the host. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15misc: ocxl: use put_device() instead of device_unregister()Arvind Yadav1-1/+1
if device_register() returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Acked-by: Andrew Donnellan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15misc: mic: Release reference count and memory for VOP deviceArvind Yadav1-2/+4
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Release allocated memory for vop device in vop_release_dev(). Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15devres: combine function devm_ioremap*Yisheng Xie1-40/+38
When I tried to use devm_ioremap function and review related code, I found devm_ioremap_* almost have the similar realize with each other, which can be combined. In the former version, I have tried to kill ioremap_cache to reduce the size of devres, which can not work for ioremap is not the same as ioremap_nocache in some ARCHs likes ia64. Therefore, as the suggestion of Christophe, I introduce a help function __devm_ioremap, let devm_ioremap* inline and call __devm_ioremap with different devm_ioremap_type. After apply the patch, the size of devres.o can be reduce from 8216 Bytes to 8052 Bytes in my compile environment. Suggested-by: Greg KH <[email protected]> Suggested-by: Christophe LEROY <[email protected]> Signed-off-by: Yisheng Xie <[email protected]> Reviewed-by: Christophe LEROY <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15siox: fix possible buffer overflow in device_add_storeGavin Schenk1-1/+1
Width 20 given in format string is larger than destination buffer 'type[20]', use %19s to prevent overflowing it. Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX") Cc: stable <[email protected]> Reported-by: David Binderman <[email protected]> Signed-off-by: Gavin Schenk <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15char: nvram: disable on ARMAlexandre Belloni1-1/+1
/dev/nvram was never meant to be used alongside the RTC CMOS driver from drivers/rtc as it already expose the NVRAM through another interface.. Anyway, the last defconfig to enable it properly was removed in 2010 so prevent ARM users from selecting it. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15misc: rtsx: make various functions staticColin Ian King1-6/+6
The functions rts5260_get_ocpstat, rts5260_get_ocpstat2, rts5260_clear_ocpstat, rts5260_process_ocp, rts5260_init_hw and rts5260_set_aspm are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'rts5260_get_ocpstat' was not declared. Should it be static? symbol 'rts5260_get_ocpstat2' was not declared. Should it be static? symbol 'rts5260_clear_ocpstat' was not declared. Should it be static? symbol 'rts5260_process_ocp' was not declared. Should it be static? symbol 'rts5260_init_hw' was not declared. Should it be static? symbol 'rts5260_set_aspm' was not declared. Should it be static? Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15block, char_dev: Use correct format specifier for unsigned intsSrivatsa S. Bhat2-10/+13
register_blkdev() and __register_chrdev_region() treat the major number as an unsigned int. So print it the same way to avoid absurd error statements such as: "... major requested (-1) is greater than the maximum (511) ..." (and also fix off-by-one bugs in the error prints). While at it, also update the comment describing register_blkdev(). Signed-off-by: Srivatsa S. Bhat <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15char_dev: Fix off-by-one bugs in find_dynamic_major()Srivatsa S. Bhat1-3/+3
CHRDEV_MAJOR_DYN_END and CHRDEV_MAJOR_DYN_EXT_END are valid major numbers. So fix the loop iteration to include them in the search for free major numbers. While at it, also remove a redundant if condition ("cd->major != i"), as it will never be true. Signed-off-by: Srivatsa S. Bhat <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15slimbus: core: use put_device() instead of kfree()Arvind Yadav1-1/+1
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-15misc: atmel: Remove CPU_AT32AP700X (AVR32) referenceUlf Magnusson1-1/+0
The CPU_AT32AP700X symbol symbol went away when when AVR32 was removed in commit 26202873bb51 ("avr32: remove support for AVR32 architecture") Remove the prompt from ATMEL_TCB_CLKSRC_BLOCK. The prompt condition could never be satisfied now. Discovered with the https://github.com/ulfalizer/Kconfiglib/blob/master/examples/list_undefined.py script. Signed-off-by: Ulf Magnusson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14mei: remove dev_err message on an unsupported ioctlColin Ian King1-1/+0
Currently the driver spams the kernel log on unsupported ioctls which is unnecessary as the ioctl returns -ENOIOCTLCMD to indicate this anyway. I suspect this was originally for debugging purposes but it really is not required so remove it. Signed-off-by: Colin Ian King <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14mei: limit the number of queued writesAlexander Usyskin7-35/+154
Limit the number of queued writes per client. Writes above this threshold are blocked till place in the transmit queue is available. The limit is configurable via sysfs and defaults to 50. The implementation should provide blocking I/O behavior. Prior to this change one would end up in the hands of OOM. Signed-off-by: Alexander Usyskin <[email protected]> Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14mei: make module referencing local to the bus.cTomas Winkler3-39/+34
Module reference counting is relevant only to the mei client devices. Make the implementation clean and move it to bus.c Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: imx-ocotp: remove unused dead codeDong Aisheng1-2/+0
remove unused dead code Cc: Srinivas Kandagatla <[email protected]> Cc: Shawn Guo <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14dt-bindings: nvmem: imx-ocotp: update the binding to reflect data cellsDong Aisheng1-4/+19
imx-ocotp is implemented based on nvmem which can have data cells as child node. Update the binding doc to reflect it to be more easily understood by users. Cc: Srinivas Kandagatla <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Shawn Guo <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Acked-by: Shawn Guo <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: sunxi-sid: fix H3 SID controller supportIcenowy Zheng1-21/+50
It seems that doing some operation will make the value pre-read on H3 SID controller wrong again, so all operation should be performed by register. Change the SID reading to use register only. Signed-off-by: Icenowy Zheng <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: add i.MX7 support to snvs-lpgprAndrey Yurovsky3-9/+25
The i.MX7 family has similar SNVS hardware so make the snvs-lpgpr support it along with the i.MX6 family. The register interface is the same except for the number and offset of the general purpose registers. Signed-off-by: Andrey Yurovsky <[email protected]> Reviewed-by: Oleksij Rempel <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: bcm-ocotp: Do not use "&pdev->dev" explicitlyAndrey Smirnov1-2/+1
There's "dev" variable for this already. Use it. Cc: Srinivas Kandagatla <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: imx-iim: Do not use "&pdev->dev" explicitlyAndrey Smirnov1-1/+1
There's already "dev" variable for that. Use it. Cc: Srinivas Kandagatla <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-03-14nvmem: rockchip-efuse: Do not use "&pdev->dev" explicitlyAndrey Smirnov1-4/+4
There's "dev" variable for this already. Use it. Cc: Srinivas Kandagatla <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>