summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/video-backlight'Sascha Hauer2016-08-031-13/+18
|\
| * video/backlight-pwm: properly handle the case of an empty ↵iw3gtf@arcor.de2016-07-151-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'brightness-levels' in the device tree. In case of an empty 'brightness-levels' array in the device tree or a non empty one but containing only zeros the value of 'pwm_backlight->scale' would remain 0 possibly causing a division by zero in the function compute_duty_cycle(). To fix it we check the computed value in case we actually have a 'brightness-levels' array in the device tree otherwise we implicitly assume a simple array of the form { 0, 1, 2, ..., 100 } and set the scale to 100. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video/backlight-pwm: code readability improvement.iw3gtf@arcor.de2016-07-151-6/+5
| | | | | | | | | | | | | | We use the local variable 'length' instead of the lengthy 'pwm_backlight->backlight.brightness_max' within pwm_backlight_parse_dt(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video/backlight-pwm: fix the value of 'brightness_max'.iw3gtf@arcor.de2016-07-151-1/+1
| | | | | | | | | | | | | | | | The field pwm_backlight->backlight.brightness_max should be the maximum allowed brightness value for the backlight, not the max index of the array 'pwm_backlight->levels[]'. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video/backlight-pwm: fixed a loop index going out of range.iw3gtf@arcor.de2016-07-151-1/+1
| | | | | | | | | | | | | | | | In the function pwm_backlight_parse_dt() the last iteration of the for loop accessed memory past the end of the array 'pwm_backlight->levels[]' because of a wrong test ( '<=' instead of '<'). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/syscon'Sascha Hauer2016-08-031-21/+62
|\ \
| * | mfd: syscon: Use IOMEM instead of explicit castAndrey Smirnov2016-07-191-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mfd: syscon: Don't check xzalloc return for NULLAndrey Smirnov2016-07-191-2/+0
| | | | | | | | | | | | | | | | | | | | | Xzalloc never returns NULL, so this check does not bring any value. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mfd: syscon: Decouple syscon interface from platform devicesAndrey Smirnov2016-07-191-18/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow Linux Kernel change introduced in bdb0066df96e74a4002125467ebe459feff1ebef and avoid device/driver model for DT-based platforms. See the original kernel commit for the rationale. Also make syscon_base_lookup_by_pdevname() behave the same way as its kernel counterpart in the case whern "property" argument is NULL. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/net'Sascha Hauer2016-08-031-1/+1
|\ \ \
| * | | net: usb: use minimum timeout when polling for new packetsSascha Hauer2016-07-141-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | When no new packets have arrived we want to return to the caller as soon as possible to give other network controllers the chance to receive packets. With the current USB bulk message timeout of one second other network controllers do not work properly whenever the USB network controller is active. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2016-08-032-2/+5
|\ \ \
| * | | mtd: spi-nor: add new variantsAlexander Kurz2016-08-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Read access tested on W25Q20BW and MX25U4035. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx_thermal: Remove leftover debug outputAndrey Smirnov2016-07-151-2/+0
| |/ / | | | | | | | | | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2016-08-033-5/+15
|\ \ \
| * | | ARM i.MX31: add SPI supportAlexander Kurz2016-08-032-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX31 SPI interface was refered by freescale as spi_ver_0_4 in one of their older vendor extended linux releases. spi_ver_0_4 differs only in minor aspects to spi_ver_0_7 (i.MX35) which is already supported by barebox. Regarding barebox, the differences boil down to the location and length of the CHIP SELECT and BIT COUNT/BURST LENGTH elements of CONREG. The spi_ver_0_4 variant is limited to single word bursts with a maximum of 32 bits_per_word. Add support for the i.MX31 SPI interface to the barebox spi_ver_0_7 implementation. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mc13xxx: make driver-provided SPI frequency overridableAlexander Kurz2016-08-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The preset SPI frequency for mc13xxx PMIC introduced with patch 6e18b3a48ee4 ("mc13xxx: Define maximum SPI clock frequency global to driver") is not desirable or working on all boards. Provide a possibility to override the default SPI max_speed_hz from board code. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/boot'Sascha Hauer2016-08-031-1/+1
|\ \ \ \
| * | | | include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-1/+1
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / | | nand: mrvl: use ERR_CAST() for returning error pointersSascha Hauer2016-07-251-3/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ERR_CAST exists to return error pointers as error pointers without casting them explicitly to the correct pointer type. Also this Fixes: In function 'alloc_nand_resource': warning: return makes pointer from integer without a cast Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | mfd: syscon: Don't call request_iomem_region()Andrey Smirnov2016-07-191-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms that mix dedicated IP block register space with miscellaneous registers it is necessary to share register window between syscon and dedicated IP block driver. Calling request_iomem_region() implies exclusive ownership of the region, which, in the case above could not happen. This change also makes this driver's behaviour to that of its Linux kernel counterpart. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Revert "syscon: Decrease driver registration priority"Andrey Smirnov2016-07-191-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | Fixing the i.MX6 specific issue this way breaks things on CLPS711x target. Better fix for the problem is to follow this patch. This reverts commit c203958f3bbf25fc3d612497057b962e96ad1c52. Reported-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Revert "mci: imx-esdhc: Remove excess function"Sascha Hauer2016-07-141-0/+9
|/ | | | | | | | | | | This reverts commit 8a6896971d093b9d8d1c36eb0d7af891b6ca5369. With this patch it's no longer possible to call detect on the physical device which is necessary for example to make environment on MMC work. Unlike the commit message for 8a6896971d claims mci_detect_card() is not called from mci_register(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/video'Sascha Hauer2016-07-111-29/+0
|\
| * video/edid: Move int_sqrt() outAndrey Smirnov2016-06-301-29/+0
| | | | | | | | | | | | | | | | Move int_sqrt() out of drivers/video/edid.c so that it is availible to other parts of Barebox. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/ubi'Sascha Hauer2016-07-114-28/+58
|\ \
| * | mtd: UBI: Add support for updating static volumesTeresa Remmet2016-06-282-14/+54
| | | | | | | | | | | | | | | | | | | | | | | | Added support to update UBI static volumes in barebox. This is mainly realized with adding the ioctl UBI_IOCVOLUP. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: ubi: actually do work in wear leveling codeSascha Hauer2016-06-281-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual work in the wear leveling code is done in a separate thread. Since we do not have threading so far we did not do any of the queued work. Change this by calling the worker function synchronously. With this barebox now can write a fastmap on a freshly ubiformated device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: ubi: Fix endless loop when moving PEBTeresa Remmet2016-06-281-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When moving a PEB the leb_write_trylock() function is called. As the function never returns 0 UBI will end up in an endless loop. Noticed the issue when fastmap has been enabled and data is beeing copied several times to a UBI volume. When UBI tries to move the anchor PEB, the issue comes up. The leb_write_trylock() is now equal to the leb_write_lock(). But kept it for easier maintaince in future when syncing with kernel. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/state'Sascha Hauer2016-07-111-63/+2
|\ \ \
| * | | state: Refactor state frameworkMarkus Pargmann2016-07-081-63/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state framework grew organically over the time. Unfortunately the architecture and abstractions disappeared during this period. This patch refactors the framework to recreate the abstractions. The main focus was the backend with its storage. The main use-case was to offer better NAND support with less erase cycles and interchangeable data formats (dtb,raw). The general architecture now has a backend which consists of a data format and storage. The storage consists of multiple storage buckets each holding exactly one copy of the state data. A data format describes a data serialization for the state framework. This can be either dtb or raw. A storage bucket is a storage location which is used to store any data. There is a (new) circular type which writes changes behind the last written data and therefore reduces the number of erases. The other type is a direct bucket which writes directly to a storage offset for all non-erase storage. Furthermore this patch splits up all classes into different files in a subdirectory. This is currently all in one patch as I can't see a good way to split the changes up without having a non-working state framework in between. The following diagram shows the new architecture roughly: .----------. | state | '----------' | | v .----------------------------. | state_backend | |----------------------------| | + state_load(*state); | | + state_save(*state); | | + state_backend_init(...); | | | | | '----------------------------' | | The format describes | | how the state data | '-------------> is serialized | .--------------------------------------------. | | state_backend_format <INTERFACE> | | |--------------------------------------------| | | + verify(*format, magic, *buf, len); | | | + pack(*format, *state, **buf, len); | | | + unpack(*format, *state, *buf, len); | | | + get_packed_len(*format, *state); | | | + free(*format); | | '--------------------------------------------' | ^ ^ | * * | * * | .--------------------. .--------------------. | | backend_format_dtb | | backend_format_raw | | '--------------------' '--------------------' | | | v .----------------------------------------------------------. | state_backend_storage | |----------------------------------------------------------| | + init(...); | | + free(*storage); | | + read(*storage, *format, magic, **buf, *len, len_hint); | | + write(*storage, *buf, len); | | + restore_consistency(*storage, *buf, len); | '----------------------------------------------------------' | The backend storage is responsible to manage multiple data copies and distribute them onto several buckets. Read data is verified against the given format to ensure that the read data is correct. | | | | | v .------------------------------------------. | state_backend_storage_bucket <INTERFACE> | |------------------------------------------| | + init(*bucket); | | + write(*bucket, *buf, len); | | + read(*bucket, **buf, len_hint); | | + free(*bucket); | '------------------------------------------' ^ ^ ^ * * * * * * A storage bucket represents*exactly one data copy at one data location. A circular b*cket writes any new data to the end of the bucket (for *educed erases on NAND). A direct bucket directly writ*s at one location. * * * * * * * * * .-----------------------. * .-------------------------. | backend_bucket_direct | * | backend_bucket_circular | '-----------------------' * '-------------------------' ^ * ^ | * | | * | | * | | .-----------------------. | '--| backend_bucket_cached |---' '-----------------------' A backend_bucket_cached is a transparent bucket that directly uses another bucket as backend device and caches all accesses. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/mtd'Sascha Hauer2016-07-112-10/+815
|\ \ \
| * | | mtd: nand_mxs: Setup timingSascha Hauer2016-06-241-4/+808
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we relied on the default timing values which are rather slow. This patch adds the timing setup functions from the kernel. Tested on i.MX6 with a AMD/Spansion S34ML08G2 and a Micron MT29F32G08ABAAAWP. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand: Set ONFI function hooks earlierSascha Hauer2016-06-241-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the ONFI function hooks available after nand_scan_ident() but before nand_scan_tail(). Based on the kernel commit: 4204ccc mtd: set ONFI nand's default hooks in nand_set_defaults() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/misc'Sascha Hauer2016-07-118-22/+29
|\ \ \ \
| * | | | clk: fix misleading indentingLucas Stach2016-07-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | USB: gadget: composite: avoid possible NULL ptr dereferenceLucas Stach2016-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check if g is valid before trying to dereference it. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | usb: ehci: honour timeout valueSascha Hauer2016-07-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_control_msg() and usb_bulk_msg() have a timeout parameter. Honour this in the ehci driver instead of using a default timeout. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: smc911x: Add parsing devicetree optionsAlexander Shiyan2016-07-051-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds parsing basic devicetree options for the smc911x driver: reg-io-width, reg-shift and smsc,force-(in/ex)ternal-phy, which makes driver usable for most DTS-based boards. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | eeprom: at24: Use xasprintf for small allocationSascha Hauer2016-07-051-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for error checking shouldn't be bigger than the allocated string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: dm9k: Fix buswidth setting for platform data probeSascha Hauer2016-07-051-24/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | priv->buswidth expects IORESOURCE_MEM_* macros which are not identical to the integer byte bus width, so calling dm9000_setup_buswidth() for the platform_data case is wrong. fixes: d818f02 net: dm9k: add device tree support Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported by: 张忠山 <zzs213@126.com>
| * | | | mtd: nand: simplify nand_block_checkbadUwe Kleine-König2016-07-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if (A) { if (!B) return C; return D; } return C; can be simplified to: if (A && B) return D; return C; Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | input: Compile keymap only if necessaryAlexander Shiyan2016-07-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | net: phy: make locally used of_phy_register_fixed_link() staticAntony Pavlov2016-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch fixes this compiler's warning: drivers/net/phy/phy.c:303:20: warning: no previous prototype for ‘of_phy_register_fixed_link’ [-Wmissing-prototypes] Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/mips'Sascha Hauer2016-07-111-0/+86
|\ \ \ \ \
| * | | | | of: base: import of_get_cpu_node() from linux-v4.7-rc2Antony Pavlov2016-07-071-0/+86
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | | Merge branch 'for-next/imx'Sascha Hauer2016-07-115-49/+33
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | mtd: nand: imx-bbm: use raw reading when checking for factory BBMUwe Kleine-König2016-07-111-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary to prevent the imx_nand_bbm command to bail out on ECC errors which leaves the device without BBT. Also simplify buffer management: Use on-stack buffer instead of malloc. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | spi: imx: Remove the use of property "fsl, spi-num-chipselects"Alexander Shiyan2016-06-271-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "fsl,spi-num-chipselects" property will be marked obsolete soon. This patch updates the driver to be ready to such changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: imx-esdhc: Remove excess functionAlexander Shiyan2016-06-201-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function detect() is defined in the MCI core and mci_detect_card() is already called form mci_register(). Remove excess fuction. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>