summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-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-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-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-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-08-24input: touchscreen: added platform data for Fusion touchscreenStefan Agner
Added platform data struct to define interrupt and reset GPIO. This allows to initialize the touchscreen controller inside the driver rather then in each platform and use the driver as a module.
2015-05-29sync.h: synchronization framework needs this headerDaniel Kochmanski
2015-05-29mfd: stmpe: add ADC block resourcesStefan Agner
In order to use the auxiliar ADC inputs of STMPE811 devices we need to add resources for the ADC block. Also move the ADC macros from the touchscreen driver to the general header file. We will need them for the ADC driver in future. Conflicts: drivers/mfd/stmpe.c
2015-05-29rfkill-regulator: add dt supportTroy Kisky
2015-05-29Add support for DVI monitorsRobert Winkler
Signed-off-by: Robert Winkler <robert.winkler@boundarydevices.com>
2015-02-11MLK-10179-1 usb: chipidea: add a flag for turn on vbus early for hostLi Jun
Some PHY of imx usb need power supply from vbus to make it work, if there is no vbus, USB PHY will not in correct state when the controller starts to work, for host, this requires vbus should be turned on before setting port power(PP) of ehci, to work with this kind of USB PHY design, this patch adds a flag CI_HDRC_IMX_VBUS_EARLY_ON, can be checked by host driver to turn on vbus while start host. Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit 1d4c054323817b49897fd7a59bc57b4d36f09491)
2015-02-11PM / Domains: Add APIs to attach/detach a PM domain for a deviceUlf Hansson
To maintain scalability let's add common methods to attach and detach a PM domain for a device, dev_pm_domain_attach|detach(). Typically dev_pm_domain_attach() shall be invoked from subsystem level code at the probe phase to try to attach a device to its PM domain. The reversed actions may be done a the remove phase and then by invoking dev_pm_domain_detach(). When attachment succeeds, the attach function should assign its corresponding detach function to a new ->detach() callback added in the struct dev_pm_domain. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Kevin Hilman <khilman@linaro.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 46420dd73b800f87a19af13af5883855cf38cb08) (cherry picked from commit 451a5b00e51410adc16f8349ed753f7eced46bc5)
2015-02-11PM / Domains: Add a detach callback to the struct dev_pm_domainUlf Hansson
The intent of this callback is to simplify detachment of devices from their PM domains. Further patches will show the benefit. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit c3099a5294f2c7266234e8ea35cbffc20a41aa9a) (cherry picked from commit 96257e7b72821bbaa5681b1d2042050c6aab0ea1)
2015-02-11PM / Domains: Add generic OF-based PM domain look-upTomasz Figa
This patch introduces generic code to perform PM domain look-up using device tree and automatically bind devices to their PM domains. Generic device tree bindings are introduced to specify PM domains of devices in their device tree nodes. Backwards compatibility with legacy Samsung-specific PM domain bindings is provided, but for now the new code is not compiled when CONFIG_ARCH_EXYNOS is selected to avoid collision with legacy code. This will change as soon as the Exynos PM domain code gets converted to use the generic framework in further patch. This patch was originally submitted by Tomasz Figa when he was employed by Samsung. Link: http://marc.info/?l=linux-pm&m=139955349702152&w=2 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit aa42240ab2544a8bcb2efb400193826f57f3175e) (cherry picked from commit 4a2d7a846761e3b86e08b903e5a1a088686e2181)
2015-02-11PM / domains: Remove genpd_queue_power_off_work() APIUlf Hansson
There are no active users of this API. Let's remove it and if future needs shows up we could consider to have a get/put API instead. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit d971f0b0eaaf3f2086bf21bbd64f7ea7e2f28459) (cherry picked from commit 835729a13d0061f55d6bd714811a16ebaecb9b0e)
2015-02-11PM / domains: Remove pm_genpd_syscore_switch() APIUlf Hansson
The pm_genpd_syscore_poweroff() API and pm_genpd_syscore_poweron() API makes the pm_genpd_syscore_switch() API redundant. Moreover, since there are no active users, let's just remove it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit d47e6464ae6c96735d4706f5cb0537fe717b6b00) (cherry picked from commit 9b68cd944341e5a613e9858e65e3432bd5691f92)
2015-02-11PM / domains: Remove dev_irq_safe from genpd configUlf Hansson
The genpd dev_irq_safe configuration somewhat overlaps with the runtime PM pm_runtime_irq_safe() option. Also, currently genpd don't have a good way to deal with these device. So, until we figured out if and how to support this in genpd, let's remove the option to configure it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit c5d79ec2a5715489cff16a0d1cf4fa9108a5509e) (cherry picked from commit 4cffcdb2c92cabbba3e55a0f2d9c7d86d8a756ed)
2015-02-11PM / domains: Remove system PM callbacks from gpd_dev_opsUlf Hansson
There no users of these callbacks, let's simplify the generic power domain by removing them. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 1e0407ca54d28db8e5f02e437ff21cc6416c0be8) (cherry picked from commit 0f19454e606c6fbc7ce980ca128a703ebc8990fb)
2015-02-11PM / domains: Ignore callbacks for subsys generic_pm_domain_dataUlf Hansson
In a step of simplifying the generic power domain let's move away from using these callbacks. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 67da6d4bf43c4208433ef8f3ee487401b4dc9c74) (cherry picked from commit b16a428836529af31f23b807065cc6e643c409da)
2015-02-11PM / domains: Remove the pm_genpd_add|remove_callbacks APIsUlf Hansson
There are no users of these APIs. To simplify the generic power domain let's remove them. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 55e15c949fd05d247a889df0ed0177a676fec665) (cherry picked from commit da452fc0f1a1a75993a6c989a600dd2de309026c)
2015-02-11MLK-10238-1: Revert "base: power: Add generic OF-based power domain look-up"Robin Gong
This reverts commit 4aa055cb0634bc8d0389070104fe6aa7cfa99b8c. Signed-off-by: Robin Gong <b38343@freescale.com> (cherry picked from commit e599f64de890a60a3b9884dd5838c43472f145e2)
2015-02-02MLK-10138: Revert "MLK-10047: hdmi: Add hotplug detect for DVI monitors"Sandor Yu
This reverts commit e88c775a272b4f7af1a2fec8736fea9a55e58472. Some HDMI TV not support rxsense as hotplug interrupter source. Signed-off-by: Sandor Yu <R01008@freescale.com>
2015-01-29MLK-10174-1 arm: imx: gpc: export an interface to keep mega fast powerLi Jun
Add an interface for GPC used by drivers to keep mega fast mix domain power. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-01-28MLK-10161-3: ARM: imx6sx: Add SPDIF_GCLK clock in clock treeShengjiu Wang
As spdif driver will register SPDIF clock to regmap, regmap will do clk_prepare in init function, so SPDIF clock is prepared in probe, then its root clock (pll clock) is prepared also, which cause the arm can't enter low power mode. Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock. Its root clock is ipg clock, and register it to regmap, then the issue can be fixed. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-01-28MLK-10161-2: ARM: imx6sl: Add SPDIF_GCLK clock in clock treeShengjiu Wang
As spdif driver will register SPDIF clock to regmap, regmap will do clk_prepare in init function, so SPDIF clock is prepared in probe, then its root clock (pll clock) is prepared also, which cause the arm can't enter low power mode. Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock. Its root clock is ipg clock, and register it to regmap, then the issue can be fixed. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-01-28MLK-10161-1: ARM: imx6q: Add SPDIF_GCLK clock in clock treeShengjiu Wang
As spdif driver will register SPDIF clock to regmap, regmap will do clk_prepare in init function, so SPDIF clock is prepared in probe, then its root clock (pll clock) is prepared also, which cause the arm can't enter low power mode. Add SPDIF_GCLK in clock tree which share same gate bits with SPDIF clock. Its root clock is ipg clock, and register it to regmap, then the issue can be fixed. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-01-28MLK-10101-4 usb: add otg_fsm pointer in usb_busLi Jun
Add otg_fsm pointer in struct of usb_bus for access otg_fsm via bus. Original way was to put it in usb_otg, then usb host can access otg_fsm via hcd->usb_phy->otg->fsm, since usb_phy will not be the future direction, instead phy is prefered, so this way may not work. It's more direct and simple to put it in usb_bus. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-01-28MLK-9617-1 usb: otg: update otg descriptor definition for OTG and EH 2.0Li Jun
Add one field bcdOTG for OTG and EH supplement release number in OTG descriptor according to On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification Revision 2.0 version 1.1a. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 1bf5e829100a2922826818bd8cbb18ee81452cfc)
2015-01-28ENGR00292408-1 usb: chipidea: add query_available_role interfacePeter Chen
The glue layer may need to know current available role, add ci_hdrc_query_available_role for that. Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit 5c340402131ca6eacaeb122deb1ee59bcea2778c)
2015-01-26MLK-10139 Add support for crypto/caam to imx6qdl dtsVictoria Milhoan
This patch adds the imx6qdl.dtsi DTS support for crypto/caam. CAAM clocking support is also included. Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
2015-01-27MLK-9785-2 usb: chipidea: add AHB configuration interfacePeter Chen
The AHBBRST at SBUSCFG and RX/TX burst size at BURSTSIZE are implementation dependent, each platform may have different values, and some values may not be optimized. The glue layer can override ahb burst configuration value by setting flag CI_HDRC_OVERRIDE_AHB_BURST and ahbburst_config. The glue layer can override RX/TX burst size by setting flag CI_HDRC_OVERRIDE_BURST_LENGTH and burst_length. Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit a6bf7a97a83a58b9fe6de91975e4203c235036be)
2015-01-27MLK-9770-2 usb: chipidea: define stream mode disable for both rolesPeter Chen
The chipidea IP has different limitations for host and device mode, see below errata, we may need to enable SDIS(Stream Disable Mode) at host mode, but we don't want it at device mode at some situations. TAR 9000378958 Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry Impacted Configuration: Host mode, all transfer types Description: The host core operating in streaming mode may under run while sending the data packet of an OUT transaction. This under run can occur if there are unexpected system delays in fetching the remaining packet data from memory. The host forces a bad CRC on the packet, the device detects the error and discards the packet. The host then retries a Bulk, Interrupt, or Control transfer if an under run occurs according to the USB specification. During simulations, it was found that the host does not issue the retry of the failed bulk OUT. It does not issue any other transactions except SOF packets that have incorrect frame numbers. The second failure mode occurs if the under run occurs on an ISO OUT transaction and the next ISO transaction is a zero byte packet. The host does not issue any transactions (including SOFs). The device detects a Suspend condition, reverts to full speed, and waits for resume signaling. A third failure mode occurs when the host under runs on an ISO OUT and the next ISO in the schedule is an ISO OUT with two max packets of 1024 bytes each. The host should issue MDATA for the first OUT followed by DATA1 for the second. However, it drops the MDATA transaction, and issues the DATA1 transaction. The system impact of this bug is the same regardless of the failure mode observed. The host core hangs, the ehci_ctrl state machine waits for the protocol engine to send the completion status for the corrupted transaction, which never occurs. No indication is sent to the host controller driver, no register bits change and no interrupts occur. Eventually the requesting application times out. Detailed internal behavior: The EHCI control state machine (ehci_ctrl) in the DMA block is responsible for parsing the schedules and initiating all transactions. The ehci_ctrl state machine passes the transaction details to the protocol block by writing the transaction information in to the TxFIFO. It then asserts the pe_hst_run_pkt signal to inform the host protocol state machine (pe_hst_state) that there is a packet in the TxFIFO. A tag of 0x0 indicates a start of packet with the data providing the following information: 35:32 Tag 31:30 Reserved 29:23 Endpoint (lowest 4 bits) 22:16 Address 15:10 Reserved 9:8 Endpoint speed 7:6 Endpoint type 5:6 Data Toggle 3:0 PID The pe_hst_state reads the packet information and constructs the packet and issues it to the PHY interface. The ehci_ctrl state machine writes the start transaction information in to the TxFIFO as 0x03002910c for the OUT packet that had the under run error. However, it writes 0xC3002910C for the retry of the Out transaction, which is incorrect. The pe_hst_state enters a bus timeout state after sending the bad CRC for the packet that under ran. It then purges any data that was back filled in to the TxFIFO for the packet that under ran. The pe_hst_state machine stops purging the TxFIFO when it is empty or if it reads a location that has a tag of 0x0, indicating a start of packet command. The pe_hst_state reads 0xC3002910C and discards it as it does not decode to a start of packet command. It continues to purge the OUT data that has been pre-buffered for the OUT retry . The pe_hst_state detects the hst_packet_run signal and attempts to read the PID and address information from the TxFIFO. This location has packet data and so does not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD state where the frame_num_counter is updated. The frame_num_counter is updated with the data in the TxFIFO. In this case, the data is incorrect as the ehci_ctrl state machine did not initiate the load. The hst_pe_state machine detects the SOF request signal and sends an SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine waits indefinitely in the run_pkt state waiting for the completion status from pe_hst_state machine, which will never happen. The ISO failure case is similar except that there is no retry for ISO. The ehci_ctrl state machine moves to the next transfer in the periodic schedule. If the under run occurs on the last entry of the periodic list then it moves to the Async schedule. In the case of ISO OUT simulations, the next ISO is a zero byte OUT and again the start of packet command gets corrupted. The TxFIFO is empty when the hst_pe_state attempts to read the Address and PID information as the transaction is a zero byte packet. This results in the hst_pe_state machine staying in the GET_PID state, which means that it does not issue any transactions (including SOFs). The device detects a Suspend condition and reverts to full speed mode and waits for a Resume or Reset signal. The EHCI specification allows a Non-DoubleWord (32 bits) offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. In Non-DoubleWord aligned cases, the core reads the packet data from the AHB memory, performs the alignment operation before writing it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP) is written to the TxFIFO after all the packet data has been written in to the TxFIFO. The alignment function is reset to Idle by the EOP tag. The corruption of the start of packet command arises because the packet buffer for the OUT transaction that under ran is not aligned to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The alignment function is still active when the start packet information is written in to the TxFIFO for the retry of the bulk packet or for the next transaction in the case of an under run on an ISO. This results in the corruption of the start tag and the transaction information. Click for waveform showing the command 0x 0000300291 being written in to the TX FIFO for the Out that under ran. Click for waveform showing the command 0xC3002910C written to the TxFIFO instead of 0x 0000300291 Versions affected: Versions 2.10a and previous versions How discovered: Customer simulation Workaround: 1- The EHCI specification allows a non-DoubleWord offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. However, if a DoubleWord offset is used then this issue does not arise. 2- Use non streaming mode to eliminate under runs. Resolution: The fix involves changes to the traffic state machine in the vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context information by encoding the transaction results on the hst_op_context_update signals at the end of a transaction. The signal hst_op_context_update is added to the traffic state machine, and the tx_fifo_under_ran_r signal is generated if the transaction results in an under run error. Click for waveform The traffic state machine then traverses to the do_eop states if the tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to the TxFIFO as shown in this waveform . The EOP tag resets the align state machine to the Idle state ensuring that the next command written by the echi_ctrl state machine does not get corrupted. File(s) modified: RTL code fixed: ….. Method of reproducing: This failure cannot be reproduced in the current test bench. Date Found: March 2010 Date Fixed: June 2010 Update information: Added the RTL code fix Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit 9bbed86327e015a28f7e680784bb00dd7c83533d)
2015-01-26MLK-10086-4 usb: chipidea: imx: add HSIC supportLi Jun
Add imx6 HSIC support Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-01-21ENGR00319720-3 usb: common: otg-fsm: add HNP polling request sending funcitonLi Jun
This patch adds OTG status selector request sending function, can be used to poll peripheral if it wants to be host. Signed-off-by: Li Jun <b47624@freescale.com>