summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sh-pfc: Constify all SoC dataLaurent Pinchart2013-03-1521-123/+125
| | | | | | | None of the SoC data need to be modified. Constify it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Remove configuration dry-run and freeLaurent Pinchart2013-03-155-108/+12
| | | | | | | | | | | The purpose of the dry-run is to ensure that a pin about to be configured isn't in use. However, the current implementation is a no-op. This proves that the dry-run isn't essential. Remove it. Freeing configuration then becomes a no-op as well. Remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't modify sh_pfc_pin SoC dataLaurent Pinchart2013-03-155-61/+68
| | | | | | | | | | | The sh_pfc_pin structure supplied in SoC data contains information about pin configuration and name. It's abused to store GPIO data registers information and pin config type. Move those fields out of the pinmux_data_reg structure into the new sh_pfc_gpio_pin and sh_pfc_pin_config structures. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't modify pinmux_data_reg SoC dataLaurent Pinchart2013-03-152-19/+41
| | | | | | | | | | The pinmux_data_reg structure supplied in SoC data contains information about data registers. It's abused to store per-device mapped iomem and shadow values. Move those fields out of the pinmux_data_reg structure into the per-device sh_pfc_chip structure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Drop unused support for 1:1 physical to virtual memory mappingsLaurent Pinchart2013-03-151-9/+6
| | | | | | | | | Now that all PFC platform devices provide memory resources support for registers without an associated memory resource isn't used anymore. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't map data registers individuallyLaurent Pinchart2013-03-154-53/+82
| | | | | | | | | | All data registers are located in the same memory resource. Locate the mapped resource at initializat time and use it directly instead of computing a mapped address for each register. This gets rid of the mapped_reg field of the pinmux_data_reg structure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Move GPIO registers access functions to gpio.cLaurent Pinchart2013-03-153-116/+97
| | | | | | | | | | Move the sh_pfc_setup_data_regs(), sh_pfc_setup_data_reg(), sh_pfc_get_data_reg(), sh_pfc_read_bit() and sh_pfc_write_bit() function to gpio.c as they belong to the GPIO implementation. Inline sh_pfc_read_bit() and sh_pfc_write_bit() in their only call location. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Fix return value check in sh_pfc_register_pinctrl()Wei Yongjun2013-03-151-2/+2
| | | | | | | | | | In case of error, the function pinctrl_register() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh: shx3: Add pin control resourcesLaurent Pinchart2013-03-151-3/+14
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7786: Add pin control resourcesLaurent Pinchart2013-03-151-2/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7785: Add pin control resourcesLaurent Pinchart2013-03-151-2/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7757: Add pin control resourcesLaurent Pinchart2013-03-151-1/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7724: Add pin control resourcesLaurent Pinchart2013-03-151-1/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7723: Add pin control resourcesLaurent Pinchart2013-03-151-2/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7722: Add pin control resourcesLaurent Pinchart2013-03-151-2/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7720: Add pin control resourcesLaurent Pinchart2013-03-151-2/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7269: Add pin control resourcesLaurent Pinchart2013-03-151-1/+10
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7264: Add pin control resourcesLaurent Pinchart2013-03-151-1/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh: sh7203: Add pin control resourcesLaurent Pinchart2013-03-151-1/+12
| | | | | | | | | | | Add memory resources for the pin control platform device to let the sh-pfc driver ioremap() registers properly instead of evily casting register physical addresses to virtual addresses. The memory resource address range has been extracted from the config and data registes lists in the sh-pfc driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* sh-pfc: Expose real groups and functions in pinctrl/pinmux operationsLaurent Pinchart2013-03-152-56/+93
| | | | | | | | | | | | | The sh-pfc driver exposes one fake group and function per GPIO pin. As the pinctrl and pinmux APIs are not used by any SuperH and SH Mobile board or driver, drop the fake groups and functions and replace them by a real pinctrl and pinmux implementation. Groups and functions must now be explicitly provided by PFC SoC-specific data. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* ARM: shmobile: mackerel: Replace GPIO_PORTx enum with GPIO port numbersLaurent Pinchart2013-03-151-17/+17
| | | | | | | | | The PFC GPIO API implementation moved to using port numbers. Replace all GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx enum values are identical to the port number on this platform. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* ARM: shmobile: bonito: Replace GPIO_PORTx enum with GPIO port numbersLaurent Pinchart2013-03-151-3/+3
| | | | | | | | | The PFC GPIO API implementation moved to using port numbers. Replace all GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx enum values are identical to the port number on this platform. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* ARM: shmobile: armadillo: Replace GPIO_PORTx enum with GPIO port numbersLaurent Pinchart2013-03-151-29/+29
| | | | | | | | | The PFC GPIO API implementation moved to using port numbers. Replace all GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx enum values are identical to the port number on this platform. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* ARM: shmobile: ap4-evb: Replace GPIO_PORTx enum with GPIO port numbersLaurent Pinchart2013-03-151-18/+18
| | | | | | | | | The PFC GPIO API implementation moved to using port numbers. Replace all GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx enum values are identical to the port number on this platform. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* ARM: shmobile: sh73a0: Support sparse GPIO numbersGuennadi Liakhovetski2013-03-155-75/+84
| | | | | | | | | The SH73A0 SoC has sparse GPIO numbers. Declare the pin numbers ranges in the PFC SoC data and use the pin numbers in the GPIO API. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Add support for sparse pin numbersLaurent Pinchart2013-03-155-27/+91
| | | | | | | | | | | | | The PFC driver assumes that the value of the GPIO_PORTxxx enumeration names are equal to the port number. This isn't true when the port number space is sparse, as with the SH73A0. Fix the issue by adding support for pin numbers ranges specified through SoC data. When no range is specified the driver considers that the PFC implements a single contiguous range for all pins. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Replace pinctrl_add_gpio_range() with gpiochip_add_pin_range()Laurent Pinchart2013-03-152-9/+6
| | | | | | | | Adding a GPIO range to a pinctrl device logically belongs to the GPIO driver. Switch to the right API. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Add function to retrieve a pin instance from its pin numberLaurent Pinchart2013-03-154-12/+22
| | | | | | | | This prepares support for sparse pin numbering. The function currently just performs and indexed lookup in the pins array. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Simplify the sh_pfc_gpio_is_pin() logicLaurent Pinchart2013-03-153-32/+22
| | | | | | | | The function is guaranteed to be called with a gpio number smaller than nr_pins. The condition can the be simplified, and the function inlined. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Use pinmux identifiers in the pin muxing APILaurent Pinchart2013-03-154-41/+21
| | | | | | | | | | | The PFC core exposes a sh_pfc_config_gpio() function that configures pinmuxing for a given GPIO (either a real GPIO or a function GPIO). Handling of real and function GPIOs belong to the GPIO layer, move the GPIO number to mark translation to the caller and rename the function to sh_pfc_config_mux(). Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Share the PORT_10_REV, PORT_32 and PORT_32_REV definitionsLaurent Pinchart2013-03-153-50/+32
| | | | | | | | The macros are defined identically and used in two SoC-specific files, share them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Look up IRQ table entries by GPIO numberLaurent Pinchart2013-03-157-119/+108
| | | | | | | | | Instead of converting the GPIO number to an enum_id and looking up IRQ table entries by enum_id, replace the pinmux_irq enum_ids field with a gpios field and lookup entries using the GPIO number. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Rename struct pinmux_pin to struct sh_pfc_pinLaurent Pinchart2013-03-1519-23/+22
| | | | | | | And drop the pinmux_flag_t typedef. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Split pins and functions into separate gpio_chip instancesLaurent Pinchart2013-03-153-100/+132
| | | | | | | | Register two GPIO chips, one for the real GPIOs and one for the function GPIOs. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Split pins and functions definition tablesLaurent Pinchart2013-03-1520-106/+193
| | | | | | | | | | | Split the GPIOs table into a pins table for real GPIOs and a functions table for function GPIOs. Only register pins with the pinctrl core. The function GPIOs remain accessible as GPIOs. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't needlessly check GPIO type in sh_gpio_free()Laurent Pinchart2013-03-151-4/+1
| | | | | | | | The GPIO type is always PINMUX_TYPE_FUNCTION when freeing a function GPIO. Hardcode the type value. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Shrink the pinctrl GPIO range to include real GPIOs onlyLaurent Pinchart2013-03-154-28/+59
| | | | | | | | | As a step towards GPIO function removal, shorten the GPIO range registered with the pinctrl core. Function GPIOs are now handled in the GPIO handlers directly instead of going through the pinctrl API. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Make struct pinmux_gpio enum_id field constLaurent Pinchart2013-03-151-1/+1
| | | | | | | | This ensures that the field is not modified, which is a prerequisite for the rest of the PFC refactoring work. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Initialize pinmux_gpio flags staticallyLaurent Pinchart2013-03-152-20/+15
| | | | | | | | | | | | | | All function GPIO entries are initialized with the GPIO_FN macro that expands to the PINMUX_GPIO macro, used to initialize real GPIOs. Create a PINMUX_GPIO_FN macro that duplicates PINMUX_GPIO and sets flags to PINMUX_TYPE_FUNCTION and use it in GPIO_FN, and make PINMUX_GPIO set flags to PINMUX_TYPE_GPIO. This removes the need to initialize GPIO flags at runtime and thus simplifies the code, preparing for the GPIO and functions split. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Remove unused sh_pfc_soc_info reserved_id fieldLaurent Pinchart2013-03-1517-17/+0
| | | | | | | The field is unused, remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Replace SoC info data and mark ranges with a number of pinsLaurent Pinchart2013-03-1518-44/+36
| | | | | | | | | | | | | | | The data and mark ranges are only used to check whether a GPIO corresponds to a real pin or a function. As pins come first in the list of GPIOs and in the platform-specific GPIO enumerations, we can replace the data and mark ranges by a number of pins. Add an nr_pins field to struct sh_pfc_soc_info to store the number of pins implemented by the SoC, remove the data and mark range fields and introduce sh_pfc_gpio_is_pin() and sh_pfc_gpio_is_function() functions to replace range-based checks. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Replace first_gpio and last_gpio with nr_gpiosLaurent Pinchart2013-03-1520-68/+43
| | | | | | | | | | The SoC information first_gpio field is always equal to 0, and the last_gpio field is the index of the last entry in the pinmux_gpios array. Replace the first_gpio and last_gpio fields by a nr_gpios field, and initialize it to ARRAY_SIZE(pinmux_gpios). Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Use GPIO_FN instead of PINMUX_GPIO where possibleLaurent Pinchart2013-03-1511-2410/+2409
| | | | | | | | | | | | | The GPIO_FN macro expands to the PINMUX_GPIO macro. The regular expression to 'unexpand' PINMUX_GPIO to GPIO_FN is s/\tPINMUX_GPIO(GPIO_FN_\([A-Z0-9_]*\),[ \t]*\1_MARK)/\tGPIO_FN(\1)/ This consolidates SoC-specific PFC information to use the same macros for all SoCs. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't take the sh_pfc spinlock in sh_pfc_map_gpios()Laurent Pinchart2013-03-151-5/+0
| | | | | | | | | The sh_pfc_map_gpios() function is only called at initialization time when no other task can access the sh_pfc fields. Don't protect the operation with a spinlock. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Drop the sh_pfc_pinctrl spinlockLaurent Pinchart2013-03-151-13/+0
| | | | | | | | The spinlock is used to protect data that is only accessed sequentially during initialization. Remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Fix a typo and simplify a definition on sh73a0Guennadi Liakhovetski2013-03-151-6/+2
| | | | | | | | | Fix definition of the SDHIWP0 function and simplify the CPU_ALL_PORT definition on sh73a0. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Don't define the per-device pinctrl struct instances as globalLaurent Pinchart2013-03-151-22/+18
| | | | | | | | | The pinctrl_desc and pinctrl_gpio_range structures registered with the pinctrl core are per-device instances. Move them to the dynamically allocated sh_pfc_pinctrl structure and initialize them at runtime. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* sh-pfc: Declare operation structures as constLaurent Pinchart2013-03-151-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> Acked-by: Linus Walleij <linus.walleij@linaro.org>
* Merge branch 'fixes' of ↵Simon Horman2013-03-154-6/+5
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl into pinmux-base
| * pinctrl: generic: Fix compilation errorSachin Kamat2013-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The function definition of pinconf_generic_dump_config is defined under CONFIG_DEBUG_FS macro. Define the declaration too under this macro. Without this patch we get the following build error: drivers/built-in.o: In function `pcs_pinconf_config_dbg_show': drivers/pinctrl/pinctrl-single.c:726: undefined reference to `pinconf_generic_dump_config' Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
OpenPOWER on IntegriCloud