summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-abx500.c
Commit message (Collapse)AuthorAgeFilesLines
* pinctrl: abx500: rework error pathPatrice Chotard2013-06-241-27/+87
| | | | | | | | At several places, return value was not tested and error output was missing. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: suppress hardcoded valuePatrice Chotard2013-06-241-4/+17
| | | | | | | Replace hardcoded value by corresponding #define's. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: factorize codePatrice Chotard2013-06-241-17/+15
| | | | | | | | Factorize code by adding abx500_pullud_supported() which improve code readability. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix abx500_gpio_get()Patrice Chotard2013-06-241-2/+15
| | | | | | | | | - allow to get output GPIO value - as there is no GPIO0 on ABX500, use correct offset with abx500_gpio_get_bit() Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix abx500_pin_config_set()Patrice Chotard2013-06-241-6/+25
| | | | | | | | | | | - Update abx500_pin_config_set() in order to take in account PIN_CONFIG_BIAS_DISABLE state to disable pull up or pull down. - Rework error path. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: Add device tree supportPatrice Chotard2013-06-241-0/+184
| | | | | | | | | | | We use the same way to define pin muxing and pin configuration than for nomadik. So pickup code from pinctrl_nomadik.c to be able to implement pin multiplexing and pin configuration using the device tree. Pin configuration uses generic parsing code. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix build warningPatrice Chotard2013-06-161-1/+1
| | | | | | | | | pinctrl-abx500.c: In function 'abx500_gpio_dbg_show_one': pinctrl-abx500.c:534:14: warning: 'pud' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix abx500_gpio_dbg_show_one() to show pull up/downPatrice Chotard2013-06-161-16/+70
| | | | | | | | | | - rework abx500_gpio_dbg_show_one() to take in account pull up/down feature available on AB8540 only. - add abx500_get_pull_updown() needed by abx500_gpio_dbg_show_one() - rename abx500_config_pull_updown() to abx500_set_pull_updown() Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: allow to set pull upPatrice Chotard2013-06-161-1/+23
| | | | | | | | | | On ABx500 chip family, all pins support only pull down except for AB8540 which supports pull up/down on some pins. Rework abx500_pin_config_set to be able to set pull up on pins which support this feature. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix abx500_config_pull_updownPatrice Chotard2013-06-161-1/+1
| | | | | | | | Fix abx500_config_pull_updown() to set correct bit in AB8540_GPIO_PULL_UPDOWN_REG. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: suppress unused mutexPatrice Chotard2013-06-161-10/+0
| | | | | | | | | Suppress a mutex which was initialized on probe and destroyed on remove but never used. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: Rejiggle platform data and DT initialisationLee Jones2013-05-141-14/+13
| | | | | | | | | | | | | | | | | | | | | | | Platform Data is invariably populated for this driver, even when booting with Device Tree. Thus the Device Tree probing code encased within the first check for Platform Data will never executed, causing the driver to fail when DT is enabled. This patch fixes the aforementioned regression by rejigging the probe() semantics to attempt to extract a platform ID from Device Tree if one can not be sourced from platform data. A pointer to GPIO platform data is always passed to the driver now, so there's little point in checking for 'pdata' and executing the DT case if it's not there. The difference between booting with DT and !DT is when booting with DT, plat_id is not populated. Thus, in the DT case we have to use a DT match table in order to find out which platform we're executing on. So, we're changing the semantics here to only use the match table if no plat_id is supplied though platform data. Signed-off-by: Lee Jones <lee.jones@linaro.org> [edited commit message] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: Specify failed sub-driver by ID instead of driver_dataLee Jones2013-05-141-2/+1
| | | | | | | | | | If a sub-driver has not been specified correctly, there is a good chance that plat_id is NULL, hence using an attribute of plat_id in the error message is likely to not only fail the driver but Oops the kernel. Use the failed ID instead. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: fix issue when no pdataPatrice CHOTARD2013-04-181-1/+0
| | | | | | | | Fix an issue when probing pinctrl-abx500 with no platform data. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: abx500: Staticize some symbolsSachin Kamat2013-04-091-5/+5
| | | | | | | | | | | | | | | | | | | These symbols are used only in this file. Without this patch we get the following warnings: drivers/pinctrl/pinctrl-abx500.c:520:5: warning: symbol 'abx500_gpio_request' was not declared. Should it be static? drivers/pinctrl/pinctrl-abx500.c:527:6: warning: symbol 'abx500_gpio_free' was not declared. Should it be static? drivers/pinctrl/pinctrl-abx500.c:614:5: warning: symbol 'abx500_gpio_request_enable' was not declared. Should it be static? drivers/pinctrl/pinctrl-abx500.c:714:5: warning: symbol 'abx500_pin_config_get' was not declared. Should it be static? drivers/pinctrl/pinctrl-abx500.c:721:5: warning: symbol 'abx500_pin_config_set' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* Merge tag 'v3.9-rc5' into develLinus Walleij2013-04-031-1/+1
|\ | | | | | | | | | | | | Linux 3.9-rc5 Conflicts: drivers/pinctrl/pinconf.c
| * pinctrl: abx500: Fix checking if pin use AlternateFunction registerAxel Lin2013-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | It's pointless to check "af.alt_bit1 == UNUSED" twice. This looks like a copy-paste bug, I think what we want is to check if *both* af.alt_bit1 and af.alt_bit2 are UNUSED. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | pinctrl: abx500: Add terminating entry for of_device_id tableAxel Lin2013-03-071-0/+1
| | | | | | | | | | | | | | The of_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | pinctrl: Declare operation structures as constLaurent Pinchart2013-03-071-3/+3
|/ | | | | | | | The pinconf, pinctrl and pinmux operation structures hold function pointers that are never modified. Declare them as const. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: use direct IRQ definesLinus Walleij2013-02-101-2/+1
| | | | | | | | | Make it harder to do mistakes by introducing the actual defined ABx500 IRQ number into the IRQ cluster definitions. Deduct cluster offset from the GPIO offset to make each cluster coherent. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: replace IRQ offsets with table read-in valuesLee Jones2013-02-101-7/+11
| | | | | | | | | | | | | | | | | | The ABx500 GPIO controller used to provide a set of virtual contiguous IRQs for use by sub-devices, but they have been removed after a request from Mainline Maintainers. Now the AB8500 core driver deals with almost all IRQ related issues instead. The ABx500 GPIO driver is now only used to convert between GPIO and IRQ numbers which is actually quite difficult, as the ABx500 GPIO's associated IRQs are clustered together throughout the interrupt number space at irregular intervals. To solve this quandary, we have placed the read-in values into the existing cluster information table to use during conversion. Signed-off-by: Lee Jones <lee.jones@linaro.org> [Moved irq_base removal into this patch] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: move IRQ handling to ab8500-coreLee Jones2013-02-101-296/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In its current state the gpio-ab8500 driver looks after some GPIO lines found on the AB8500 MFD chip. It also controls all of its own IRQ handling for these GPIOs by inventing some virtual IRQs and handing those out to sub-devices. There has been quite a bit of controversy over this and it was a contributing factor to the driver being marked as BROKEN in Mainline. The reason for adopting this method was due to added complexity in the hardware. Unusually, each GPIO has two separate IRQs associated with it, one for a rising and a different one for a falling interrupt. Using this method complicates matters further because the GPIO IRQs are actually sandwiched between a bunch of IRQs which are handled solely by the AB8500 core driver. The best way for us to take this forward is to get rid of the virtual IRQs and only hand out the rising IRQ lines. If a sub-driver wishes to request a falling interrupt, they can do so by requesting a rising line in the normal way. They just have to add IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH, if they require both in the flags. Then if a falling IRQ is triggered, the AB8500 core driver will know how to handle the added complexity accordingly. This should greatly simply things. Signed-off-by: Lee Jones <lee.jones@linaro.org> [Augment to keep irq_base for a while (removed later)] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: adjust offset for get_mode()Linus Walleij2013-02-071-1/+3
| | | | | | | | | | The set_mode() and get_mode() functions in the abx500 were not mirrored, leading to the wrong GPIO control bits being read out. Cc: Lee Jones <lee.jones@linaro.org> Reported-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: add Device Tree supportLee Jones2013-02-061-5/+31
| | | | | | | | This patch will allow the ABX500 Pinctrl driver to be probed when Device Tree is enabled with an appropriate node contained. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: align GPIO cluster boundariesLee Jones2013-02-061-2/+4
| | | | | | | | | | | | | | | | Not quite sure how this ever worked. In ab8500_gpio_to_irq() the GPIO for conversion is passed through as the second argument. If GPIO13, which is a valid GPIO for IRQ functionality, was received; it would be rejected by the following guard: GPIO_IRQ_CLUSTER(5, 12, 0); /* GPIO numbers start from 1 */ if (offset >= cluster->start && offset <= cluster->end) /* Valid GPIO for IRQ use */ Signed-off-by: Lee Jones <lee.jones@linaro.org> [Augmented to account for off-by-one problem] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: prevent error path from corrupting returning errorLee Jones2013-02-061-4/+5
| | | | | | | | | | | | | Prior to this patch abx500_gpio_probe() would return the return-value of gpiochip_remove() during its error patch regardless of what the actual failure was. So as long as gpiochip_remove() succeeded, probe() would look like it succeeded too. This patch ensures the correct error value is returned and that mutex_destroy() is invoked if gpiochip_add_pin_range() were to fail. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: destroy mutex if returning early due to errorLee Jones2013-02-051-0/+3
| | | | | | | | | Current failure path neglects to mutex_destroy() before returning an error due to an invalid parameter or an error received from gpiochip_add(). This patch aims to remedy that behaviour. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: beautify the ABX500 pin control driverLee Jones2013-02-051-35/+59
| | | | | | | | | | | | This patch provides some superficial changes to the driver to aid with readability and maintainability. We're mostly fixing things like white-space errors, spreading out code which as been clumped together impeding readability and comment layout, such as using the new "/**" comment start for function headers etc. No code semantics were harmed in the making of this patch. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: replace incorrect return valueLee Jones2013-02-051-2/+1
| | | | | | | | | | | Currently in the empty abx500_pin_config_get() function, we're returning -EINVAL, with a comment stating that the reason for the failure is that the function isn't implemented yet. Well there's a proper return code for that. If we use it, we can do away with the comment too, as it would be implied. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: use the BIT() macro where appropriateLee Jones2013-02-051-1/+1
| | | | | | | | | | The BIT() macro provides a simple and easy to read way of obtaining bit offsets into things like masks and hardware registers. In this patch we're simply replacing all instances of '1 << x' with 'bit(x)'. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: add AB8540 sub-driverPatrice Chotard2013-02-051-0/+3
| | | | | | | | | | | | | Add AB8540 sub driver to the ABx500 family, pins, pin groups and gpio range. As the pin controller (also the ABx500 controllers) is an inherent part of the SoC and will prevent boot if not available, select this from the Ux500 SoC Kconfig. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: add AB9540 sub-driverPatrice Chotard2013-02-051-0/+3
| | | | | | | | | | | | | Add AB9540 sub driver to the ABx500 family, pins, pin groups and gpio range. As the pin controller (also the ABx500 controllers) is an inherent part of the SoC and will prevent boot if not available, select this from the Ux500 SoC Kconfig. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: add AB8505 sub-driverPatrice Chotard2013-02-051-0/+3
| | | | | | | | | | | | Add AB8505 sub driver to the ABx5x family. As the pin controller (also the ABx500 controllers) is an inherent part of the SoC and will prevent boot if not available, select this from the Ux500 SoC Kconfig. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/abx500: add AB8500 sub-driverPatrice Chotard2013-01-301-0/+3
| | | | | | | | | | | | This adds a subdriver for the AB8500 pinctrl portions. As the pin controller (also the ABx500 controllers) is an inherent part of the SoC and will prevent boot if not available, select this from the Ux500 SoC Kconfig. Acked-by: Olof Johansson <olof@lixom.net> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: add abx500 pinctrl driver corePatrice Chotard2013-01-301-0/+1233
This adds the AB8500 core driver, which will be utilized by the follow-on drivers for different ABx500 variants. Sselect the driver from the DBX500_SOC, as this chip is powering and clocking that SoC. Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
OpenPOWER on IntegriCloud