summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-nomadik.c
Commit message (Collapse)AuthorAgeFilesLines
* pinctrl/nomadik: always use the simple irqdomainLinus Walleij2012-10-151-10/+3
| | | | | | | | | | Since the simple irqdomain will fall back to a linear domain if the first_irq provided is <= 0, just use this, just make sure the first_irq is negative in the device tree case. Cc: Rob Herring <rob.herring@calxeda.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: provide stubs for legacy NomadikLinus Walleij2012-10-151-0/+13
| | | | | | | | | | | | | | | | The compilation of the pinctrl driver failed on the legacy Nomadik NHK8815 platform because it was not providing the PRCMU interfaces needed to support the extended alternate functions used by the ux500 series. Solve this by providing some stubs for the legacy platform, to avoid too much #ifdefs in the code per se. Theoretically this actually allows the Nomadik and Ux500 to have a single kernel image with support for the PRCM registers on the Ux500 (though they have incompatible archs, but the spirit is there). Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: use simple or linear IRQ domainLinus Walleij2012-10-101-3/+13
| | | | | | | | | | | | | | This alters the Nomadik pinctrl driver to: - Call irqdomain_add_linear() for the DT case so we get all independent from IRQ numbers in this case. - Call irqdomain_add_simple() for the legacy case, which allocates the IRQ descriptors for the Nomadik pin controller dynamically. Cc: Lee Jones <lee.jones@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: support other alternate-C functionsJean-Nicolas Graux2012-10-101-2/+99
| | | | | | | | | | | | | | | | | Upgrade nomadik pinctrl driver to enable selection of other alternate-C[1-4] functions on some specific ux500 SoC pins. Handling of those functions is done thanks to PRCM GPIOCR registers. This was previously managed in PRCMU driver and it was not really convenient. Idea is to provide a common way to control all alternate functions. Note that this improvement does not support the old-fashioned way used to control nomadik pins, namely the "nmk_config_pin()" function and its derivatives. Signed-off-by: Jean-Nicolas Graux <jean-nicolas.graux@stericsson.com> Reviewed-by: Philippe Langlais <philippe.langlais@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: use irq_find_mapping()Linus Walleij2012-09-281-3/+1
| | | | | | | | | | The code was using a homegrown method of looking up the offset from the irq domain, not to be encouraged. Use the proper irq_find_mapping() call instead. Cc: Lee Jones <lee.jones@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: MASK_ON_SUSPENDEtienne Carriere2012-09-031-0/+1
| | | | | | | | | | | | | | | | | | | ux500 machines performs pins (GPIO) reconfiguration when entering in the suspended mode. This reconfiguration aims at reaching an ultra low power HW configuration. Due to this HW reconfiguration, some HW devices can change of HW state and have their output signals at level that could generate IRQs. If the non-wakeup IRQs are disabled but not yet masked (delayed interrupt disable feature from the generic irq layer), effective interrupts reach the system only because the system attempt to enter the suspended mode. To prevent such IRQs to trig, all irq chips embedded in ux500 platform should enable their IRQCHIP_MASK_ON_SUSPEND flag. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: add STn8815 ASIC supportLinus Walleij2012-09-031-0/+2
| | | | | | | | This adds support for the STN8815 ASIC for the Nomadik pin controller. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: add ASIC DB8450 pinctrl driverPatrice Chotard2012-09-031-0/+3
| | | | | | | | | This implements a subdriver for the DB8540 ASIC for the Nomadik pin controller. Signed-off-by: Patrice Chotard <patrice.chotard@stericsson.com> Reviewed-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: fix null in irqdomain errorpathLinus Walleij2012-08-171-1/+1
| | | | | | | | | | | The irqdomain conversion failed to notice that we do not always have a DT node to dereference, fix this up by using a simple dev_err() that also tells the name of the device. Cc: Loic Pallardy <loic.pallardy@st.com> Cc: Patrice Chotard <patrice.chotard@stericsson.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc'd dataJulia Lawall2012-08-071-1/+0
| | | | | | | | | | | | | | | | | | | | devm_kfree should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,d; @@ x = devm_kzalloc(...) ... ?-devm_kfree(d,x); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* Merge tag 'pinctrl-for-v3.6' of ↵Linus Torvalds2012-07-241-27/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control changes from Linus Walleij: "These are the accumulated pin control patches for v3.6: - Various cleanups to the U300 driver - Refactor the pin control core to automatically remove any GPIO ranges when the drivers are removed, instead of having the drivers do this explicitly. - Add a function for registering a batch of GPIO ranges. - Fix a number of incorrect but non-regressive error checks. - Incremental improvements to the COH901, i.MX and Nomadik drivers - Add a one-register-per-pin entirely Device Tree-based pin control driver from Tony Lindgren." * tag 'pinctrl-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: Add one-register-per-pin type device tree based pinctrl driver pinctrl/nomadik: add spi2_oc1_2 pin group pinctrl/nomadik: kerneldoc fix pinctrl/nomadik: use devm_* allocators for gpio probe pinctrl/nomadik: add pin group to mco function pinctrl/nomadik: add hsit_a_2 pin group pinctrl/nomadik: add pin group smcs1 and smps0 pinctrl/nomadik: fix hsir_a_1_pins pin list pinctrl: pinctrl-imx: fix map setting problem if NO_PAD_CTL is set pinctrl/coh901: use clk_prepare_[en|dis]able() pinctrl/pinctrl-tegra: remove IS_ERR checking of pmx->pctl pinctrl/pinctrl-spear: remove IS_ERR checking of pmx->pctl pinctrl/u300: drop unused variable pinctrl: select the proper symbol pinctrl: add pinctrl_add_gpio_ranges function pinctrl: remove pinctrl_remove_gpio_range pinctrl/pinctrl-core: cleanup pinctrl_register pinctrl/u300: delete pointless debug print pinctrl/pinctrl-u300: remove devm_kfree at driver unload
| * pinctrl/nomadik: kerneldoc fixLinus Walleij2012-07-041-1/+1
| | | | | | | | | | | | Document a missing function parameter to nmk_config_pin(). Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * pinctrl/nomadik: use devm_* allocators for gpio probeLinus Walleij2012-07-041-26/+9
| | | | | | | | | | | | | | | | | | The GPIO portions of the Nomadik pinctrl driver was not using the managed devm_* interfaces, lets' use them consequently and cut down the error path and special case handling. Acked-by: Patrice Chotard <patrice.chotard@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific ↵Lee Jones2012-07-131-1/+1
|/ | | | | | | | | | | | prefixes Any non-standard property should contain the vendor's identifier which should be perpended onto the property name followed by a comma. This aids in name-space collision prevention. This patch ensures the sleepmode property adheres to the rules. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* pinctrl/nomadik: document Alt-C glitchLinus Walleij2012-06-171-1/+21
| | | | | | | | | This documentation comment existed in an earlier patch set for GPIO consolidation, so I'm saving it for maintainability of the code. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: nomadik: fix up typoLinus Walleij2012-06-121-1/+1
| | | | | | | | | | | | | | | Commit a60b57eddaa8af6c02cf7bbeb58ebf82881f08ac "drivers/gpio: gpio-nomadik: Add support for irqdomains" changed GPIO offset calculations to have this form: (gpio % NMK_GPIO_PER_CHIP) except in this one place for setting sleep mode, where the conversion was all wrong, and instead mod:ing the GPIO with the IRQ base which does not make any sense. So fix this up so we can use sleepmode. Reviewed-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
* pinctrl: nomadik: add clk_prepare() callLinus Walleij2012-06-121-0/+1
| | | | | | | We now strictly require clk_prepare() calls to be issued before any clk_enable() calls. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl-nomadik: Allow Device Tree driver probingLee Jones2012-06-011-1/+19
| | | | | | | | | | The Nomadik GPIO controller now relies on Nomadik pinctrl, however the pinctrl driver is not currently started by any ux500 platform. This is requred or GPIOs do not work at all. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* pinctrl/nomadik: implement pin configurationLinus Walleij2012-05-111-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the pin configuration interface for the Nomadik pin controller. As part of the exercise we add a bit in the pin_cfg_t for the Nomadik pinctrl driver that indicates if the pin should be forced into GPIO mode. This is not done to go behind the back of the GPIO subsystem, but to ensure that default modes can be set by hogs on boot and system suspend/resume states. It was used implicitly by the old code defining all config settings and modes in a single config word but we now have a split between pinmux and pinconf leading to the need to have this. We also add a bit for explicitly setting sleepmode of the pin. This was previously handled by custom calls with the _sleep() suffix, but we now have one single interface into the configuration so we replace this with a bit indicating that the pin shall be configured into sleep mode. Some of the configuration can be refactored later to use less custom fields on the pin_cfg_t but we are currently leaving the old function calls in place so we stay compatible. ChangeLog v1->v2: - Drop a hunk changing pinmuxing for GPIO and move it over to the preceding pinmux patch. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: implement pin multiplexingLinus Walleij2012-05-111-0/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements basic pinmux for the Nomadik pin controller. The plan is to split the existing singular pin config interface nmk_config_pin(), nmk_config_pins(), that will configure muxing and other settings at the same time, into two interfaces by splitting the code in pinmux and pinctrl and eventually deleting the old interface and its helper functions when all users are gone. nmk_gpio_set_mode() and nmk_gpio_get_mode() are two older interfaces for just configuring muxing/altfunctions that will also be replaced in the end. We take some extra care to handle the glitch-avoidance here, but it is simpler now since there is only one altsetting per pingroup so we know immediately if we need to avoid altfunc C glitches for a certain group. As part of the makeover implement the .request() and .free() calls on the GPIO chips and have them call back into the pinctrl layer to reserve GPIOs. ChangeLog v1->v2: - Rebased on pinctrl-mergebase-20120418 so we get the latest driver infrastructure where function count is done by a fixed value and we can drop a few range checks since this is now handled by the core. - Include a GPIO muxing hunk erroneously part of the pin config patch. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: reuse GPIO debug function for pinsLinus Walleij2012-05-111-1/+27
| | | | | | | | | Since all pins we can control are GPIOs, match a GPIO range to each pin in the debug function and call into the GPIO debug print function to have the per-pin information. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: break out single GPIO debug functionLinus Walleij2012-05-111-48/+57
| | | | | | | | Break out the code displaying the status of a single pin so we can use the same code in the pinctrl debug function. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: basic Nomadik pinctrl interfaceLinus Walleij2012-05-111-1/+121
| | | | | | | | | | | | | | | | | | This adds a scratch pin control interface to the Nomadik pinctrl driver, and defines the pins and groups in the DB8500 ASIC. We define GPIO ranges to cover the pins exposed. The DB8500 has more pins than this but we restrict the driver to the pins that can be controlled from the combined GPIO and pin control hardware to begin with. ChangeLog v1->v2: - Base on the latest pinctrl development from pinctrl-mergebase-20120418 so we can get rid of legacy group count mechanism. Also drop the range checks for group index, this is handled by the core now. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl/nomadik: !CONFIG_OF build errorArnd Bergmann2012-05-111-0/+2
| | | | | | | | | | | | | | | | | | | a60b57e "drivers/gpio: gpio-nomadik: Add support for irqdomains" broke building with CONFIG_OF_GPIO disabled. Without this patch, building nhk8815_defconfig results in: /home/arnd/linux-arm/drivers/gpio/gpio-nomadik.c: In function 'nmk_gpio_probe': /home/arnd/linux-arm/drivers/gpio/gpio-nomadik.c:1238:6: error: 'struct gpio_chip' has no member named 'of_node' make[3]: *** [drivers/gpio/gpio-nomadik.o] Error 1 make[2]: *** [drivers/gpio] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [drivers] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [sub-make] Error 2 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: move the Nomadik GPIO driver to pinctrlLinus Walleij2012-05-111-0/+1306
I'm moving this driver over to the pinctrl subsystem to convert the custom pin mux/config scheme over to use pinctrl. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
OpenPOWER on IntegriCloud