summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-15pci-imx6: fix reboot bugTroy Kisky
2015-10-15mxc_hdmi.c: fix boot hangMax Krummenacher
Without this the kernel hangs during boot when HDMI is attached. It looks like we get an overflow IRQ storm. overflow is related to HDMI audio.
2015-09-24Apalis/Colibri iMX6 defconfigs: add HID_MULTITOUCHMax Krummenacher
2015-09-24fbcon: logo: allow easy integration of a custom Linux boot logoMarcel Ziswiler
This patch allows for easy integration of a custom Linux boot logo to replace the Tux' being shown by default. Use gimp or the like to create a raw PPM in your desired resolution. Reduce the number of colours in the image to 224: user@host:~$ ppmquant 224 Toradex-640x480.ppm > \ Toradex-640x480-224.ppm ppmquant: making histogram... ppmquant: 370 colors found ppmquant: choosing 224 colors... ppmquant: mapping image to new colors... Convert it from raw PPM to ASCII format: user@host:~$ pnmnoraw Toradex-640x480-224.ppm > \ Toradex-640x480-ascii-224.ppm Copy it into the Linux sources: cp Toradex-640x480-ascii-224.ppm linux-toradex/drivers/video/logo/\ logo_custom_clut224.ppm Activate exclusively custom Linux logo in the kernel configuration: Device Drivers -> Graphics support -> Bootup logo -> Custom 224-color Linux logo And re-compile the kernel. (cherry picked from commit fa2371bff9ac03581881849d8f95678ef3992719) (cherry picked from commit 481ced9057f340a80bf23775a55a9b657c49201f)
2015-09-24extcon: usb-gpio: increase debounce timeMarcel Ziswiler
Testing on Colibri Evaluation board V3.x has shown even 50 ms not being enough to avoid unloading and immediately reloading the EHCI USB host controller driver upon OTG cable removal which is of course suboptimal. This patch increases it to 100 ms which should leave enough safety margin.
2015-09-24ARM: dts: imx6dl-colibri: usb device/host switch using extcon gpioMarcel Ziswiler
Use USBC_DET feature of Standard Colibri SODIMM pin 137 for USB device/host switching using the generic extcon USB GPIO implementation.
2015-09-24ARM: dts: imx6dl-colibri: use input dt-bindingsMarcel Ziswiler
Rather than defining our own KEY_WAKEUP include the official input dt-bindings. While at it update copyright date range as well.
2015-09-24ARM: colibri_imx6: add extcon usb gpio support in defconfigMarcel Ziswiler
Enable extcon USB GPIO support in the default kernel configuration.
2015-09-24usb: chipidea: use extcon framework for ID and VBUS detectionMarcel Ziswiler
Rather than relying on special USB/PHY pins/registers use the generic extcon framework with its extcon-usb-gpio implementation to detect ID and VBUS changes. (cherry picked from commit a257098741b441e6e84ffe97b7793c580642d502)
2015-09-18extcon: Add resource-managed extcon register functionSangjung Woo
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 <sangjung.woo@samsung.com> [Fix bug about devm_extcon_dev_match/release() and code clean by Chanwoo Choi] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> (cherry picked from commit 1111244ff4493448c0ee66e814e20c6e81d3b93d)
2015-09-18extcon: usb-gpio: Introduce gpio usb extcon driverRoger Quadros
This driver observes the USB ID pin connected over a GPIO and updates the USB cable extcon states accordingly. The existing GPIO extcon driver is not suitable for this purpose as it needs to be taught to understand USB cable states and it can't handle more than one cable per instance. For the USB case we need to handle 2 cable states. 1) USB (attach/detach) 2) USB-HOST (attach/detach) This driver can be easily updated in the future to handle VBUS events in case it happens to be available on GPIO for any platform. Signed-off-by: Roger Quadros <rogerq@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> (cherry picked from commit e52817faae359ce95c93c2b6eb88b16d4b430181)
2015-09-18leds: leds-gpio: Pass on error codes unmodifiedSoren Brinkmann
Instead of overriding error codes, pass them on unmodified. This way a EPROBE_DEFER is correctly passed to the driver core. This results in the LED driver correctly requesting probe deferral in cases the GPIO controller is not yet available. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reported-and-tested-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Bryan Wu <cooloney@gmail.com> (cherry picked from commit c6e71f813f7208d80bfe0f435d627fad1b204558)
2015-09-18gpio: add parameter to allow the use named gpiosOlliver Schinagl
The gpio binding document says that new code should always use named gpios. Patch 40b73183 added support to parse a list of gpios from child nodes, but does not make it possible to use named gpios. This patch adds the con_id property and implements it is done in gpiolib.c, where the old-style of using unnamed gpios still works. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Acked-by: Bryan Wu <cooloney@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> (cherry picked from commit 1feb57a245a4910b03202a814ffc51a900bd4aca)
2015-09-18leds: leds-gpio: Fix the "default-state" property checkFabio Estevam
Commit a43f2cbbb009f9 ("leds: leds-gpio: Make use of device property API") caused a regression by reading the incorrect string for the "default-state" property. Fix the property string check to restore the original behaviour. Fixes: a43f2cbbb009 (leds: leds-gpio: Make use of device property API) Reported-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit d735d25e60fffeffc256fa5d59551dc92dc07e36)
2015-09-18leds: leds-gpio: Fix multiple instances registration without 'label' propertyFabio Estevam
Since commit a43f2cbbb009f96 ("leds: leds-gpio: Make use of device property API") it is no longer possible to register multiple gpio leds without passing the 'label' property. According to Documentation/devicetree/bindings/leds/common.txt: "Optional properties for child nodes: - label : The label for this LED. If omitted, the label is taken from the node name (excluding the unit address)." So retrieve the node name when the 'label' property is absent to keep the old behaviour and fix this regression. Fixes: a43f2cbbb009 (leds: leds-gpio: Make use of device property API) Reported-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Grant Likely <grant.likely@linaro.org> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 29470ea8d828e4dec74e94f7f17b7479ff5ef276)
2015-09-18leds: leds-gpio: Fix legacy GPIO number caseGeert Uytterhoeven
In the legacy case, led_dat->gpiod is initialized correctly, but overwritten later by template->gpiod, which is NULL, causing leds-gpio to fail with: gpiod_direction_output: invalid GPIO leds-gpio: probe of leds-gpio failed with error -22 Move the initialization of led_dat->gpiod from template->gpiod up, and always use led_dat->gpiod later, to fix this. Fixes: 5c51277a9ababfa4 (leds: leds-gpio: Add support for GPIO descriptors) Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit ec98a4975e66a3aa366cd227edab027b01adea37)
2015-09-18of: Make device nodes kobjects so they show up in sysfsGrant Likely
Device tree nodes are already treated as objects, and we already want to expose them to userspace which is done using the /proc filesystem today. Right now the kernel has to do a lot of work to keep the /proc view in sync with the in-kernel representation. If device_nodes are switched to be kobjects then the device tree code can be a whole lot simpler. It also turns out that switching to using /sysfs from /proc results in smaller code and data size, and the userspace ABI won't change if /proc/device-tree symlinks to /sys/firmware/devicetree/base. v7: Add missing sysfs_bin_attr_init() v6: Add __of_add_property() early init fixes from Pantelis v5: Rename firmware/ofw to firmware/devicetree Fix updating property values in sysfs v4: Fixed build error on Powerpc Fixed handling of dynamic nodes on powerpc v3: Fixed handling of duplicate attribute and child node names v2: switch to using sysfs bin_attributes which solve the problem of reporting incorrect property size. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> (cherry picked from commit 75b57ecf9d1d1e17d099ab13b8f48e6e038676be)
2015-09-18Driver core: Unified interface for firmware node propertiesRafael J. Wysocki
Add new generic routines are provided for retrieving properties from device description objects in the platform firmware in case there are no struct device objects for them (either those objects have not been created yet or they do not exist at all). The following functions are provided: fwnode_property_present() fwnode_property_read_u8() fwnode_property_read_u16() fwnode_property_read_u32() fwnode_property_read_u64() fwnode_property_read_string() fwnode_property_read_u8_array() fwnode_property_read_u16_array() fwnode_property_read_u32_array() fwnode_property_read_u64_array() fwnode_property_read_string_array() in analogy with the corresponding functions for struct device added previously. For all of them, the first argument is a pointer to struct fwnode_handle (new type) that allows a device description object (depending on what platform firmware interface is in use) to be obtained. Add a new macro device_for_each_child_node() for iterating over the children of the device description object associated with a given device and a new function device_get_child_node_count() returning the number of a given device's child nodes. The interface covers both ACPI and Device Trees. Suggested-by: Grant Likely <grant.likely@linaro.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 8a0662d9ed2968e1186208336a8e1fab3fdfea63)
2015-09-18Driver core: Unified device properties interface for platform firmwareRafael J. Wysocki
Add a uniform interface by which device drivers can request device properties from the platform firmware by providing a property name and the corresponding data type. The purpose of it is to help to write portable code that won't depend on any particular platform firmware interface. The following general helper functions are added: device_property_present() device_property_read_u8() device_property_read_u16() device_property_read_u32() device_property_read_u64() device_property_read_string() device_property_read_u8_array() device_property_read_u16_array() device_property_read_u32_array() device_property_read_u64_array() device_property_read_string_array() The first one allows the caller to check if the given property is present. The next 5 of them allow single-valued properties of various types to be retrieved in a uniform way. The remaining 5 are for reading properties with multiple values (arrays of either numbers or strings). The interface covers both ACPI and Device Trees. This change set includes material from Mika Westerberg and Aaron Lu. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit b31384fa5de37a100507751dfb5c0a49d06cee67)
2015-09-18leds: leds-gpio: Convert gpio_blink_set() to use GPIO descriptorsMika Westerberg
Commit 21f2aae91e902aad ("leds: leds-gpio: Add support for GPIO descriptors") already converted most of the driver to use GPIO descriptors. What is still missing is the platform specific hook gpio_blink_set() and board files which pass legacy GPIO numbers to this driver in platform data. In this patch we handle the former and convert gpio_blink_set() to take GPIO descriptor instead. In order to do this we convert the existing four users to accept GPIO descriptor and translate it to legacy GPIO number in the platform code. This effectively "pushes" legacy GPIO number usage from the driver to platforms. Also add comment to the remaining block describing that it is legacy code path and we are getting rid of it eventually. Suggested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit c673a2b4008103525a3cf21bedf15ffac37bfef0)
2015-09-18gpio / ACPI: Add support for _DSD device propertiesMika Westerberg
With release of ACPI 5.1 and _DSD method we can finally name GPIOs (and other things as well) returned by _CRS. Previously we were only able to use integer index to find the corresponding GPIO, which is pretty error prone if the order changes. With _DSD we can now query GPIOs using name instead of an integer index, like the below example shows: // Bluetooth device with reset and shutdown GPIOs Device (BTH) { Name (_HID, ...) Name (_CRS, ResourceTemplate () { GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, "\\_SB.GPO0", 0, ResourceConsumer) {15} GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, "\\_SB.GPO0", 0, ResourceConsumer) {27, 31} }) Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () {"reset-gpio", Package() {^BTH, 1, 1, 0 }}, Package () {"shutdown-gpio", Package() {^BTH, 0, 0, 0 }}, } }) } The format of the supported GPIO property is: Package () { "name", Package () { ref, index, pin, active_low }} ref - The device that has _CRS containing GpioIo()/GpioInt() resources, typically this is the device itself (BTH in our case). index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero. active_low - If 1 the GPIO is marked as active_low. Since ACPI GpioIo() resource does not have field saying whether it is active low or high, the "active_low" argument can be used here. Setting it to 1 marks the GPIO as active low. In our Bluetooth example the "reset-gpio" refers to the second GpioIo() resource, second pin in that resource with the GPIO number of 31. This patch implements necessary support to gpiolib for extracting GPIOs using _DSD device properties. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 0d9a693cc8619b28f0eeb689a554647d42848fde)
2015-09-18leds: leds-gpio: Make use of device property APIRafael J. Wysocki
Make use of device property API in this driver so that both OF and ACPI based system can use the same driver. This change contains material from Max Eliaser and Mika Westerberg. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Bryan Wu <cooloney@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit a43f2cbbb009f96231bbbe24ad4f824215dedb81)
2015-09-18leds: leds-gpio: Add support for GPIO descriptorsMika Westerberg
GPIO descriptors are the preferred way over legacy GPIO numbers nowadays. Convert the driver to use GPIO descriptors internally but still allow passing legacy GPIO numbers from platform data to support existing platforms. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Bryan Wu <cooloney@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 5c51277a9ababfa44a7f944100bdc9fbda139905)
2015-09-18input: gpio_keys_polled: Make use of device property APIAaron Lu
Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit b26d4e2283b6d9b65bfe14b99c9c3a560e390a00)
2015-09-18gpio: Support for unified device properties interfaceMika Westerberg
Some drivers need to deal with only firmware representation of its GPIOs. An example would be a GPIO button array driver where each button is described as a separate firmware node in device tree. Typically these child nodes do not have physical representation in the Linux device model. In order to help device drivers to handle such firmware child nodes we add dev[m]_get_named_gpiod_from_child() that takes a child firmware node pointer as its second argument (the first one is the parent device itself), finds the GPIO using whatever is the underlying firmware method, and requests the GPIO properly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 40b7318319281b1bdec804f6435f26cadd329c13)
2015-09-18ACPI: Add support for device specific propertiesMika Westerberg
Device Tree is used in many embedded systems to describe the system configuration to the OS. It supports attaching properties or name-value pairs to the devices it describe. With these properties one can pass additional information to the drivers that would not be available otherwise. ACPI is another configuration mechanism (among other things) typically seen, but not limited to, x86 machines. ACPI allows passing arbitrary data from methods but there has not been mechanism equivalent to Device Tree until the introduction of _DSD in the recent publication of the ACPI 5.1 specification. In order to facilitate ACPI usage in systems where Device Tree is typically used, it would be beneficial to standardize a way to retrieve Device Tree style properties from ACPI devices, which is what we do in this patch. If a given device described in ACPI namespace wants to export properties it must implement _DSD method (Device Specific Data, introduced with ACPI 5.1) that returns the properties in a package of packages. For example: Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () {"name1", <VALUE1>}, Package () {"name2", <VALUE2>}, ... } }) The UUID reserved for properties is daffd814-6eba-4d8c-8a91-bc9bbf4aa301 and is documented in the ACPI 5.1 companion document called "_DSD Implementation Guide" [1], [2]. We add several helper functions that can be used to extract these properties and convert them to different Linux data types. The ultimate goal is that we only have one device property API that retrieves the requested properties from Device Tree or from ACPI transparent to the caller. [1] http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm [2] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Reviewed-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit ffdcd955c3078af3ce117edcfce80fde1a512bed)
2015-09-18leds: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> (cherry picked from commit 81902d5f658f5c8c0fbdff7c598fe24d4d521c05)
2015-09-18extcon: Implement OF-based extcon lookup properlyTomasz Figa
Platform bus is not the only way to have extcon devices, so current implementation of of_extcon_get_extcon_dev() is broken. Also using parent device node only to get device name is quite ugly. This patch reimplements of_extcon_get_extcon_dev() to do exactly the same as extcon_get_extcon_dev() but instead of comparing names, compare node pointers. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> [mszyprow: simplified the code] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> (cherry picked from commit f841afb17476f485900bb6213cf93a64a7dc303f)
2015-09-18leds: gpio: cleanup the leds-gpio driverXiubo Li
Remove stray blank line and space. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Bryan Wu <cooloney@gmail.com> (cherry picked from commit a4c84e6aafda0ddd8cb004c464cd11e47e211049)
2015-09-18led: gpio: Sort include headers alphabeticallyXiubo Li
If the inlcude headers aren't sorted alphabetically, then the logical choice is to append new ones, however that creates a lot of potential for conflicts or duplicates because every change will then add new includes in the same location. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Bryan Wu <cooloney@gmail.com> (cherry picked from commit 4cc72346f05ef549403d997d66fd517109e59d24)
2015-09-18gpiolib: devres: use correct structure type name in sizeofJulia Lawall
Correct typo in the name of the type given to sizeof. Because it is the size of a pointer that is wanted, the typo has no impact on compilation or execution. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The semantic patch used can be found in message 0 of this patch series. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> (cherry picked from commit 0f05a3ae45f09c20240c8b47152e0333d4d3f717)
2015-09-18gpio: add flags argument to gpiod_get*() functionsAlexandre Courbot
The huge majority of GPIOs have their direction and initial value set right after being obtained by one of the gpiod_get() functions. The integer GPIO API had gpio_request_one() that took a convenience flags parameter allowing to specify an direction and value applied to the returned GPIO. This feature greatly simplifies client code and ensures errors are always handled properly. A similar feature has been requested for the gpiod API. Since setting the direction of a GPIO is so often the very next action done after obtaining its descriptor, we prefer to extend the existing functions instead of introducing new functions that would raise the number of gpiod getters to 16 (!). The drawback of this approach is that all gpiod clients need to be updated. To limit the pain, temporary macros are introduced that allow gpiod_get*() to be called with or without the extra flags argument. They will be removed once all consumer code has been updated. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> (cherry picked from commit 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120)
2015-09-18ACPICA: Linux: Allow ACPICA inclusion for CONFIG_ACPI=n builds.Lv Zheng
This patch moves <acpi/acpi.h> out of CONFIG_ACPI condition so that all ACPICA prototypes can be seen by the CONFIG_ACPI=n Linux kernel builds. Note that we can do this because ACPICA has implemented stubs for all ACPICA prototypes that are currently referenced by the Linux kernel. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 633adaba49d46dcaa4289de5b25c562b54ff575b)
2015-09-18ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion.Lv Zheng
The forthcoming patch will make <acpi/acpi.h> to be visible to all kernel source code. Thus for the architectures that do not support ACPI and haven't implemented <asm/acenv.h>, we need to make it excluded. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit d334c823b27401721591e0f1220050a41af08165)
2015-09-18extcon: Set parent device of extcon device using prameter of ↵Chanwoo Choi
devm_extcon_dev_allocate This patch set the parent device of extcon device using first parameter of devm_extco_dev_allocate() to remove duplicate code on all of extcon provider drivers. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Reported-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Cc: Mark Brown <broonie@kernel.org> Cc: Graeme Gregory <gg@slimlogic.co.uk> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> (cherry picked from commit ac65a625a0961e7a96f2e5e182073691d0474c04)
2015-09-18ACPICA: Linux headers: Add <asm/acenv.h> to remove mis-ordered inclusion of ↵Lv Zheng
<asm/acpi.h> There is a mis-order inclusion for <asm/acpi.h>. As we will enforce including <linux/acpi.h> for all Linux ACPI users, we can find the inclusion order is as follows: <linux/acpi.h> <acpi/acpi.h> <acpi/platform/acenv.h> (acenv.h before including aclinux.h) <acpi/platform/aclinux.h> ........................................................................... (aclinux.h before including asm/acpi.h) <asm/acpi.h> @Redundant@ (ACPICA specific stuff) ........................................................................... ........................................................................... (Linux ACPI specific stuff) ? - - - - - - - - - - - - + (aclinux.h after including asm/acpi.h) @Invisible@ | (acenv.h after including aclinux.h) @Invisible@ | other ACPICA headers @Invisible@ | ............................................................|.............. <acpi/acpi_bus.h> | <acpi/acpi_drivers.h> | <asm/acpi.h> (Excluded) | (Linux ACPI specific stuff) ! <- - - - - - - - - - - - - + NOTE that, in ACPICA, <acpi/platform/acenv.h> is more like Kconfig generated <generated/autoconf.h> for Linux, it is meant to be included before including any ACPICA code. In the above figure, there is a question mark for "Linux ACPI specific stuff" in <asm/acpi.h> which should be included after including all other ACPICA header files. Thus they really need to be moved to the position marked with exclaimation mark or the definitions in the blocks marked with "@Invisible@" will be invisible to such architecture specific "Linux ACPI specific stuff" header blocks. This leaves 2 issues: 1. All environmental definitions in these blocks should have a copy in the area marked with "@Redundant@" if they are required by the "Linux ACPI specific stuff". 2. We cannot use any ACPICA defined types in <asm/acpi.h>. This patch splits architecture specific ACPICA stuff from <asm/acpi.h> to fix this issue. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 07d8391433380fc72f999d99c554b1cfedea9778)
2015-09-18ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h>Lv Zheng
From ACPICA's perspective, <acpi/actypes.h> should be included after inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions. This causes the following problem: 1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>: Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>. Such conditions include: COMPILER_DEPENDENT_UINT64 COMPILER_DEPENDENT_INT64 ACPI_INLINE ACPI_SYSTEM_XFACE ACPI_EXTERNAL_XFACE ACPI_INTERNAL_XFACE ACPI_INTERNAL_VAR_XFACE ACPI_MUTEX_TYPE DEBUGGER_THREADING ACPI_ACQUIRE_GLOBAL_LOCK ACPI_RELEASE_GLOBAL_LOCK ACPI_FLUSH_CPU_CACHE They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. This patch introduces <acpi/platform/aclinuxex.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>. This patch also removes old ACPI_NATIVE_INTERFACE_HEADER mechanism which is not preferred by Linux and adds the platform/acenvex.h to be the solution to solve this issue. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit d13bd5a602982cd7f697e39b13ac736c2c553af1) (cherry picked from commit 6a3790a67bf22b0162337ef2faade225cc86c8b6)
2015-09-18Input: gpio_keys_polled - convert to devm-* APIAlexander Shiyan
Replace existing resource handling in the driver with managed device resources, this ensures more consistent error values and simplifies error handling paths: kzalloc -> devm_kzalloc gpio_request_one -> devm_gpio_request_one input_allocate_polled_device -> devm_input_allocate_polled_device Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> (cherry picked from commit 68252638c8d03a39e5055f823f842c6886d3f83b)
2015-09-18gpio: Add helpers for optional GPIOsThierry Reding
Introduce gpiod_get_optional() and gpiod_get_index_optional() helpers that make it easier for drivers to handle optional GPIOs. Currently in order to handle optional GPIOs, a driver needs to special case error handling for -ENOENT, such as this: gpio = gpiod_get(dev, "foo"); if (IS_ERR(gpio)) { if (PTR_ERR(gpio) != -ENOENT) return PTR_ERR(gpio); gpio = NULL; } if (gpio) { /* set up GPIO */ } With these new helpers the above is reduced to: gpio = gpiod_get_optional(dev, "foo"); if (IS_ERR(gpio)) return PTR_ERR(gpio); if (gpio) { /* set up GPIO */ } While at it, device-managed variants of these functions are also provided. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> (cherry picked from commit 29a1f2333e07bbbecb920cc78fd035fe8f53207a)
2015-09-18extcon: Add devm_extcon_dev_allocate/free to manage the resource of extcon ↵Chanwoo Choi
device 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 <cw00.choi@samsung.com> Reviewed-by: Felipe Balbi <balbi@ti.com> (cherry picked from commit 739ba1bfdb15e773999aafddbd6c59b5737797a0)
2015-09-18gpio: of: Allow -gpio suffix for property namesThierry Reding
Many bindings use the -gpio suffix in property names. Support this in addition to the -gpios suffix when requesting GPIOs using the new descriptor-based API. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> (cherry picked from commit dd34c37aa3e81715a1ed8da61fa438072428e188)
2015-09-18extcon: Move OF helper function to extcon core and change function nameChanwoo Choi
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 <cw00.choi@samsung.com> Acked-by: Felipe Balbi <balbi@ti.com> (cherry picked from commit 1ad94ffef22c0a6e2ee6ba90a800c32fd29ffa1f)
2015-09-18leds-gpio: of: introduce MODULE_DEVICE_TABLE for module autoloadingPaolo Pisati
Enable autoloading of leds-gpio module when a corresponing DT entry is present. Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Signed-off-by: Bryan Wu <cooloney@gmail.com> (cherry picked from commit 472b854bbc0b55de850faa802250fc1aa7692e45)
2015-09-18ACPICA: Cleanup/improve global variable declarations.Lv Zheng
This change cleans up the entire global variable mechaninism including the related macros. Also reduces warnings from the "sparse" utility in the Linux environment. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 3aa0b085f62f771072dca7ad7f5554a11a83cf7e)
2015-09-18of: add functions to count number of elements in a propertyHeiko Stuebner
The need to know the number of array elements in a property is a common pattern. To prevent duplication of open-coded implementations add a helper static function that also centralises strict sanity checking and DTB format details, as well as a set of wrapper functions for u8, u16, u32 and u64. Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Grant Likely <grant.likely@linaro.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit ad54a0cfbeb4bd4033d09017557ccbc423f9d5ff)
2015-09-18ACPICA: acpidump: Remove integer types translation protection.Lv Zheng
Remove translation protection for applications as Linux tools folder will start to use such types. In Linux kernel source tree, after removing this translation protection, the u8/u16/u32/u64/s32/s64 typedefs are exposed for both __KERNEL__ builds and !__KERNEL__ builds (tools/power/acpi) and the original definitions of ACPI_UINT8/16/32/64_MAX are changed. For !__KERNEL__ builds, this kind of defintions should already been tested by the distribution vendors that are distributing binary ACPICA package and we've achieved the successful built/run test result in the kernel source tree. For __KERNEL__ builds, there are 2 things affected: 1. u8/u16/u32/u64/s32/s64 type definitions: Since Linux has already type defined u8/u16/u32/u64/s32/s64 in include/uapi/asm-generic/int-ll64.h for __KERNEL__. In order not to introduce build regressions where the 2 typedefs are differed, ACPI_USE_SYSTEM_INTTYPES is introduced to mask out ACPICA's typedefs. It must be defined for Linux __KERNEL__ builds. 2. ACPI_UINT8/16/32/64_MAX definitions: Before applying this change: ACPI_UINT8_MAX: sizeof (UINT8) UINT8: unsigned char ACPI_UINT16_MAX: sizeof (UINT16) UINT16: unsigned short ACPI_UINT32_MAX: sizeof (UINT32) INT32: int UINT32: unsigned int ACPI_UINT64_MAX: sizeof (UINT64) INT64: COMPILER_DEPENDENT_INT64 COMPILER_DEPENDENT_INT64: signed long (IA64) or signed long long (IA32) UINT64: COMPILER_DEPENDENT_UINT64 COMPILER_DEPENDENT_UINT64: unsigned long (IA64) or unsigned long long (IA32) After applying this change: ACPI_UINT8_MAX: sizeof (u8) u8: unsigned char UINT8: (removed from actypes.h) ACPI_UINT16_MAX: sizeof (u16) u16: unsigned short UINT16: (removed from actypes.h) ACPI_UINT32_MAX: sizeof (u32) INT32/UINT32: (removed from actypes.h) s32: signed int u32: unsigned int ACPI_UINT64_MAX: sizeof (u64) INT64/UINT64: (removed from actypes.h) u64: unsigned long long s64: signed long long COMPILER_DEPENDENT_INT64: signed long (IA64) (not used any more) signed long long (IA32) (not used any more) COMPILER_DEPENDENT_UINT64: unsigned long (IA64) (not used any more) unsigned long long (IA32) (not used any more) All definitions are equal except ACPI_UINT64_MAX for CONFIG_IA64. It is changed from sizeof(unsigned long) to sizeof(unsigned long long). By investigation, 64bit Linux kernel build is LP64 compliant, i.e., sizeof(long) and (pointer) are 64. As sizeof(unsigned long) equals to sizeof(unsigned long long) on IA64 platform where CONFIG_64BIT cannot be disabled, this change actually will not affect the value of ACPI_UINT64_MAX on IA64 platforms. This patch is necessary for the ACPICA's acpidump tool to build correctly. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit e252652fb2664d42de19f933aa3688bbc470de3f)
2015-09-18drivers/leds: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Bryan Wu <cooloney@gmail.com> (cherry picked from commit 7c7d2a26dbb336ddabe53818750f4c32e2b45ddd)
2015-09-09Apalis/Colibri dtb: cleanup module connector designatorMax Krummenacher
Use consistently MXM3<space><number> or SODIMM<space><number>
2015-09-09Apalis iMX 6: cleanup filename for V1.0 HWMax Krummenacher
rename imx6q-apalis-eval_v1_0.dtb to imx6q-apalis_v1_0-eval.dtb The v1_0 denotes the Apalis module version, not the evaluation board version.
2015-09-02mxc_lcdif.c: fix commentMax Krummenacher
copy/paste error in pixelclock frequency