mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Pin control bulk changes for the v4.11 kernel cycle:
Core changes:
- Switch the generic pin config argument from 16 to 24 bits,
only use 8 bits for the configuration type. We might need to
encode more information about a certain setting than we need
to encode different generic settings.
- Add a cross-talk API to the pin control GPIO back-end,
utilizing pinctrl_gpio_set_config() from GPIO drivers that
want to set up a certain pin configuration in the back-end.
This also includes the .set_config() refactoring of the
GPIO chips, so that they pass a generic configuration for
things like debouncing and single ended (typically open
drain). This change has also been merged in an immutable
branch to the GPIO tree.
- Take hogs with a delayed work, so that we finalize probing
a pin controller before trying to get any hogs.
- For pin controllers putting all group and function definitions
into the device tree, we now have generic code to deal with
this and it is used in two drivers so far.
- Simplifications of the pin request conflict check.
- Make dt_free_map() optional.
Updates to drivers:
- pinctrl-single now use the generic helpers to generate dynamic
group and function tables from the device tree.
- Texas Instruments IOdelay configuration driver add-on to
pinctrl-single.
- i.MX: use radix trees to store groups and functions, use the new
generic group and function helpers to manage them.
- Intel: add support for hardware debouncing and 1K pull-down.
New subdriver for the Gemini Lake SoC.
- Renesas SH-PFC: drive strength and bias support, CAN bus muxing,
MSIOF, SDHI, HSCIF for r8a7796. Gyro-ADC supporton r8a7791.
- Aspeed: use syscon cross-dependencies to set up related bits in
the LPC host controller and display controller.
- Aspeed: finalize G4 and G5 support. Fix mux configuration on
GPIOs. Add banks Y, Z, AA, AB and AC.
- AMD: support additional GPIO.
- STM32: set this controller to strict muxing mode.
STM32H743 MCU support.
- Allwinner sunxi: deep simplifications on how to support
subvariants of SoCs without adding to much SoC-specific data
for each subvariant, especially for sun5i variants. New driver
for V3s SoCs. New driver for the H5 SoC. Support A31/A31s
variants with the new variant framework.
- Mvebu: simplifications to use a MMIO and regmap abstraction.
New subdrivers for the 98DX3236, 98DX5241 SoCs.
- Samsung Exynos: delete Exynos4415 support. Add crosstalk to the
SoC driver to access regmaps. Add infrastructure for pin-bank
retention control. Clean out the pin retention control from
arch/arm/mach-exynos and arch/arm/mach-s5p and put it properly
in the Samsung pin control driver(s).
- Meson: add HDMI HPD/DDC pins. Add pwm_ao_b pin.
- Qualcomm: use raw spinlock variants: this makes the qualcomm
driver realtime-safe.
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJYq/7kAAoJEEEQszewGV1zf4oQALVaN5tuaCbzN4QOq87jzXmk
K195kKG0nkNvN6o5llNhBszHfCSmX1+oSscxuCF/88kH4mFHeDIbvg0KOk5IZYxA
YlT8NA75C9+flARE3gQUyL320ulahWbvOthntQprzsVU4RJa0zP38peQsfiUd8W1
ch8GInJYYkczcsAbmziyUOBu5a2o9tX3u8BF8FaBf2uyrCiBC/ZT2VpzvbOR5NeU
MvjFvc7bq2fNltzDNHdZZUo/5iCbnPlRNig2umDp5fFa8rZcdPmGMAOl4p6nizHY
S16xDl38xxDQx8sp1IH4n+th3G2cXoONEj9eZ6woWTJhLbLc13CacYPfleYfqEOe
+JyrUgBgFBINiFWDHHaebWJeD2M/QF4FnSDGnnJBy/bKWe6lJnknGvSZNcIEvdvB
QeeKyfrvnKiCyjNY4N+ZNdMLA2vj5o86vG2hSqztPiwYWDePbN76yeZ7l79bFfOo
ZnCa2ay70Np7xwrQWors4Gl2LV2zJG7AkaNA7vvS9NX6OURu/SkNVePkY1XHCLwu
lNvYd4iwFJxzXm08TsgtLC080eZfvCot9xqbgzvoapnwx7tBuaAakXI4bh0T3x4n
pEauKO3oNE/K89mN9QK2jfsD9kDWvm4xvc+ilA6DGU0C37XnDQjF+Q5xy16262Gh
9w0yWMlqzrr7stUXAjS4
=IMY0
-----END PGP SIGNATURE-----
Merge tag 'pinctrl-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij:
"Pin control bulk changes for the v4.11 kernel cycle.
Core changes:
- Switch the generic pin config argument from 16 to 24 bits, only use
8 bits for the configuration type. We might need to encode more
information about a certain setting than we need to encode
different generic settings.
- Add a cross-talk API to the pin control GPIO back-end, utilizing
pinctrl_gpio_set_config() from GPIO drivers that want to set up a
certain pin configuration in the back-end.
This also includes the .set_config() refactoring of the GPIO chips,
so that they pass a generic configuration for things like
debouncing and single ended (typically open drain). This change has
also been merged in an immutable branch to the GPIO tree.
- Take hogs with a delayed work, so that we finalize probing a pin
controller before trying to get any hogs.
- For pin controllers putting all group and function definitions into
the device tree, we now have generic code to deal with this and it
is used in two drivers so far.
- Simplifications of the pin request conflict check.
- Make dt_free_map() optional.
Updates to drivers:
- pinctrl-single now use the generic helpers to generate dynamic
group and function tables from the device tree.
- Texas Instruments IOdelay configuration driver add-on to
pinctrl-single.
- i.MX: use radix trees to store groups and functions, use the new
generic group and function helpers to manage them.
- Intel: add support for hardware debouncing and 1K pull-down. New
subdriver for the Gemini Lake SoC.
- Renesas SH-PFC: drive strength and bias support, CAN bus muxing,
MSIOF, SDHI, HSCIF for r8a7796. Gyro-ADC supporton r8a7791.
- Aspeed: use syscon cross-dependencies to set up related bits in the
LPC host controller and display controller.
- Aspeed: finalize G4 and G5 support. Fix mux configuration on GPIOs.
Add banks Y, Z, AA, AB and AC.
- AMD: support additional GPIO.
- STM32: set this controller to strict muxing mode. STM32H743 MCU
support.
- Allwinner sunxi: deep simplifications on how to support subvariants
of SoCs without adding to much SoC-specific data for each
subvariant, especially for sun5i variants. New driver for V3s SoCs.
New driver for the H5 SoC. Support A31/A31s variants with the new
variant framework.
- Mvebu: simplifications to use a MMIO and regmap abstraction. New
subdrivers for the 98DX3236, 98DX5241 SoCs.
- Samsung Exynos: delete Exynos4415 support. Add crosstalk to the SoC
driver to access regmaps. Add infrastructure for pin-bank retention
control. Clean out the pin retention control from
arch/arm/mach-exynos and arch/arm/mach-s5p and put it properly in
the Samsung pin control driver(s).
- Meson: add HDMI HPD/DDC pins. Add pwm_ao_b pin.
- Qualcomm: use raw spinlock variants: this makes the qualcomm driver
realtime-safe"
* tag 'pinctrl-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (111 commits)
pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data()
pinctrl: intel: unlock on error in intel_config_set_pull()
pinctrl: berlin: make bool drivers explicitly non-modular
pinctrl: spear: make bool drivers explicitly non-modular
pinctrl: mvebu: make bool drivers explicitly non-modular
pinctrl: sunxi: make sun5i explicitly non-modular
pinctrl: sunxi: Remove stray printk call in sun5i driver's probe function
pinctrl: samsung: mark PM functions as __maybe_unused
pinctrl: sunxi: Remove redundant A31s pinctrl driver
pinctrl: sunxi: Support A31/A31s with pinctrl variants
pinctrl: Amend bindings for STM32 pinctrl
pinctrl: Add STM32 pinctrl driver DT bindings
pinctrl: stm32: Add STM32H743 MCU support
include: dt-bindings: Add STM32H7 pinctrl DT defines
gpio: aspeed: Remove dependence on GPIOF_* macros
pinctrl: stm32: fix bad location of gpiochip_lock_as_irq
drivers: pinctrl: add driver for Allwinner H5 SoC
pinctrl: intel: Add Intel Gemini Lake pin controller support
pinctrl: intel: Add support for 1k additional pull-down
pinctrl: intel: Add support for hardware debouncer
...
This commit is contained in:
commit
5ab356626f
143 changed files with 14077 additions and 3931 deletions
|
|
@ -8,9 +8,16 @@ config PINCTRL
|
|||
menu "Pin controllers"
|
||||
depends on PINCTRL
|
||||
|
||||
config GENERIC_PINCTRL_GROUPS
|
||||
bool
|
||||
|
||||
config PINMUX
|
||||
bool "Support pin multiplexing controllers" if COMPILE_TEST
|
||||
|
||||
config GENERIC_PINMUX_FUNCTIONS
|
||||
bool
|
||||
select PINMUX
|
||||
|
||||
config PINCONF
|
||||
bool "Support pin configuration controllers" if COMPILE_TEST
|
||||
|
||||
|
|
@ -159,8 +166,8 @@ config PINCTRL_ROCKCHIP
|
|||
config PINCTRL_SINGLE
|
||||
tristate "One-register-per-pin type device tree based pinctrl driver"
|
||||
depends on OF
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select GENERIC_PINCONF
|
||||
help
|
||||
This selects the device tree based generic pinctrl driver.
|
||||
|
|
@ -293,6 +300,7 @@ source "drivers/pinctrl/spear/Kconfig"
|
|||
source "drivers/pinctrl/stm32/Kconfig"
|
||||
source "drivers/pinctrl/sunxi/Kconfig"
|
||||
source "drivers/pinctrl/tegra/Kconfig"
|
||||
source "drivers/pinctrl/ti/Kconfig"
|
||||
source "drivers/pinctrl/uniphier/Kconfig"
|
||||
source "drivers/pinctrl/vt8500/Kconfig"
|
||||
source "drivers/pinctrl/mediatek/Kconfig"
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc/
|
|||
obj-$(CONFIG_PINCTRL_SPEAR) += spear/
|
||||
obj-$(CONFIG_PINCTRL_STM32) += stm32/
|
||||
obj-$(CONFIG_PINCTRL_SUNXI) += sunxi/
|
||||
obj-y += ti/
|
||||
obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/
|
||||
obj-$(CONFIG_ARCH_VT8500) += vt8500/
|
||||
obj-$(CONFIG_PINCTRL_MTK) += mediatek/
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -14,6 +14,12 @@
|
|||
#include "../core.h"
|
||||
#include "pinctrl-aspeed.h"
|
||||
|
||||
static const char *const aspeed_pinmux_ips[] = {
|
||||
[ASPEED_IP_SCU] = "SCU",
|
||||
[ASPEED_IP_GFX] = "GFX",
|
||||
[ASPEED_IP_LPC] = "LPC",
|
||||
};
|
||||
|
||||
int aspeed_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct aspeed_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
|
@ -78,7 +84,8 @@ int aspeed_pinmux_get_fn_groups(struct pinctrl_dev *pctldev,
|
|||
static inline void aspeed_sig_desc_print_val(
|
||||
const struct aspeed_sig_desc *desc, bool enable, u32 rv)
|
||||
{
|
||||
pr_debug("SCU%x[0x%08x]=0x%x, got 0x%x from 0x%08x\n", desc->reg,
|
||||
pr_debug("Want %s%X[0x%08X]=0x%X, got 0x%X from 0x%08X\n",
|
||||
aspeed_pinmux_ips[desc->ip], desc->reg,
|
||||
desc->mask, enable ? desc->enable : desc->disable,
|
||||
(rv & desc->mask) >> __ffs(desc->mask), rv);
|
||||
}
|
||||
|
|
@ -88,10 +95,11 @@ static inline void aspeed_sig_desc_print_val(
|
|||
*
|
||||
* @desc: The signal descriptor of interest
|
||||
* @enabled: True to query the enabled state, false to query disabled state
|
||||
* @regmap: The SCU regmap instance
|
||||
* @regmap: The IP block's regmap instance
|
||||
*
|
||||
* @return True if the descriptor's bitfield is configured to the state
|
||||
* selected by @enabled, false otherwise
|
||||
* Return: 1 if the descriptor's bitfield is configured to the state
|
||||
* selected by @enabled, 0 if not, and less than zero if an unrecoverable
|
||||
* failure occurred
|
||||
*
|
||||
* Evaluation of descriptor state is non-trivial in that it is not a binary
|
||||
* outcome: The bitfields can be greater than one bit in size and thus can take
|
||||
|
|
@ -99,14 +107,19 @@ static inline void aspeed_sig_desc_print_val(
|
|||
* descriptor (typically this means a different function to the one of interest
|
||||
* is enabled). Thus we must explicitly test for either condition as required.
|
||||
*/
|
||||
static bool aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc,
|
||||
static int aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc,
|
||||
bool enabled, struct regmap *map)
|
||||
{
|
||||
int ret;
|
||||
unsigned int raw;
|
||||
u32 want;
|
||||
|
||||
if (regmap_read(map, desc->reg, &raw) < 0)
|
||||
return false;
|
||||
if (!map)
|
||||
return -ENODEV;
|
||||
|
||||
ret = regmap_read(map, desc->reg, &raw);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
aspeed_sig_desc_print_val(desc, enabled, raw);
|
||||
want = enabled ? desc->enable : desc->disable;
|
||||
|
|
@ -119,10 +132,10 @@ static bool aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc,
|
|||
*
|
||||
* @expr: An expression controlling the signal for a mux function on a pin
|
||||
* @enabled: True to query the enabled state, false to query disabled state
|
||||
* @regmap: The SCU regmap instance
|
||||
* @maps: The list of regmap instances
|
||||
*
|
||||
* @return True if the expression composed by @enabled evaluates true, false
|
||||
* otherwise
|
||||
* Return: 1 if the expression composed by @enabled evaluates true, 0 if not,
|
||||
* and less than zero if an unrecoverable failure occurred.
|
||||
*
|
||||
* A mux function is enabled or disabled if the function's signal expression
|
||||
* for each pin in the function's pin group evaluates true for the desired
|
||||
|
|
@ -135,19 +148,21 @@ static bool aspeed_sig_desc_eval(const struct aspeed_sig_desc *desc,
|
|||
* neither the enabled nor disabled state. Thus we must explicitly test for
|
||||
* either condition as required.
|
||||
*/
|
||||
static bool aspeed_sig_expr_eval(const struct aspeed_sig_expr *expr,
|
||||
bool enabled, struct regmap *map)
|
||||
static int aspeed_sig_expr_eval(const struct aspeed_sig_expr *expr,
|
||||
bool enabled, struct regmap * const *maps)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
for (i = 0; i < expr->ndescs; i++) {
|
||||
const struct aspeed_sig_desc *desc = &expr->descs[i];
|
||||
|
||||
if (!aspeed_sig_desc_eval(desc, enabled, map))
|
||||
return false;
|
||||
ret = aspeed_sig_desc_eval(desc, enabled, maps[desc->ip]);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -158,19 +173,24 @@ static bool aspeed_sig_expr_eval(const struct aspeed_sig_expr *expr,
|
|||
* configured
|
||||
* @enable: true to enable an function's signal through a pin's signal
|
||||
* expression, false to disable the function's signal
|
||||
* @map: The SCU's regmap instance for pinmux register access.
|
||||
* @maps: The list of regmap instances for pinmux register access.
|
||||
*
|
||||
* @return true if the expression is configured as requested, false otherwise
|
||||
* Return: 0 if the expression is configured as requested and a negative error
|
||||
* code otherwise
|
||||
*/
|
||||
static bool aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
|
||||
bool enable, struct regmap *map)
|
||||
static int aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
|
||||
bool enable, struct regmap * const *maps)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < expr->ndescs; i++) {
|
||||
bool ret;
|
||||
const struct aspeed_sig_desc *desc = &expr->descs[i];
|
||||
u32 pattern = enable ? desc->enable : desc->disable;
|
||||
u32 val = (pattern << __ffs(desc->mask));
|
||||
|
||||
if (!maps[desc->ip])
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* Strap registers are configured in hardware or by early-boot
|
||||
|
|
@ -179,64 +199,79 @@ static bool aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
|
|||
* deconfigured and is the reason we re-evaluate after writing
|
||||
* all descriptor bits.
|
||||
*/
|
||||
if (desc->reg == HW_STRAP1 || desc->reg == HW_STRAP2)
|
||||
if ((desc->reg == HW_STRAP1 || desc->reg == HW_STRAP2) &&
|
||||
desc->ip == ASPEED_IP_SCU)
|
||||
continue;
|
||||
|
||||
ret = regmap_update_bits(map, desc->reg, desc->mask,
|
||||
pattern << __ffs(desc->mask)) == 0;
|
||||
ret = regmap_update_bits(maps[desc->ip], desc->reg,
|
||||
desc->mask, val);
|
||||
|
||||
if (!ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return aspeed_sig_expr_eval(expr, enable, map);
|
||||
ret = aspeed_sig_expr_eval(expr, enable, maps);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!ret)
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool aspeed_sig_expr_enable(const struct aspeed_sig_expr *expr,
|
||||
struct regmap *map)
|
||||
static int aspeed_sig_expr_enable(const struct aspeed_sig_expr *expr,
|
||||
struct regmap * const *maps)
|
||||
{
|
||||
if (aspeed_sig_expr_eval(expr, true, map))
|
||||
return true;
|
||||
int ret;
|
||||
|
||||
return aspeed_sig_expr_set(expr, true, map);
|
||||
ret = aspeed_sig_expr_eval(expr, true, maps);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!ret)
|
||||
return aspeed_sig_expr_set(expr, true, maps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool aspeed_sig_expr_disable(const struct aspeed_sig_expr *expr,
|
||||
struct regmap *map)
|
||||
static int aspeed_sig_expr_disable(const struct aspeed_sig_expr *expr,
|
||||
struct regmap * const *maps)
|
||||
{
|
||||
if (!aspeed_sig_expr_eval(expr, true, map))
|
||||
return true;
|
||||
int ret;
|
||||
|
||||
return aspeed_sig_expr_set(expr, false, map);
|
||||
ret = aspeed_sig_expr_eval(expr, true, maps);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ret)
|
||||
return aspeed_sig_expr_set(expr, false, maps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a signal on a pin by disabling all provided signal expressions.
|
||||
*
|
||||
* @exprs: The list of signal expressions (from a priority level on a pin)
|
||||
* @map: The SCU's regmap instance for pinmux register access.
|
||||
* @maps: The list of regmap instances for pinmux register access.
|
||||
*
|
||||
* @return true if all expressions in the list are successfully disabled, false
|
||||
* otherwise
|
||||
* Return: 0 if all expressions are disabled, otherwise a negative error code
|
||||
*/
|
||||
static bool aspeed_disable_sig(const struct aspeed_sig_expr **exprs,
|
||||
struct regmap *map)
|
||||
static int aspeed_disable_sig(const struct aspeed_sig_expr **exprs,
|
||||
struct regmap * const *maps)
|
||||
{
|
||||
bool disabled = true;
|
||||
int ret = 0;
|
||||
|
||||
if (!exprs)
|
||||
return true;
|
||||
|
||||
while (*exprs) {
|
||||
bool ret;
|
||||
|
||||
ret = aspeed_sig_expr_disable(*exprs, map);
|
||||
disabled = disabled && ret;
|
||||
|
||||
while (*exprs && !ret) {
|
||||
ret = aspeed_sig_expr_disable(*exprs, maps);
|
||||
exprs++;
|
||||
}
|
||||
|
||||
return disabled;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -246,8 +281,8 @@ static bool aspeed_disable_sig(const struct aspeed_sig_expr **exprs,
|
|||
* @exprs: List of signal expressions (haystack)
|
||||
* @name: The name of the requested function (needle)
|
||||
*
|
||||
* @return A pointer to the signal expression whose function tag matches the
|
||||
* provided name, otherwise NULL.
|
||||
* Return: A pointer to the signal expression whose function tag matches the
|
||||
* provided name, otherwise NULL.
|
||||
*
|
||||
*/
|
||||
static const struct aspeed_sig_expr *aspeed_find_expr_by_name(
|
||||
|
|
@ -330,6 +365,7 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
|
|||
unsigned int group)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
const struct aspeed_pinctrl_data *pdata =
|
||||
pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct aspeed_pin_group *pgroup = &pdata->groups[group];
|
||||
|
|
@ -343,6 +379,8 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
|
|||
const struct aspeed_sig_expr **funcs;
|
||||
const struct aspeed_sig_expr ***prios;
|
||||
|
||||
pr_debug("Muxing pin %d for %s\n", pin, pfunc->name);
|
||||
|
||||
if (!pdesc)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -358,8 +396,9 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
|
|||
if (expr)
|
||||
break;
|
||||
|
||||
if (!aspeed_disable_sig(funcs, pdata->map))
|
||||
return -EPERM;
|
||||
ret = aspeed_disable_sig(funcs, pdata->maps);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
prios++;
|
||||
}
|
||||
|
|
@ -377,8 +416,9 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
|
|||
return -ENXIO;
|
||||
}
|
||||
|
||||
if (!aspeed_sig_expr_enable(expr, pdata->map))
|
||||
return -EPERM;
|
||||
ret = aspeed_sig_expr_enable(expr, pdata->maps);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -414,6 +454,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
struct pinctrl_gpio_range *range,
|
||||
unsigned int offset)
|
||||
{
|
||||
int ret;
|
||||
const struct aspeed_pinctrl_data *pdata =
|
||||
pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct aspeed_pin_desc *pdesc = pdata->pins[offset].drv_data;
|
||||
|
|
@ -432,8 +473,9 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
if (aspeed_gpio_in_exprs(funcs))
|
||||
break;
|
||||
|
||||
if (!aspeed_disable_sig(funcs, pdata->map))
|
||||
return -EPERM;
|
||||
ret = aspeed_disable_sig(funcs, pdata->maps);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
prios++;
|
||||
}
|
||||
|
|
@ -462,10 +504,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
* If GPIO is not the lowest priority signal type, assume there is only
|
||||
* one expression defined to enable the GPIO function
|
||||
*/
|
||||
if (!aspeed_sig_expr_enable(expr, pdata->map))
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
return aspeed_sig_expr_enable(expr, pdata->maps);
|
||||
}
|
||||
|
||||
int aspeed_pinctrl_probe(struct platform_device *pdev,
|
||||
|
|
@ -481,10 +520,10 @@ int aspeed_pinctrl_probe(struct platform_device *pdev,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
pdata->map = syscon_node_to_regmap(parent->of_node);
|
||||
if (IS_ERR(pdata->map)) {
|
||||
pdata->maps[ASPEED_IP_SCU] = syscon_node_to_regmap(parent->of_node);
|
||||
if (IS_ERR(pdata->maps[ASPEED_IP_SCU])) {
|
||||
dev_err(&pdev->dev, "No regmap for syscon pincontroller parent\n");
|
||||
return PTR_ERR(pdata->map);
|
||||
return PTR_ERR(pdata->maps[ASPEED_IP_SCU]);
|
||||
}
|
||||
|
||||
pctl = pinctrl_register(pdesc, &pdev->dev, pdata);
|
||||
|
|
|
|||
|
|
@ -232,6 +232,11 @@
|
|||
* group.
|
||||
*/
|
||||
|
||||
#define ASPEED_IP_SCU 0
|
||||
#define ASPEED_IP_GFX 1
|
||||
#define ASPEED_IP_LPC 2
|
||||
#define ASPEED_NR_PINMUX_IPS 3
|
||||
|
||||
/*
|
||||
* The "Multi-function Pins Mapping and Control" table in the SoC datasheet
|
||||
* references registers by the device/offset mnemonic. The register macros
|
||||
|
|
@ -255,13 +260,16 @@
|
|||
#define SCUA0 0xA0 /* Multi-function Pin Control #7 */
|
||||
#define SCUA4 0xA4 /* Multi-function Pin Control #8 */
|
||||
#define SCUA8 0xA8 /* Multi-function Pin Control #9 */
|
||||
#define SCUAC 0xAC /* Multi-function Pin Control #10 */
|
||||
#define HW_STRAP2 0xD0 /* Strapping */
|
||||
|
||||
/**
|
||||
* A signal descriptor, which describes the register, bits and the
|
||||
* enable/disable values that should be compared or written.
|
||||
*
|
||||
* @reg: The register offset from base in bytes
|
||||
* @ip: The IP block identifier, used as an index into the regmap array in
|
||||
* struct aspeed_pinctrl_data
|
||||
* @reg: The register offset with respect to the base address of the IP block
|
||||
* @mask: The mask to apply to the register. The lowest set bit of the mask is
|
||||
* used to derive the shift value.
|
||||
* @enable: The value that enables the function. Value should be in the LSBs,
|
||||
|
|
@ -270,6 +278,7 @@
|
|||
* LSBs, not at the position of the mask.
|
||||
*/
|
||||
struct aspeed_sig_desc {
|
||||
unsigned int ip;
|
||||
unsigned int reg;
|
||||
u32 mask;
|
||||
u32 enable;
|
||||
|
|
@ -313,24 +322,30 @@ struct aspeed_pin_desc {
|
|||
|
||||
/* Macro hell */
|
||||
|
||||
#define SIG_DESC_IP_BIT(ip, reg, idx, val) \
|
||||
{ ip, reg, BIT_MASK(idx), val, (((val) + 1) & 1) }
|
||||
|
||||
/**
|
||||
* Short-hand macro for describing a configuration enabled by the state of one
|
||||
* bit. The disable value is derived.
|
||||
* Short-hand macro for describing an SCU descriptor enabled by the state of
|
||||
* one bit. The disable value is derived.
|
||||
*
|
||||
* @reg: The signal's associated register, offset from base
|
||||
* @idx: The signal's bit index in the register
|
||||
* @val: The value (0 or 1) that enables the function
|
||||
*/
|
||||
#define SIG_DESC_BIT(reg, idx, val) \
|
||||
{ reg, BIT_MASK(idx), val, (((val) + 1) & 1) }
|
||||
SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, val)
|
||||
|
||||
#define SIG_DESC_IP_SET(ip, reg, idx) SIG_DESC_IP_BIT(ip, reg, idx, 1)
|
||||
|
||||
/**
|
||||
* A further short-hand macro describing a configuration enabled with a set bit.
|
||||
* A further short-hand macro expanding to an SCU descriptor enabled by a set
|
||||
* bit.
|
||||
*
|
||||
* @reg: The configuration's associated register, offset from base
|
||||
* @idx: The configuration's bit index in the register
|
||||
* @reg: The register, offset from base
|
||||
* @idx: The bit index in the register
|
||||
*/
|
||||
#define SIG_DESC_SET(reg, idx) SIG_DESC_BIT(reg, idx, 1)
|
||||
#define SIG_DESC_SET(reg, idx) SIG_DESC_IP_BIT(ASPEED_IP_SCU, reg, idx, 1)
|
||||
|
||||
#define SIG_DESC_LIST_SYM(sig, func) sig_descs_ ## sig ## _ ## func
|
||||
#define SIG_DESC_LIST_DECL(sig, func, ...) \
|
||||
|
|
@ -500,7 +515,7 @@ struct aspeed_pin_desc {
|
|||
MS_PIN_DECL_(pin, SIG_EXPR_LIST_PTR(gpio))
|
||||
|
||||
struct aspeed_pinctrl_data {
|
||||
struct regmap *map;
|
||||
struct regmap *maps[ASPEED_NR_PINMUX_IPS];
|
||||
|
||||
const struct pinctrl_pin_desc *pins;
|
||||
const unsigned int npins;
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ static int bcm281xx_std_pin_update(struct pinctrl_dev *pctldev,
|
|||
struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
|
||||
int i;
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
|
|
@ -1222,7 +1222,7 @@ static int bcm281xx_i2c_pin_update(struct pinctrl_dev *pctldev,
|
|||
struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
|
||||
int i, j;
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
|
|
@ -1292,7 +1292,7 @@ static int bcm281xx_hdmi_pin_update(struct pinctrl_dev *pctldev,
|
|||
struct bcm281xx_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev);
|
||||
int i;
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ static int iproc_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
{
|
||||
struct iproc_gpio *chip = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
unsigned i, gpio = iproc_pin_to_gpio(pin);
|
||||
int ret = -ENOTSUPP;
|
||||
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ static int ns2_pin_get_enable(struct pinctrl_dev *pctrldev, unsigned int pin)
|
|||
}
|
||||
|
||||
static int ns2_pin_set_slew(struct pinctrl_dev *pctrldev, unsigned int pin,
|
||||
u16 slew)
|
||||
u32 slew)
|
||||
{
|
||||
struct ns2_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrldev);
|
||||
struct ns2_pin *pin_data = pctrldev->desc->pins[pin].drv_data;
|
||||
|
|
@ -793,7 +793,7 @@ static void ns2_pin_get_pull(struct pinctrl_dev *pctrldev,
|
|||
}
|
||||
|
||||
static int ns2_pin_set_strength(struct pinctrl_dev *pctrldev, unsigned int pin,
|
||||
u16 strength)
|
||||
u32 strength)
|
||||
{
|
||||
struct ns2_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrldev);
|
||||
struct ns2_pin *pin_data = pctrldev->desc->pins[pin].drv_data;
|
||||
|
|
@ -904,7 +904,7 @@ static int ns2_pin_config_set(struct pinctrl_dev *pctrldev, unsigned int pin,
|
|||
struct ns2_pin *pin_data = pctrldev->desc->pins[pin].drv_data;
|
||||
enum pin_config_param param;
|
||||
unsigned int i;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
int ret = -ENOTSUPP;
|
||||
|
||||
if (pin_data->pin_conf.base == -1)
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ static const struct pinctrl_ops nsp_pctrl_ops = {
|
|||
.dt_free_map = pinctrl_utils_free_map,
|
||||
};
|
||||
|
||||
static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u16 slew)
|
||||
static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u32 slew)
|
||||
{
|
||||
if (slew)
|
||||
nsp_set_bit(chip, IO_CTRL, NSP_GPIO_SLEW_RATE_EN, gpio, true);
|
||||
|
|
@ -403,7 +403,7 @@ static void nsp_gpio_get_pull(struct nsp_gpio *chip, unsigned gpio,
|
|||
}
|
||||
|
||||
static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio,
|
||||
u16 strength)
|
||||
u32 strength)
|
||||
{
|
||||
u32 offset, shift, i;
|
||||
u32 val;
|
||||
|
|
@ -522,7 +522,7 @@ static int nsp_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
{
|
||||
struct nsp_gpio *chip = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
unsigned int i, gpio;
|
||||
int ret = -ENOTSUPP;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
|
@ -227,7 +227,6 @@ static const struct of_device_id berlin2_pinctrl_match[] = {
|
|||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, berlin2_pinctrl_match);
|
||||
|
||||
static int berlin2_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
@ -244,8 +243,4 @@ static struct platform_driver berlin2_pinctrl_driver = {
|
|||
.of_match_table = berlin2_pinctrl_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(berlin2_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Antoine Ténart <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Berlin BG2 pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
builtin_platform_driver(berlin2_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
|
@ -172,7 +172,6 @@ static const struct of_device_id berlin2cd_pinctrl_match[] = {
|
|||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, berlin2cd_pinctrl_match);
|
||||
|
||||
static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
@ -189,8 +188,4 @@ static struct platform_driver berlin2cd_pinctrl_driver = {
|
|||
.of_match_table = berlin2cd_pinctrl_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(berlin2cd_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Antoine Ténart <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Berlin BG2CD pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
builtin_platform_driver(berlin2cd_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
|
@ -389,7 +389,6 @@ static const struct of_device_id berlin2q_pinctrl_match[] = {
|
|||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, berlin2q_pinctrl_match);
|
||||
|
||||
static int berlin2q_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
@ -406,8 +405,4 @@ static struct platform_driver berlin2q_pinctrl_driver = {
|
|||
.of_match_table = berlin2q_pinctrl_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(berlin2q_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Antoine Ténart <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Berlin BG2Q pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
builtin_platform_driver(berlin2q_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
|
@ -457,7 +457,6 @@ static const struct of_device_id berlin4ct_pinctrl_match[] = {
|
|||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, berlin4ct_pinctrl_match);
|
||||
|
||||
static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
@ -496,8 +495,4 @@ static struct platform_driver berlin4ct_pinctrl_driver = {
|
|||
.of_match_table = berlin4ct_pinctrl_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(berlin4ct_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Jisheng Zhang <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell berlin4ct pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
builtin_platform_driver(berlin4ct_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -237,10 +237,8 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
pindesc = kzalloc(sizeof(*pindesc), GFP_KERNEL);
|
||||
if (pindesc == NULL) {
|
||||
dev_err(pctldev->dev, "failed to alloc struct pin_desc\n");
|
||||
if (!pindesc)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Set owner */
|
||||
pindesc->pctldev = pctldev;
|
||||
|
|
@ -540,6 +538,182 @@ void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_remove_gpio_range);
|
||||
|
||||
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
|
||||
|
||||
/**
|
||||
* pinctrl_generic_get_group_count() - returns the number of pin groups
|
||||
* @pctldev: pin controller device
|
||||
*/
|
||||
int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return pctldev->num_groups;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_count);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_get_group_name() - returns the name of a pin group
|
||||
* @pctldev: pin controller device
|
||||
* @selector: group number
|
||||
*/
|
||||
const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct group_desc *group;
|
||||
|
||||
group = radix_tree_lookup(&pctldev->pin_group_tree,
|
||||
selector);
|
||||
if (!group)
|
||||
return NULL;
|
||||
|
||||
return group->name;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_get_group_pins() - gets the pin group pins
|
||||
* @pctldev: pin controller device
|
||||
* @selector: group number
|
||||
* @pins: pins in the group
|
||||
* @num_pins: number of pins in the group
|
||||
*/
|
||||
int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
const unsigned int **pins,
|
||||
unsigned int *num_pins)
|
||||
{
|
||||
struct group_desc *group;
|
||||
|
||||
group = radix_tree_lookup(&pctldev->pin_group_tree,
|
||||
selector);
|
||||
if (!group) {
|
||||
dev_err(pctldev->dev, "%s could not find pingroup%i\n",
|
||||
__func__, selector);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*pins = group->pins;
|
||||
*num_pins = group->num_pins;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_pins);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_get_group() - returns a pin group based on the number
|
||||
* @pctldev: pin controller device
|
||||
* @gselector: group number
|
||||
*/
|
||||
struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct group_desc *group;
|
||||
|
||||
group = radix_tree_lookup(&pctldev->pin_group_tree,
|
||||
selector);
|
||||
if (!group)
|
||||
return NULL;
|
||||
|
||||
return group;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_add_group() - adds a new pin group
|
||||
* @pctldev: pin controller device
|
||||
* @name: name of the pin group
|
||||
* @pins: pins in the pin group
|
||||
* @num_pins: number of pins in the pin group
|
||||
* @data: pin controller driver specific data
|
||||
*
|
||||
* Note that the caller must take care of locking.
|
||||
*/
|
||||
int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
|
||||
int *pins, int num_pins, void *data)
|
||||
{
|
||||
struct group_desc *group;
|
||||
|
||||
group = devm_kzalloc(pctldev->dev, sizeof(*group), GFP_KERNEL);
|
||||
if (!group)
|
||||
return -ENOMEM;
|
||||
|
||||
group->name = name;
|
||||
group->pins = pins;
|
||||
group->num_pins = num_pins;
|
||||
group->data = data;
|
||||
|
||||
radix_tree_insert(&pctldev->pin_group_tree, pctldev->num_groups,
|
||||
group);
|
||||
|
||||
pctldev->num_groups++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_add_group);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_remove_group() - removes a numbered pin group
|
||||
* @pctldev: pin controller device
|
||||
* @selector: group number
|
||||
*
|
||||
* Note that the caller must take care of locking.
|
||||
*/
|
||||
int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct group_desc *group;
|
||||
|
||||
group = radix_tree_lookup(&pctldev->pin_group_tree,
|
||||
selector);
|
||||
if (!group)
|
||||
return -ENOENT;
|
||||
|
||||
radix_tree_delete(&pctldev->pin_group_tree, selector);
|
||||
devm_kfree(pctldev->dev, group);
|
||||
|
||||
pctldev->num_groups--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_remove_group);
|
||||
|
||||
/**
|
||||
* pinctrl_generic_free_groups() - removes all pin groups
|
||||
* @pctldev: pin controller device
|
||||
*
|
||||
* Note that the caller must take care of locking.
|
||||
*/
|
||||
static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct radix_tree_iter iter;
|
||||
struct group_desc *group;
|
||||
unsigned long *indices;
|
||||
void **slot;
|
||||
int i = 0;
|
||||
|
||||
indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *
|
||||
pctldev->num_groups, GFP_KERNEL);
|
||||
if (!indices)
|
||||
return;
|
||||
|
||||
radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0)
|
||||
indices[i++] = iter.index;
|
||||
|
||||
for (i = 0; i < pctldev->num_groups; i++) {
|
||||
group = radix_tree_lookup(&pctldev->pin_group_tree,
|
||||
indices[i]);
|
||||
radix_tree_delete(&pctldev->pin_group_tree, indices[i]);
|
||||
devm_kfree(pctldev->dev, group);
|
||||
}
|
||||
|
||||
pctldev->num_groups = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_GENERIC_PINCTRL_GROUPS */
|
||||
|
||||
/**
|
||||
* pinctrl_get_group_selector() - returns the group selector for a group
|
||||
* @pctldev: the pin controller handling the group
|
||||
|
|
@ -688,6 +862,35 @@ int pinctrl_gpio_direction_output(unsigned gpio)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_output);
|
||||
|
||||
/**
|
||||
* pinctrl_gpio_set_config() - Apply config to given GPIO pin
|
||||
* @gpio: the GPIO pin number from the GPIO subsystem number space
|
||||
* @config: the configuration to apply to the GPIO
|
||||
*
|
||||
* This function should *ONLY* be used from gpiolib-based GPIO drivers, if
|
||||
* they need to call the underlying pin controller to change GPIO config
|
||||
* (for example set debounce time).
|
||||
*/
|
||||
int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
|
||||
{
|
||||
unsigned long configs[] = { config };
|
||||
struct pinctrl_gpio_range *range;
|
||||
struct pinctrl_dev *pctldev;
|
||||
int ret, pin;
|
||||
|
||||
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mutex_lock(&pctldev->mutex);
|
||||
pin = gpio_to_pin(range, gpio);
|
||||
ret = pinconf_set_config(pctldev, pin, configs, ARRAY_SIZE(configs));
|
||||
mutex_unlock(&pctldev->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config);
|
||||
|
||||
static struct pinctrl_state *find_state(struct pinctrl *p,
|
||||
const char *name)
|
||||
{
|
||||
|
|
@ -706,11 +909,8 @@ static struct pinctrl_state *create_state(struct pinctrl *p,
|
|||
struct pinctrl_state *state;
|
||||
|
||||
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||
if (state == NULL) {
|
||||
dev_err(p->dev,
|
||||
"failed to alloc struct pinctrl_state\n");
|
||||
if (!state)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
state->name = name;
|
||||
INIT_LIST_HEAD(&state->settings);
|
||||
|
|
@ -720,7 +920,8 @@ static struct pinctrl_state *create_state(struct pinctrl *p,
|
|||
return state;
|
||||
}
|
||||
|
||||
static int add_setting(struct pinctrl *p, struct pinctrl_map const *map)
|
||||
static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_map const *map)
|
||||
{
|
||||
struct pinctrl_state *state;
|
||||
struct pinctrl_setting *setting;
|
||||
|
|
@ -736,15 +937,16 @@ static int add_setting(struct pinctrl *p, struct pinctrl_map const *map)
|
|||
return 0;
|
||||
|
||||
setting = kzalloc(sizeof(*setting), GFP_KERNEL);
|
||||
if (setting == NULL) {
|
||||
dev_err(p->dev,
|
||||
"failed to alloc struct pinctrl_setting\n");
|
||||
if (!setting)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
setting->type = map->type;
|
||||
|
||||
setting->pctldev = get_pinctrl_dev_from_devname(map->ctrl_dev_name);
|
||||
if (pctldev)
|
||||
setting->pctldev = pctldev;
|
||||
else
|
||||
setting->pctldev =
|
||||
get_pinctrl_dev_from_devname(map->ctrl_dev_name);
|
||||
if (setting->pctldev == NULL) {
|
||||
kfree(setting);
|
||||
/* Do not defer probing of hogs (circular loop) */
|
||||
|
|
@ -800,7 +1002,8 @@ static struct pinctrl *find_pinctrl(struct device *dev)
|
|||
|
||||
static void pinctrl_free(struct pinctrl *p, bool inlist);
|
||||
|
||||
static struct pinctrl *create_pinctrl(struct device *dev)
|
||||
static struct pinctrl *create_pinctrl(struct device *dev,
|
||||
struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct pinctrl *p;
|
||||
const char *devname;
|
||||
|
|
@ -815,15 +1018,13 @@ static struct pinctrl *create_pinctrl(struct device *dev)
|
|||
* a pin control handle with pinctrl_get()
|
||||
*/
|
||||
p = kzalloc(sizeof(*p), GFP_KERNEL);
|
||||
if (p == NULL) {
|
||||
dev_err(dev, "failed to alloc struct pinctrl\n");
|
||||
if (!p)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
p->dev = dev;
|
||||
INIT_LIST_HEAD(&p->states);
|
||||
INIT_LIST_HEAD(&p->dt_maps);
|
||||
|
||||
ret = pinctrl_dt_to_map(p);
|
||||
ret = pinctrl_dt_to_map(p, pctldev);
|
||||
if (ret < 0) {
|
||||
kfree(p);
|
||||
return ERR_PTR(ret);
|
||||
|
|
@ -838,7 +1039,7 @@ static struct pinctrl *create_pinctrl(struct device *dev)
|
|||
if (strcmp(map->dev_name, devname))
|
||||
continue;
|
||||
|
||||
ret = add_setting(p, map);
|
||||
ret = add_setting(p, pctldev, map);
|
||||
/*
|
||||
* At this point the adding of a setting may:
|
||||
*
|
||||
|
|
@ -899,7 +1100,7 @@ struct pinctrl *pinctrl_get(struct device *dev)
|
|||
return p;
|
||||
}
|
||||
|
||||
return create_pinctrl(dev);
|
||||
return create_pinctrl(dev, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_get);
|
||||
|
||||
|
|
@ -1175,10 +1376,8 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
|
|||
}
|
||||
|
||||
maps_node = kzalloc(sizeof(*maps_node), GFP_KERNEL);
|
||||
if (!maps_node) {
|
||||
pr_err("failed to alloc struct pinctrl_maps\n");
|
||||
if (!maps_node)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
maps_node->num_maps = num_maps;
|
||||
if (dup) {
|
||||
|
|
@ -1731,20 +1930,18 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev)
|
|||
!ops->get_group_name)
|
||||
return -EINVAL;
|
||||
|
||||
if (ops->dt_node_to_map && !ops->dt_free_map)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pinctrl_register() - register a pin controller device
|
||||
* pinctrl_init_controller() - init a pin controller device
|
||||
* @pctldesc: descriptor for this pin controller
|
||||
* @dev: parent device for this pin controller
|
||||
* @driver_data: private pin controller data for this pin controller
|
||||
*/
|
||||
struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
|
||||
struct device *dev, void *driver_data)
|
||||
struct pinctrl_dev *pinctrl_init_controller(struct pinctrl_desc *pctldesc,
|
||||
struct device *dev,
|
||||
void *driver_data)
|
||||
{
|
||||
struct pinctrl_dev *pctldev;
|
||||
int ret;
|
||||
|
|
@ -1755,17 +1952,22 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
|
|||
return ERR_PTR(-EINVAL);
|
||||
|
||||
pctldev = kzalloc(sizeof(*pctldev), GFP_KERNEL);
|
||||
if (pctldev == NULL) {
|
||||
dev_err(dev, "failed to alloc struct pinctrl_dev\n");
|
||||
if (!pctldev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
/* Initialize pin control device struct */
|
||||
pctldev->owner = pctldesc->owner;
|
||||
pctldev->desc = pctldesc;
|
||||
pctldev->driver_data = driver_data;
|
||||
INIT_RADIX_TREE(&pctldev->pin_desc_tree, GFP_KERNEL);
|
||||
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
|
||||
INIT_RADIX_TREE(&pctldev->pin_group_tree, GFP_KERNEL);
|
||||
#endif
|
||||
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS
|
||||
INIT_RADIX_TREE(&pctldev->pin_function_tree, GFP_KERNEL);
|
||||
#endif
|
||||
INIT_LIST_HEAD(&pctldev->gpio_ranges);
|
||||
INIT_LIST_HEAD(&pctldev->node);
|
||||
pctldev->dev = dev;
|
||||
mutex_init(&pctldev->mutex);
|
||||
|
||||
|
|
@ -1800,33 +2002,6 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
|
|||
goto out_err;
|
||||
}
|
||||
|
||||
mutex_lock(&pinctrldev_list_mutex);
|
||||
list_add_tail(&pctldev->node, &pinctrldev_list);
|
||||
mutex_unlock(&pinctrldev_list_mutex);
|
||||
|
||||
pctldev->p = pinctrl_get(pctldev->dev);
|
||||
|
||||
if (!IS_ERR(pctldev->p)) {
|
||||
pctldev->hog_default =
|
||||
pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT);
|
||||
if (IS_ERR(pctldev->hog_default)) {
|
||||
dev_dbg(dev, "failed to lookup the default state\n");
|
||||
} else {
|
||||
if (pinctrl_select_state(pctldev->p,
|
||||
pctldev->hog_default))
|
||||
dev_err(dev,
|
||||
"failed to select default state\n");
|
||||
}
|
||||
|
||||
pctldev->hog_sleep =
|
||||
pinctrl_lookup_state(pctldev->p,
|
||||
PINCTRL_STATE_SLEEP);
|
||||
if (IS_ERR(pctldev->hog_sleep))
|
||||
dev_dbg(dev, "failed to lookup the sleep state\n");
|
||||
}
|
||||
|
||||
pinctrl_init_device_debugfs(pctldev);
|
||||
|
||||
return pctldev;
|
||||
|
||||
out_err:
|
||||
|
|
@ -1834,8 +2009,107 @@ out_err:
|
|||
kfree(pctldev);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
static int pinctrl_create_and_start(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
pctldev->p = create_pinctrl(pctldev->dev, pctldev);
|
||||
if (!IS_ERR(pctldev->p)) {
|
||||
kref_get(&pctldev->p->users);
|
||||
pctldev->hog_default =
|
||||
pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT);
|
||||
if (IS_ERR(pctldev->hog_default)) {
|
||||
dev_dbg(pctldev->dev,
|
||||
"failed to lookup the default state\n");
|
||||
} else {
|
||||
if (pinctrl_select_state(pctldev->p,
|
||||
pctldev->hog_default))
|
||||
dev_err(pctldev->dev,
|
||||
"failed to select default state\n");
|
||||
}
|
||||
|
||||
pctldev->hog_sleep =
|
||||
pinctrl_lookup_state(pctldev->p,
|
||||
PINCTRL_STATE_SLEEP);
|
||||
if (IS_ERR(pctldev->hog_sleep))
|
||||
dev_dbg(pctldev->dev,
|
||||
"failed to lookup the sleep state\n");
|
||||
}
|
||||
|
||||
mutex_lock(&pinctrldev_list_mutex);
|
||||
list_add_tail(&pctldev->node, &pinctrldev_list);
|
||||
mutex_unlock(&pinctrldev_list_mutex);
|
||||
|
||||
pinctrl_init_device_debugfs(pctldev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pinctrl_register() - register a pin controller device
|
||||
* @pctldesc: descriptor for this pin controller
|
||||
* @dev: parent device for this pin controller
|
||||
* @driver_data: private pin controller data for this pin controller
|
||||
*
|
||||
* Note that pinctrl_register() is known to have problems as the pin
|
||||
* controller driver functions are called before the driver has a
|
||||
* struct pinctrl_dev handle. To avoid issues later on, please use the
|
||||
* new pinctrl_register_and_init() below instead.
|
||||
*/
|
||||
struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
|
||||
struct device *dev, void *driver_data)
|
||||
{
|
||||
struct pinctrl_dev *pctldev;
|
||||
int error;
|
||||
|
||||
pctldev = pinctrl_init_controller(pctldesc, dev, driver_data);
|
||||
if (IS_ERR(pctldev))
|
||||
return pctldev;
|
||||
|
||||
error = pinctrl_create_and_start(pctldev);
|
||||
if (error) {
|
||||
mutex_destroy(&pctldev->mutex);
|
||||
kfree(pctldev);
|
||||
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
|
||||
return pctldev;
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_register);
|
||||
|
||||
int pinctrl_register_and_init(struct pinctrl_desc *pctldesc,
|
||||
struct device *dev, void *driver_data,
|
||||
struct pinctrl_dev **pctldev)
|
||||
{
|
||||
struct pinctrl_dev *p;
|
||||
int error;
|
||||
|
||||
p = pinctrl_init_controller(pctldesc, dev, driver_data);
|
||||
if (IS_ERR(p))
|
||||
return PTR_ERR(p);
|
||||
|
||||
/*
|
||||
* We have pinctrl_start() call functions in the pin controller
|
||||
* driver with create_pinctrl() for at least dt_node_to_map(). So
|
||||
* let's make sure pctldev is properly initialized for the
|
||||
* pin controller driver before we do anything.
|
||||
*/
|
||||
*pctldev = p;
|
||||
|
||||
error = pinctrl_create_and_start(p);
|
||||
if (error) {
|
||||
mutex_destroy(&p->mutex);
|
||||
kfree(p);
|
||||
*pctldev = NULL;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_register_and_init);
|
||||
|
||||
/**
|
||||
* pinctrl_unregister() - unregister pinmux
|
||||
* @pctldev: pin controller to unregister
|
||||
|
|
@ -1845,6 +2119,7 @@ EXPORT_SYMBOL_GPL(pinctrl_register);
|
|||
void pinctrl_unregister(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct pinctrl_gpio_range *range, *n;
|
||||
|
||||
if (pctldev == NULL)
|
||||
return;
|
||||
|
||||
|
|
@ -1852,13 +2127,15 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev)
|
|||
pinctrl_remove_device_debugfs(pctldev);
|
||||
mutex_unlock(&pctldev->mutex);
|
||||
|
||||
if (!IS_ERR(pctldev->p))
|
||||
if (!IS_ERR_OR_NULL(pctldev->p))
|
||||
pinctrl_put(pctldev->p);
|
||||
|
||||
mutex_lock(&pinctrldev_list_mutex);
|
||||
mutex_lock(&pctldev->mutex);
|
||||
/* TODO: check that no pinmuxes are still active? */
|
||||
list_del(&pctldev->node);
|
||||
pinmux_generic_free_functions(pctldev);
|
||||
pinctrl_generic_free_groups(pctldev);
|
||||
/* Destroy descriptor tree */
|
||||
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
|
||||
pctldev->desc->npins);
|
||||
|
|
@ -1924,6 +2201,42 @@ struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(devm_pinctrl_register);
|
||||
|
||||
/**
|
||||
* devm_pinctrl_register_and_init() - Resource managed pinctrl register and init
|
||||
* @dev: parent device for this pin controller
|
||||
* @pctldesc: descriptor for this pin controller
|
||||
* @driver_data: private pin controller data for this pin controller
|
||||
*
|
||||
* Returns an error pointer if pincontrol register failed. Otherwise
|
||||
* it returns valid pinctrl handle.
|
||||
*
|
||||
* The pinctrl device will be automatically released when the device is unbound.
|
||||
*/
|
||||
int devm_pinctrl_register_and_init(struct device *dev,
|
||||
struct pinctrl_desc *pctldesc,
|
||||
void *driver_data,
|
||||
struct pinctrl_dev **pctldev)
|
||||
{
|
||||
struct pinctrl_dev **ptr;
|
||||
int error;
|
||||
|
||||
ptr = devres_alloc(devm_pinctrl_dev_release, sizeof(*ptr), GFP_KERNEL);
|
||||
if (!ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
error = pinctrl_register_and_init(pctldesc, dev, driver_data, pctldev);
|
||||
if (error) {
|
||||
devres_free(ptr);
|
||||
return error;
|
||||
}
|
||||
|
||||
*ptr = *pctldev;
|
||||
devres_add(dev, ptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_pinctrl_register_and_init);
|
||||
|
||||
/**
|
||||
* devm_pinctrl_unregister() - Resource managed version of pinctrl_unregister().
|
||||
* @dev: device for which which resource was allocated
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ struct pinctrl_gpio_range;
|
|||
* controller
|
||||
* @pin_desc_tree: each pin descriptor for this pin controller is stored in
|
||||
* this radix tree
|
||||
* @pin_group_tree: optionally each pin group can be stored in this radix tree
|
||||
* @num_groups: optionally number of groups can be kept here
|
||||
* @pin_function_tree: optionally each function can be stored in this radix tree
|
||||
* @num_functions: optionally number of functions can be kept here
|
||||
* @gpio_ranges: a list of GPIO ranges that is handled by this pin controller,
|
||||
* ranges are added to this list at runtime
|
||||
* @dev: the device entry for this pin controller
|
||||
|
|
@ -40,6 +44,14 @@ struct pinctrl_dev {
|
|||
struct list_head node;
|
||||
struct pinctrl_desc *desc;
|
||||
struct radix_tree_root pin_desc_tree;
|
||||
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
|
||||
struct radix_tree_root pin_group_tree;
|
||||
unsigned int num_groups;
|
||||
#endif
|
||||
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS
|
||||
struct radix_tree_root pin_function_tree;
|
||||
unsigned int num_functions;
|
||||
#endif
|
||||
struct list_head gpio_ranges;
|
||||
struct device *dev;
|
||||
struct module *owner;
|
||||
|
|
@ -171,6 +183,49 @@ struct pinctrl_maps {
|
|||
unsigned num_maps;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
|
||||
|
||||
/**
|
||||
* struct group_desc - generic pin group descriptor
|
||||
* @name: name of the pin group
|
||||
* @pins: array of pins that belong to the group
|
||||
* @num_pins: number of pins in the group
|
||||
* @data: pin controller driver specific data
|
||||
*/
|
||||
struct group_desc {
|
||||
const char *name;
|
||||
int *pins;
|
||||
int num_pins;
|
||||
void *data;
|
||||
};
|
||||
|
||||
int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev);
|
||||
|
||||
const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int group_selector);
|
||||
|
||||
int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev,
|
||||
unsigned int group_selector,
|
||||
const unsigned int **pins,
|
||||
unsigned int *npins);
|
||||
|
||||
struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev,
|
||||
unsigned int group_selector);
|
||||
|
||||
int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
|
||||
int *gpins, int ngpins, void *data);
|
||||
|
||||
int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev,
|
||||
unsigned int group_selector);
|
||||
|
||||
static inline int
|
||||
pinctrl_generic_remove_last_group(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return pinctrl_generic_remove_group(pctldev, pctldev->num_groups - 1);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GENERIC_PINCTRL_GROUPS */
|
||||
|
||||
struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *dev_name);
|
||||
struct pinctrl_dev *get_pinctrl_dev_from_of_node(struct device_node *np);
|
||||
int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ static void dt_free_map(struct pinctrl_dev *pctldev,
|
|||
{
|
||||
if (pctldev) {
|
||||
const struct pinctrl_ops *ops = pctldev->desc->pctlops;
|
||||
ops->dt_free_map(pctldev, map, num_maps);
|
||||
if (ops->dt_free_map)
|
||||
ops->dt_free_map(pctldev, map, num_maps);
|
||||
} else {
|
||||
/* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */
|
||||
kfree(map);
|
||||
|
|
@ -100,11 +101,12 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
|
|||
return get_pinctrl_dev_from_of_node(np);
|
||||
}
|
||||
|
||||
static int dt_to_map_one_config(struct pinctrl *p, const char *statename,
|
||||
static int dt_to_map_one_config(struct pinctrl *p,
|
||||
struct pinctrl_dev *pctldev,
|
||||
const char *statename,
|
||||
struct device_node *np_config)
|
||||
{
|
||||
struct device_node *np_pctldev;
|
||||
struct pinctrl_dev *pctldev;
|
||||
const struct pinctrl_ops *ops;
|
||||
int ret;
|
||||
struct pinctrl_map *map;
|
||||
|
|
@ -121,7 +123,8 @@ static int dt_to_map_one_config(struct pinctrl *p, const char *statename,
|
|||
/* OK let's just assume this will appear later then */
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
pctldev = get_pinctrl_dev_from_of_node(np_pctldev);
|
||||
if (!pctldev)
|
||||
pctldev = get_pinctrl_dev_from_of_node(np_pctldev);
|
||||
if (pctldev)
|
||||
break;
|
||||
/* Do not defer probing of hogs (circular loop) */
|
||||
|
|
@ -166,7 +169,22 @@ static int dt_remember_dummy_state(struct pinctrl *p, const char *statename)
|
|||
return dt_remember_or_free_map(p, statename, NULL, map, 1);
|
||||
}
|
||||
|
||||
int pinctrl_dt_to_map(struct pinctrl *p)
|
||||
bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct device_node *np;
|
||||
struct property *prop;
|
||||
int size;
|
||||
|
||||
np = pctldev->dev->of_node;
|
||||
if (!np)
|
||||
return false;
|
||||
|
||||
prop = of_find_property(np, "pinctrl-0", &size);
|
||||
|
||||
return prop ? true : false;
|
||||
}
|
||||
|
||||
int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct device_node *np = p->dev->of_node;
|
||||
int state, ret;
|
||||
|
|
@ -233,7 +251,8 @@ int pinctrl_dt_to_map(struct pinctrl *p)
|
|||
}
|
||||
|
||||
/* Parse the node */
|
||||
ret = dt_to_map_one_config(p, statename, np_config);
|
||||
ret = dt_to_map_one_config(p, pctldev, statename,
|
||||
np_config);
|
||||
of_node_put(np_config);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ struct of_phandle_args;
|
|||
|
||||
#ifdef CONFIG_OF
|
||||
|
||||
bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev);
|
||||
|
||||
void pinctrl_dt_free_maps(struct pinctrl *p);
|
||||
int pinctrl_dt_to_map(struct pinctrl *p);
|
||||
int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev);
|
||||
|
||||
int pinctrl_count_index_with_args(const struct device_node *np,
|
||||
const char *list_name);
|
||||
|
|
@ -32,7 +34,13 @@ int pinctrl_parse_index_with_args(const struct device_node *np,
|
|||
|
||||
#else
|
||||
|
||||
static inline int pinctrl_dt_to_map(struct pinctrl *p)
|
||||
static inline bool pinctrl_dt_has_hogs(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int pinctrl_dt_to_map(struct pinctrl *p,
|
||||
struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
config PINCTRL_IMX
|
||||
bool
|
||||
select PINMUX
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select PINCONF
|
||||
select REGMAP
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <linux/regmap.h>
|
||||
|
||||
#include "../core.h"
|
||||
#include "../pinmux.h"
|
||||
#include "pinctrl-imx.h"
|
||||
|
||||
/* The bits in CONFIG cell defined in binding doc*/
|
||||
|
|
@ -42,59 +43,25 @@ struct imx_pinctrl {
|
|||
struct pinctrl_dev *pctl;
|
||||
void __iomem *base;
|
||||
void __iomem *input_sel_base;
|
||||
const struct imx_pinctrl_soc_info *info;
|
||||
struct imx_pinctrl_soc_info *info;
|
||||
};
|
||||
|
||||
static inline const struct imx_pin_group *imx_pinctrl_find_group_by_name(
|
||||
const struct imx_pinctrl_soc_info *info,
|
||||
static inline const struct group_desc *imx_pinctrl_find_group_by_name(
|
||||
struct pinctrl_dev *pctldev,
|
||||
const char *name)
|
||||
{
|
||||
const struct imx_pin_group *grp = NULL;
|
||||
const struct group_desc *grp = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < info->ngroups; i++) {
|
||||
if (!strcmp(info->groups[i].name, name)) {
|
||||
grp = &info->groups[i];
|
||||
for (i = 0; i < pctldev->num_groups; i++) {
|
||||
grp = pinctrl_generic_get_group(pctldev, i);
|
||||
if (grp && !strcmp(grp->name, name))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return grp;
|
||||
}
|
||||
|
||||
static int imx_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
return info->ngroups;
|
||||
}
|
||||
|
||||
static const char *imx_get_group_name(struct pinctrl_dev *pctldev,
|
||||
unsigned selector)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
return info->groups[selector].name;
|
||||
}
|
||||
|
||||
static int imx_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
|
||||
const unsigned **pins,
|
||||
unsigned *npins)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
if (selector >= info->ngroups)
|
||||
return -EINVAL;
|
||||
|
||||
*pins = info->groups[selector].pin_ids;
|
||||
*npins = info->groups[selector].npins;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void imx_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
|
||||
unsigned offset)
|
||||
{
|
||||
|
|
@ -106,8 +73,8 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
struct pinctrl_map **map, unsigned *num_maps)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_group *grp;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct group_desc *grp;
|
||||
struct pinctrl_map *new_map;
|
||||
struct device_node *parent;
|
||||
int map_num = 1;
|
||||
|
|
@ -117,15 +84,17 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
* first find the group of this node and check if we need create
|
||||
* config maps for pins
|
||||
*/
|
||||
grp = imx_pinctrl_find_group_by_name(info, np->name);
|
||||
grp = imx_pinctrl_find_group_by_name(pctldev, np->name);
|
||||
if (!grp) {
|
||||
dev_err(info->dev, "unable to find group for node %s\n",
|
||||
np->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < grp->npins; i++) {
|
||||
if (!(grp->pins[i].config & IMX_NO_PAD_CTL))
|
||||
for (i = 0; i < grp->num_pins; i++) {
|
||||
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
|
||||
|
||||
if (!(pin->config & IMX_NO_PAD_CTL))
|
||||
map_num++;
|
||||
}
|
||||
|
||||
|
|
@ -149,12 +118,14 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
|
||||
/* create config map */
|
||||
new_map++;
|
||||
for (i = j = 0; i < grp->npins; i++) {
|
||||
if (!(grp->pins[i].config & IMX_NO_PAD_CTL)) {
|
||||
for (i = j = 0; i < grp->num_pins; i++) {
|
||||
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
|
||||
|
||||
if (!(pin->config & IMX_NO_PAD_CTL)) {
|
||||
new_map[j].type = PIN_MAP_TYPE_CONFIGS_PIN;
|
||||
new_map[j].data.configs.group_or_pin =
|
||||
pin_get_name(pctldev, grp->pins[i].pin);
|
||||
new_map[j].data.configs.configs = &grp->pins[i].config;
|
||||
pin_get_name(pctldev, pin->pin);
|
||||
new_map[j].data.configs.configs = &pin->config;
|
||||
new_map[j].data.configs.num_configs = 1;
|
||||
j++;
|
||||
}
|
||||
|
|
@ -173,9 +144,9 @@ static void imx_dt_free_map(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
static const struct pinctrl_ops imx_pctrl_ops = {
|
||||
.get_groups_count = imx_get_groups_count,
|
||||
.get_group_name = imx_get_group_name,
|
||||
.get_group_pins = imx_get_group_pins,
|
||||
.get_groups_count = pinctrl_generic_get_group_count,
|
||||
.get_group_name = pinctrl_generic_get_group_name,
|
||||
.get_group_pins = pinctrl_generic_get_group_pins,
|
||||
.pin_dbg_show = imx_pin_dbg_show,
|
||||
.dt_node_to_map = imx_dt_node_to_map,
|
||||
.dt_free_map = imx_dt_free_map,
|
||||
|
|
@ -186,24 +157,33 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
|
|||
unsigned group)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg;
|
||||
unsigned int npins, pin_id;
|
||||
int i;
|
||||
struct imx_pin_group *grp;
|
||||
struct group_desc *grp = NULL;
|
||||
struct function_desc *func = NULL;
|
||||
|
||||
/*
|
||||
* Configure the mux mode for each pin in the group for a specific
|
||||
* function.
|
||||
*/
|
||||
grp = &info->groups[group];
|
||||
npins = grp->npins;
|
||||
grp = pinctrl_generic_get_group(pctldev, group);
|
||||
if (!grp)
|
||||
return -EINVAL;
|
||||
|
||||
func = pinmux_generic_get_function(pctldev, selector);
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
|
||||
npins = grp->num_pins;
|
||||
|
||||
dev_dbg(ipctl->dev, "enable function %s group %s\n",
|
||||
info->functions[selector].name, grp->name);
|
||||
func->name, grp->name);
|
||||
|
||||
for (i = 0; i < npins; i++) {
|
||||
struct imx_pin *pin = &grp->pins[i];
|
||||
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
|
||||
|
||||
pin_id = pin->pin;
|
||||
pin_reg = &info->pin_regs[pin_id];
|
||||
|
||||
|
|
@ -272,43 +252,13 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int imx_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
return info->nfunctions;
|
||||
}
|
||||
|
||||
static const char *imx_pmx_get_func_name(struct pinctrl_dev *pctldev,
|
||||
unsigned selector)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
return info->functions[selector].name;
|
||||
}
|
||||
|
||||
static int imx_pmx_get_groups(struct pinctrl_dev *pctldev, unsigned selector,
|
||||
const char * const **groups,
|
||||
unsigned * const num_groups)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
|
||||
*groups = info->functions[selector].groups;
|
||||
*num_groups = info->functions[selector].num_groups;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range, unsigned offset)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg;
|
||||
struct imx_pin_group *grp;
|
||||
struct group_desc *grp;
|
||||
struct imx_pin *imx_pin;
|
||||
unsigned int pin, group;
|
||||
u32 reg;
|
||||
|
|
@ -322,10 +272,12 @@ static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
/* Find the pinctrl config with GPIO mux mode for the requested pin */
|
||||
for (group = 0; group < info->ngroups; group++) {
|
||||
grp = &info->groups[group];
|
||||
for (pin = 0; pin < grp->npins; pin++) {
|
||||
imx_pin = &grp->pins[pin];
|
||||
for (group = 0; group < pctldev->num_groups; group++) {
|
||||
grp = pinctrl_generic_get_group(pctldev, group);
|
||||
if (!grp)
|
||||
continue;
|
||||
for (pin = 0; pin < grp->num_pins; pin++) {
|
||||
imx_pin = &((struct imx_pin *)(grp->data))[pin];
|
||||
if (imx_pin->pin == offset && !imx_pin->mux_mode)
|
||||
goto mux_pin;
|
||||
}
|
||||
|
|
@ -346,7 +298,7 @@ static void imx_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
|
|||
struct pinctrl_gpio_range *range, unsigned offset)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg;
|
||||
u32 reg;
|
||||
|
||||
|
|
@ -371,7 +323,7 @@ static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
|
|||
struct pinctrl_gpio_range *range, unsigned offset, bool input)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg;
|
||||
u32 reg;
|
||||
|
||||
|
|
@ -398,9 +350,9 @@ static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
static const struct pinmux_ops imx_pmx_ops = {
|
||||
.get_functions_count = imx_pmx_get_funcs_count,
|
||||
.get_function_name = imx_pmx_get_func_name,
|
||||
.get_function_groups = imx_pmx_get_groups,
|
||||
.get_functions_count = pinmux_generic_get_function_count,
|
||||
.get_function_name = pinmux_generic_get_function_name,
|
||||
.get_function_groups = pinmux_generic_get_function_groups,
|
||||
.set_mux = imx_pmx_set,
|
||||
.gpio_request_enable = imx_pmx_gpio_request_enable,
|
||||
.gpio_disable_free = imx_pmx_gpio_disable_free,
|
||||
|
|
@ -411,7 +363,7 @@ static int imx_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
unsigned pin_id, unsigned long *config)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
|
||||
|
||||
if (pin_reg->conf_reg == -1) {
|
||||
|
|
@ -433,7 +385,7 @@ static int imx_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
unsigned num_configs)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
|
||||
int i;
|
||||
|
||||
|
|
@ -467,7 +419,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
|
|||
struct seq_file *s, unsigned pin_id)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
const struct imx_pin_reg *pin_reg = &info->pin_regs[pin_id];
|
||||
unsigned long config;
|
||||
|
||||
|
|
@ -483,20 +435,22 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
|
|||
static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
||||
struct seq_file *s, unsigned group)
|
||||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct imx_pin_group *grp;
|
||||
struct group_desc *grp;
|
||||
unsigned long config;
|
||||
const char *name;
|
||||
int i, ret;
|
||||
|
||||
if (group > info->ngroups)
|
||||
if (group > pctldev->num_groups)
|
||||
return;
|
||||
|
||||
seq_printf(s, "\n");
|
||||
grp = &info->groups[group];
|
||||
for (i = 0; i < grp->npins; i++) {
|
||||
struct imx_pin *pin = &grp->pins[i];
|
||||
grp = pinctrl_generic_get_group(pctldev, group);
|
||||
if (!grp)
|
||||
return;
|
||||
|
||||
for (i = 0; i < grp->num_pins; i++) {
|
||||
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
|
||||
|
||||
name = pin_get_name(pctldev, pin->pin);
|
||||
ret = imx_pinconf_get(pctldev, pin->pin, &config);
|
||||
if (ret)
|
||||
|
|
@ -520,7 +474,7 @@ static const struct pinconf_ops imx_pinconf_ops = {
|
|||
#define SHARE_FSL_PIN_SIZE 20
|
||||
|
||||
static int imx_pinctrl_parse_groups(struct device_node *np,
|
||||
struct imx_pin_group *grp,
|
||||
struct group_desc *grp,
|
||||
struct imx_pinctrl_soc_info *info,
|
||||
u32 index)
|
||||
{
|
||||
|
|
@ -554,20 +508,20 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
grp->npins = size / pin_size;
|
||||
grp->pins = devm_kzalloc(info->dev, grp->npins * sizeof(struct imx_pin),
|
||||
GFP_KERNEL);
|
||||
grp->pin_ids = devm_kzalloc(info->dev, grp->npins * sizeof(unsigned int),
|
||||
GFP_KERNEL);
|
||||
if (!grp->pins || ! grp->pin_ids)
|
||||
grp->num_pins = size / pin_size;
|
||||
grp->data = devm_kzalloc(info->dev, grp->num_pins *
|
||||
sizeof(struct imx_pin), GFP_KERNEL);
|
||||
grp->pins = devm_kzalloc(info->dev, grp->num_pins *
|
||||
sizeof(unsigned int), GFP_KERNEL);
|
||||
if (!grp->pins || !grp->data)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < grp->npins; i++) {
|
||||
for (i = 0; i < grp->num_pins; i++) {
|
||||
u32 mux_reg = be32_to_cpu(*list++);
|
||||
u32 conf_reg;
|
||||
unsigned int pin_id;
|
||||
struct imx_pin_reg *pin_reg;
|
||||
struct imx_pin *pin = &grp->pins[i];
|
||||
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
|
||||
|
||||
if (!(info->flags & ZERO_OFFSET_VALID) && !mux_reg)
|
||||
mux_reg = -1;
|
||||
|
|
@ -583,7 +537,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
|
|||
pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
|
||||
pin_reg = &info->pin_regs[pin_id];
|
||||
pin->pin = pin_id;
|
||||
grp->pin_ids[i] = pin_id;
|
||||
grp->pins[i] = pin_id;
|
||||
pin_reg->mux_reg = mux_reg;
|
||||
pin_reg->conf_reg = conf_reg;
|
||||
pin->input_reg = be32_to_cpu(*list++);
|
||||
|
|
@ -604,31 +558,46 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
|
|||
}
|
||||
|
||||
static int imx_pinctrl_parse_functions(struct device_node *np,
|
||||
struct imx_pinctrl_soc_info *info,
|
||||
struct imx_pinctrl *ipctl,
|
||||
u32 index)
|
||||
{
|
||||
struct pinctrl_dev *pctl = ipctl->pctl;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct device_node *child;
|
||||
struct imx_pmx_func *func;
|
||||
struct imx_pin_group *grp;
|
||||
struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
u32 i = 0;
|
||||
|
||||
dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name);
|
||||
|
||||
func = &info->functions[index];
|
||||
func = pinmux_generic_get_function(pctl, index);
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
|
||||
/* Initialise function */
|
||||
func->name = np->name;
|
||||
func->num_groups = of_get_child_count(np);
|
||||
if (func->num_groups == 0) {
|
||||
func->num_group_names = of_get_child_count(np);
|
||||
if (func->num_group_names == 0) {
|
||||
dev_err(info->dev, "no groups defined in %s\n", np->full_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
func->groups = devm_kzalloc(info->dev,
|
||||
func->num_groups * sizeof(char *), GFP_KERNEL);
|
||||
func->group_names = devm_kzalloc(info->dev,
|
||||
func->num_group_names *
|
||||
sizeof(char *), GFP_KERNEL);
|
||||
|
||||
for_each_child_of_node(np, child) {
|
||||
func->groups[i] = child->name;
|
||||
grp = &info->groups[info->group_index++];
|
||||
func->group_names[i] = child->name;
|
||||
|
||||
grp = devm_kzalloc(info->dev, sizeof(struct group_desc),
|
||||
GFP_KERNEL);
|
||||
if (!grp)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&info->mutex);
|
||||
radix_tree_insert(&pctl->pin_group_tree,
|
||||
info->group_index++, grp);
|
||||
mutex_unlock(&info->mutex);
|
||||
|
||||
imx_pinctrl_parse_groups(child, grp, info, i++);
|
||||
}
|
||||
|
||||
|
|
@ -659,10 +628,12 @@ static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
|
|||
}
|
||||
|
||||
static int imx_pinctrl_probe_dt(struct platform_device *pdev,
|
||||
struct imx_pinctrl_soc_info *info)
|
||||
struct imx_pinctrl *ipctl)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct device_node *child;
|
||||
struct pinctrl_dev *pctl = ipctl->pctl;
|
||||
struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
u32 nfuncs = 0;
|
||||
u32 i = 0;
|
||||
bool flat_funcs;
|
||||
|
|
@ -681,35 +652,50 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
|
|||
}
|
||||
}
|
||||
|
||||
info->nfunctions = nfuncs;
|
||||
info->functions = devm_kzalloc(&pdev->dev, nfuncs * sizeof(struct imx_pmx_func),
|
||||
for (i = 0; i < nfuncs; i++) {
|
||||
struct function_desc *function;
|
||||
|
||||
function = devm_kzalloc(&pdev->dev, sizeof(*function),
|
||||
GFP_KERNEL);
|
||||
if (!info->functions)
|
||||
return -ENOMEM;
|
||||
if (!function)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&info->mutex);
|
||||
radix_tree_insert(&pctl->pin_function_tree, i, function);
|
||||
mutex_unlock(&info->mutex);
|
||||
}
|
||||
pctl->num_functions = nfuncs;
|
||||
|
||||
info->group_index = 0;
|
||||
if (flat_funcs) {
|
||||
info->ngroups = of_get_child_count(np);
|
||||
pctl->num_groups = of_get_child_count(np);
|
||||
} else {
|
||||
info->ngroups = 0;
|
||||
pctl->num_groups = 0;
|
||||
for_each_child_of_node(np, child)
|
||||
info->ngroups += of_get_child_count(child);
|
||||
pctl->num_groups += of_get_child_count(child);
|
||||
}
|
||||
info->groups = devm_kzalloc(&pdev->dev, info->ngroups * sizeof(struct imx_pin_group),
|
||||
GFP_KERNEL);
|
||||
if (!info->groups)
|
||||
return -ENOMEM;
|
||||
|
||||
if (flat_funcs) {
|
||||
imx_pinctrl_parse_functions(np, info, 0);
|
||||
imx_pinctrl_parse_functions(np, ipctl, 0);
|
||||
} else {
|
||||
i = 0;
|
||||
for_each_child_of_node(np, child)
|
||||
imx_pinctrl_parse_functions(child, info, i++);
|
||||
imx_pinctrl_parse_functions(child, ipctl, i++);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* imx_free_resources() - free memory used by this driver
|
||||
* @info: info driver instance
|
||||
*/
|
||||
static void imx_free_resources(struct imx_pinctrl *ipctl)
|
||||
{
|
||||
if (ipctl->pctl)
|
||||
pinctrl_unregister(ipctl->pctl);
|
||||
}
|
||||
|
||||
int imx_pinctrl_probe(struct platform_device *pdev,
|
||||
struct imx_pinctrl_soc_info *info)
|
||||
{
|
||||
|
|
@ -783,23 +769,31 @@ int imx_pinctrl_probe(struct platform_device *pdev,
|
|||
imx_pinctrl_desc->confops = &imx_pinconf_ops;
|
||||
imx_pinctrl_desc->owner = THIS_MODULE;
|
||||
|
||||
ret = imx_pinctrl_probe_dt(pdev, info);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "fail to probe dt properties\n");
|
||||
return ret;
|
||||
}
|
||||
mutex_init(&info->mutex);
|
||||
|
||||
ipctl->info = info;
|
||||
ipctl->dev = info->dev;
|
||||
platform_set_drvdata(pdev, ipctl);
|
||||
ipctl->pctl = devm_pinctrl_register(&pdev->dev,
|
||||
imx_pinctrl_desc, ipctl);
|
||||
if (IS_ERR(ipctl->pctl)) {
|
||||
ret = devm_pinctrl_register_and_init(&pdev->dev,
|
||||
imx_pinctrl_desc, ipctl,
|
||||
&ipctl->pctl);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "could not register IMX pinctrl driver\n");
|
||||
return PTR_ERR(ipctl->pctl);
|
||||
goto free;
|
||||
}
|
||||
|
||||
ret = imx_pinctrl_probe_dt(pdev, ipctl);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "fail to probe dt properties\n");
|
||||
goto free;
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "initialized IMX pinctrl driver\n");
|
||||
|
||||
return 0;
|
||||
|
||||
free:
|
||||
imx_free_resources(ipctl);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
struct platform_device;
|
||||
|
||||
/**
|
||||
* struct imx_pin_group - describes a single i.MX pin
|
||||
* struct imx_pin - describes a single i.MX pin
|
||||
* @pin: the pin_id of this pin
|
||||
* @mux_mode: the mux mode for this pin.
|
||||
* @input_reg: the select input register offset for this pin if any
|
||||
|
|
@ -34,33 +34,6 @@ struct imx_pin {
|
|||
unsigned long config;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct imx_pin_group - describes an IMX pin group
|
||||
* @name: the name of this specific pin group
|
||||
* @npins: the number of pins in this group array, i.e. the number of
|
||||
* elements in .pins so we can iterate over that array
|
||||
* @pin_ids: array of pin_ids. pinctrl forces us to maintain such an array
|
||||
* @pins: array of pins
|
||||
*/
|
||||
struct imx_pin_group {
|
||||
const char *name;
|
||||
unsigned npins;
|
||||
unsigned int *pin_ids;
|
||||
struct imx_pin *pins;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct imx_pmx_func - describes IMX pinmux functions
|
||||
* @name: the name of this specific function
|
||||
* @groups: corresponding pin groups
|
||||
* @num_groups: the number of groups
|
||||
*/
|
||||
struct imx_pmx_func {
|
||||
const char *name;
|
||||
const char **groups;
|
||||
unsigned num_groups;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct imx_pin_reg - describe a pin reg map
|
||||
* @mux_reg: mux register offset
|
||||
|
|
@ -76,13 +49,10 @@ struct imx_pinctrl_soc_info {
|
|||
const struct pinctrl_pin_desc *pins;
|
||||
unsigned int npins;
|
||||
struct imx_pin_reg *pin_regs;
|
||||
struct imx_pin_group *groups;
|
||||
unsigned int ngroups;
|
||||
unsigned int group_index;
|
||||
struct imx_pmx_func *functions;
|
||||
unsigned int nfunctions;
|
||||
unsigned int flags;
|
||||
const char *gpr_compatible;
|
||||
struct mutex mutex;
|
||||
};
|
||||
|
||||
#define SHARE_MUX_CONF_REG 0x1
|
||||
|
|
|
|||
|
|
@ -56,6 +56,14 @@ config PINCTRL_BROXTON
|
|||
Broxton pinctrl driver provides an interface that allows
|
||||
configuring of SoC pins and using them as GPIOs.
|
||||
|
||||
config PINCTRL_GEMINILAKE
|
||||
tristate "Intel Gemini Lake SoC pinctrl and GPIO driver"
|
||||
depends on ACPI
|
||||
select PINCTRL_INTEL
|
||||
help
|
||||
This pinctrl driver provides an interface that allows configuring
|
||||
of Intel Gemini Lake SoC pins and using them as GPIOs.
|
||||
|
||||
config PINCTRL_SUNRISEPOINT
|
||||
tristate "Intel Sunrisepoint pinctrl and GPIO driver"
|
||||
depends on ACPI
|
||||
|
|
|
|||
|
|
@ -5,4 +5,5 @@ obj-$(CONFIG_PINCTRL_CHERRYVIEW) += pinctrl-cherryview.o
|
|||
obj-$(CONFIG_PINCTRL_MERRIFIELD) += pinctrl-merrifield.o
|
||||
obj-$(CONFIG_PINCTRL_INTEL) += pinctrl-intel.o
|
||||
obj-$(CONFIG_PINCTRL_BROXTON) += pinctrl-broxton.o
|
||||
obj-$(CONFIG_PINCTRL_GEMINILAKE) += pinctrl-geminilake.o
|
||||
obj-$(CONFIG_PINCTRL_SUNRISEPOINT) += pinctrl-sunrisepoint.o
|
||||
|
|
|
|||
|
|
@ -1466,7 +1466,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
|||
val & BYT_INPUT_EN ? " " : "in",
|
||||
val & BYT_OUTPUT_EN ? " " : "out",
|
||||
val & BYT_LEVEL ? "hi" : "lo",
|
||||
comm->pad_map[i], comm->pad_map[i] * 32,
|
||||
comm->pad_map[i], comm->pad_map[i] * 16,
|
||||
conf0 & 0x7,
|
||||
conf0 & BYT_TRIG_NEG ? " fall" : " ",
|
||||
conf0 & BYT_TRIG_POS ? " rise" : " ",
|
||||
|
|
@ -1709,7 +1709,7 @@ static int byt_gpio_probe(struct byt_gpio *vg)
|
|||
vg->saved_context = devm_kcalloc(&vg->pdev->dev, gc->ngpio,
|
||||
sizeof(*vg->saved_context), GFP_KERNEL);
|
||||
#endif
|
||||
ret = gpiochip_add_data(gc, vg);
|
||||
ret = devm_gpiochip_add_data(&vg->pdev->dev, gc, vg);
|
||||
if (ret) {
|
||||
dev_err(&vg->pdev->dev, "failed adding byt-gpio chip\n");
|
||||
return ret;
|
||||
|
|
@ -1719,7 +1719,7 @@ static int byt_gpio_probe(struct byt_gpio *vg)
|
|||
0, 0, vg->soc_data->npins);
|
||||
if (ret) {
|
||||
dev_err(&vg->pdev->dev, "failed to add GPIO pin range\n");
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* set up interrupts */
|
||||
|
|
@ -1730,7 +1730,7 @@ static int byt_gpio_probe(struct byt_gpio *vg)
|
|||
handle_bad_irq, IRQ_TYPE_NONE);
|
||||
if (ret) {
|
||||
dev_err(&vg->pdev->dev, "failed to add irqchip\n");
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpiochip_set_chained_irqchip(gc, &byt_irqchip,
|
||||
|
|
@ -1738,11 +1738,6 @@ static int byt_gpio_probe(struct byt_gpio *vg)
|
|||
byt_gpio_irq_handler);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
gpiochip_remove(&vg->chip);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1826,7 +1821,7 @@ static int byt_pinctrl_probe(struct platform_device *pdev)
|
|||
vg->pctl_desc.pins = vg->soc_data->pins;
|
||||
vg->pctl_desc.npins = vg->soc_data->npins;
|
||||
|
||||
vg->pctl_dev = pinctrl_register(&vg->pctl_desc, &pdev->dev, vg);
|
||||
vg->pctl_dev = devm_pinctrl_register(&pdev->dev, &vg->pctl_desc, vg);
|
||||
if (IS_ERR(vg->pctl_dev)) {
|
||||
dev_err(&pdev->dev, "failed to register pinctrl driver\n");
|
||||
return PTR_ERR(vg->pctl_dev);
|
||||
|
|
@ -1835,10 +1830,8 @@ static int byt_pinctrl_probe(struct platform_device *pdev)
|
|||
raw_spin_lock_init(&vg->lock);
|
||||
|
||||
ret = byt_gpio_probe(vg);
|
||||
if (ret) {
|
||||
pinctrl_unregister(vg->pctl_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, vg);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
|
|
|||
|
|
@ -1004,8 +1004,8 @@ static const struct acpi_device_id bxt_pinctrl_acpi_match[] = {
|
|||
MODULE_DEVICE_TABLE(acpi, bxt_pinctrl_acpi_match);
|
||||
|
||||
static const struct platform_device_id bxt_pinctrl_platform_ids[] = {
|
||||
{ "apl-pinctrl", (kernel_ulong_t)&apl_pinctrl_soc_data },
|
||||
{ "broxton-pinctrl", (kernel_ulong_t)&bxt_pinctrl_soc_data },
|
||||
{ "apollolake-pinctrl", (kernel_ulong_t)apl_pinctrl_soc_data },
|
||||
{ "broxton-pinctrl", (kernel_ulong_t)bxt_pinctrl_soc_data },
|
||||
{ },
|
||||
};
|
||||
|
||||
|
|
@ -1058,7 +1058,6 @@ static const struct dev_pm_ops bxt_pinctrl_pm_ops = {
|
|||
|
||||
static struct platform_driver bxt_pinctrl_driver = {
|
||||
.probe = bxt_pinctrl_probe,
|
||||
.remove = intel_pinctrl_remove,
|
||||
.driver = {
|
||||
.name = "broxton-pinctrl",
|
||||
.acpi_match_table = bxt_pinctrl_acpi_match,
|
||||
|
|
|
|||
|
|
@ -1059,7 +1059,7 @@ static int chv_config_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
}
|
||||
|
||||
static int chv_config_set_pull(struct chv_pinctrl *pctrl, unsigned pin,
|
||||
enum pin_config_param param, u16 arg)
|
||||
enum pin_config_param param, u32 arg)
|
||||
{
|
||||
void __iomem *reg = chv_padreg(pctrl, pin, CHV_PADCTRL0);
|
||||
unsigned long flags;
|
||||
|
|
@ -1151,7 +1151,7 @@ static int chv_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
struct chv_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param;
|
||||
int i, ret;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
|
||||
if (chv_pad_locked(pctrl, pin))
|
||||
return -EBUSY;
|
||||
|
|
|
|||
512
drivers/pinctrl/intel/pinctrl-geminilake.c
Normal file
512
drivers/pinctrl/intel/pinctrl-geminilake.c
Normal file
|
|
@ -0,0 +1,512 @@
|
|||
/*
|
||||
* Intel Gemini Lake SoC pinctrl/GPIO driver
|
||||
*
|
||||
* Copyright (C) 2017 Intel Corporation
|
||||
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-intel.h"
|
||||
|
||||
#define GLK_PAD_OWN 0x020
|
||||
#define GLK_HOSTSW_OWN 0x0b0
|
||||
#define GLK_PADCFGLOCK 0x080
|
||||
#define GLK_GPI_IE 0x110
|
||||
|
||||
#define GLK_COMMUNITY(s, e) \
|
||||
{ \
|
||||
.padown_offset = GLK_PAD_OWN, \
|
||||
.padcfglock_offset = GLK_PADCFGLOCK, \
|
||||
.hostown_offset = GLK_HOSTSW_OWN, \
|
||||
.ie_offset = GLK_GPI_IE, \
|
||||
.gpp_size = 32, \
|
||||
.pin_base = (s), \
|
||||
.npins = ((e) - (s) + 1), \
|
||||
}
|
||||
|
||||
/* GLK */
|
||||
static const struct pinctrl_pin_desc glk_northwest_pins[] = {
|
||||
PINCTRL_PIN(0, "TCK"),
|
||||
PINCTRL_PIN(1, "TRST_B"),
|
||||
PINCTRL_PIN(2, "TMS"),
|
||||
PINCTRL_PIN(3, "TDI"),
|
||||
PINCTRL_PIN(4, "TDO"),
|
||||
PINCTRL_PIN(5, "JTAGX"),
|
||||
PINCTRL_PIN(6, "CX_PREQ_B"),
|
||||
PINCTRL_PIN(7, "CX_PRDY_B"),
|
||||
PINCTRL_PIN(8, "GPIO_8"),
|
||||
PINCTRL_PIN(9, "GPIO_9"),
|
||||
PINCTRL_PIN(10, "GPIO_10"),
|
||||
PINCTRL_PIN(11, "GPIO_11"),
|
||||
PINCTRL_PIN(12, "GPIO_12"),
|
||||
PINCTRL_PIN(13, "GPIO_13"),
|
||||
PINCTRL_PIN(14, "GPIO_14"),
|
||||
PINCTRL_PIN(15, "GPIO_15"),
|
||||
PINCTRL_PIN(16, "GPIO_16"),
|
||||
PINCTRL_PIN(17, "GPIO_17"),
|
||||
PINCTRL_PIN(18, "GPIO_18"),
|
||||
PINCTRL_PIN(19, "GPIO_19"),
|
||||
PINCTRL_PIN(20, "GPIO_20"),
|
||||
PINCTRL_PIN(21, "GPIO_21"),
|
||||
PINCTRL_PIN(22, "GPIO_22"),
|
||||
PINCTRL_PIN(23, "GPIO_23"),
|
||||
PINCTRL_PIN(24, "GPIO_24"),
|
||||
PINCTRL_PIN(25, "GPIO_25"),
|
||||
PINCTRL_PIN(26, "GPIO_26"),
|
||||
PINCTRL_PIN(27, "GPIO_27"),
|
||||
PINCTRL_PIN(28, "GPIO_28"),
|
||||
PINCTRL_PIN(29, "GPIO_29"),
|
||||
PINCTRL_PIN(30, "GPIO_30"),
|
||||
PINCTRL_PIN(31, "GPIO_31"),
|
||||
PINCTRL_PIN(32, "GPIO_32"),
|
||||
PINCTRL_PIN(33, "GPIO_33"),
|
||||
PINCTRL_PIN(34, "GPIO_34"),
|
||||
PINCTRL_PIN(35, "GPIO_35"),
|
||||
PINCTRL_PIN(36, "GPIO_36"),
|
||||
PINCTRL_PIN(37, "GPIO_37"),
|
||||
PINCTRL_PIN(38, "GPIO_38"),
|
||||
PINCTRL_PIN(39, "GPIO_39"),
|
||||
PINCTRL_PIN(40, "GPIO_40"),
|
||||
PINCTRL_PIN(41, "GPIO_41"),
|
||||
PINCTRL_PIN(42, "GP_INTD_DSI_TE1"),
|
||||
PINCTRL_PIN(43, "GP_INTD_DSI_TE2"),
|
||||
PINCTRL_PIN(44, "USB_OC0_B"),
|
||||
PINCTRL_PIN(45, "USB_OC1_B"),
|
||||
PINCTRL_PIN(46, "DSI_I2C_SDA"),
|
||||
PINCTRL_PIN(47, "DSI_I2C_SCL"),
|
||||
PINCTRL_PIN(48, "PMC_I2C_SDA"),
|
||||
PINCTRL_PIN(49, "PMC_I2C_SCL"),
|
||||
PINCTRL_PIN(50, "LPSS_I2C0_SDA"),
|
||||
PINCTRL_PIN(51, "LPSS_I2C0_SCL"),
|
||||
PINCTRL_PIN(52, "LPSS_I2C1_SDA"),
|
||||
PINCTRL_PIN(53, "LPSS_I2C1_SCL"),
|
||||
PINCTRL_PIN(54, "LPSS_I2C2_SDA"),
|
||||
PINCTRL_PIN(55, "LPSS_I2C2_SCL"),
|
||||
PINCTRL_PIN(56, "LPSS_I2C3_SDA"),
|
||||
PINCTRL_PIN(57, "LPSS_I2C3_SCL"),
|
||||
PINCTRL_PIN(58, "LPSS_I2C4_SDA"),
|
||||
PINCTRL_PIN(59, "LPSS_I2C4_SCL"),
|
||||
PINCTRL_PIN(60, "LPSS_UART0_RXD"),
|
||||
PINCTRL_PIN(61, "LPSS_UART0_TXD"),
|
||||
PINCTRL_PIN(62, "LPSS_UART0_RTS_B"),
|
||||
PINCTRL_PIN(63, "LPSS_UART0_CTS_B"),
|
||||
PINCTRL_PIN(64, "LPSS_UART2_RXD"),
|
||||
PINCTRL_PIN(65, "LPSS_UART2_TXD"),
|
||||
PINCTRL_PIN(66, "LPSS_UART2_RTS_B"),
|
||||
PINCTRL_PIN(67, "LPSS_UART2_CTS_B"),
|
||||
PINCTRL_PIN(68, "PMC_SPI_FS0"),
|
||||
PINCTRL_PIN(69, "PMC_SPI_FS1"),
|
||||
PINCTRL_PIN(70, "PMC_SPI_FS2"),
|
||||
PINCTRL_PIN(71, "PMC_SPI_RXD"),
|
||||
PINCTRL_PIN(72, "PMC_SPI_TXD"),
|
||||
PINCTRL_PIN(73, "PMC_SPI_CLK"),
|
||||
PINCTRL_PIN(74, "THERMTRIP_B"),
|
||||
PINCTRL_PIN(75, "PROCHOT_B"),
|
||||
PINCTRL_PIN(76, "EMMC_RST_B"),
|
||||
PINCTRL_PIN(77, "GPIO_212"),
|
||||
PINCTRL_PIN(78, "GPIO_213"),
|
||||
PINCTRL_PIN(79, "GPIO_214"),
|
||||
};
|
||||
|
||||
static const unsigned int glk_northwest_uart1_pins[] = { 26, 27, 28, 29 };
|
||||
static const unsigned int glk_northwest_pwm0_pins[] = { 42 };
|
||||
static const unsigned int glk_northwest_pwm1_pins[] = { 43 };
|
||||
static const unsigned int glk_northwest_pwm2_pins[] = { 44 };
|
||||
static const unsigned int glk_northwest_pwm3_pins[] = { 45 };
|
||||
static const unsigned int glk_northwest_i2c0_pins[] = { 50, 51 };
|
||||
static const unsigned int glk_northwest_i2c1_pins[] = { 52, 53 };
|
||||
static const unsigned int glk_northwest_i2c2_pins[] = { 54, 55 };
|
||||
static const unsigned int glk_northwest_i2c3_pins[] = { 56, 57 };
|
||||
static const unsigned int glk_northwest_i2c4_pins[] = { 58, 59 };
|
||||
static const unsigned int glk_northwest_uart0_pins[] = { 60, 61, 62, 63 };
|
||||
static const unsigned int glk_northwest_uart2_pins[] = { 64, 65, 66, 67 };
|
||||
|
||||
static const struct intel_pingroup glk_northwest_groups[] = {
|
||||
PIN_GROUP("uart1_grp", glk_northwest_uart1_pins, 2),
|
||||
PIN_GROUP("pwm0_grp", glk_northwest_pwm0_pins, 2),
|
||||
PIN_GROUP("pwm1_grp", glk_northwest_pwm1_pins, 2),
|
||||
PIN_GROUP("pwm2_grp", glk_northwest_pwm2_pins, 2),
|
||||
PIN_GROUP("pwm3_grp", glk_northwest_pwm3_pins, 2),
|
||||
PIN_GROUP("i2c0_grp", glk_northwest_i2c0_pins, 1),
|
||||
PIN_GROUP("i2c1_grp", glk_northwest_i2c1_pins, 1),
|
||||
PIN_GROUP("i2c2_grp", glk_northwest_i2c2_pins, 1),
|
||||
PIN_GROUP("i2c3_grp", glk_northwest_i2c3_pins, 1),
|
||||
PIN_GROUP("i2c4_grp", glk_northwest_i2c4_pins, 1),
|
||||
PIN_GROUP("uart0_grp", glk_northwest_uart0_pins, 1),
|
||||
PIN_GROUP("uart2_grp", glk_northwest_uart2_pins, 1),
|
||||
};
|
||||
|
||||
static const char * const glk_northwest_uart1_groups[] = { "uart1_grp" };
|
||||
static const char * const glk_northwest_pwm0_groups[] = { "pwm0_grp" };
|
||||
static const char * const glk_northwest_pwm1_groups[] = { "pwm1_grp" };
|
||||
static const char * const glk_northwest_pwm2_groups[] = { "pwm2_grp" };
|
||||
static const char * const glk_northwest_pwm3_groups[] = { "pwm3_grp" };
|
||||
static const char * const glk_northwest_i2c0_groups[] = { "i2c0_grp" };
|
||||
static const char * const glk_northwest_i2c1_groups[] = { "i2c1_grp" };
|
||||
static const char * const glk_northwest_i2c2_groups[] = { "i2c2_grp" };
|
||||
static const char * const glk_northwest_i2c3_groups[] = { "i2c3_grp" };
|
||||
static const char * const glk_northwest_i2c4_groups[] = { "i2c4_grp" };
|
||||
static const char * const glk_northwest_uart0_groups[] = { "uart0_grp" };
|
||||
static const char * const glk_northwest_uart2_groups[] = { "uart2_grp" };
|
||||
|
||||
static const struct intel_function glk_northwest_functions[] = {
|
||||
FUNCTION("uart1", glk_northwest_uart1_groups),
|
||||
FUNCTION("pmw0", glk_northwest_pwm0_groups),
|
||||
FUNCTION("pmw1", glk_northwest_pwm1_groups),
|
||||
FUNCTION("pmw2", glk_northwest_pwm2_groups),
|
||||
FUNCTION("pmw3", glk_northwest_pwm3_groups),
|
||||
FUNCTION("i2c0", glk_northwest_i2c0_groups),
|
||||
FUNCTION("i2c1", glk_northwest_i2c1_groups),
|
||||
FUNCTION("i2c2", glk_northwest_i2c2_groups),
|
||||
FUNCTION("i2c3", glk_northwest_i2c3_groups),
|
||||
FUNCTION("i2c4", glk_northwest_i2c4_groups),
|
||||
FUNCTION("uart0", glk_northwest_uart0_groups),
|
||||
FUNCTION("uart2", glk_northwest_uart2_groups),
|
||||
};
|
||||
|
||||
static const struct intel_community glk_northwest_communities[] = {
|
||||
GLK_COMMUNITY(0, 79),
|
||||
};
|
||||
|
||||
static const struct intel_pinctrl_soc_data glk_northwest_soc_data = {
|
||||
.uid = "1",
|
||||
.pins = glk_northwest_pins,
|
||||
.npins = ARRAY_SIZE(glk_northwest_pins),
|
||||
.groups = glk_northwest_groups,
|
||||
.ngroups = ARRAY_SIZE(glk_northwest_groups),
|
||||
.functions = glk_northwest_functions,
|
||||
.nfunctions = ARRAY_SIZE(glk_northwest_functions),
|
||||
.communities = glk_northwest_communities,
|
||||
.ncommunities = ARRAY_SIZE(glk_northwest_communities),
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc glk_north_pins[] = {
|
||||
PINCTRL_PIN(0, "SVID0_ALERT_B"),
|
||||
PINCTRL_PIN(1, "SVID0_DATA"),
|
||||
PINCTRL_PIN(2, "SVID0_CLK"),
|
||||
PINCTRL_PIN(3, "LPSS_SPI_0_CLK"),
|
||||
PINCTRL_PIN(4, "LPSS_SPI_0_FS0"),
|
||||
PINCTRL_PIN(5, "LPSS_SPI_0_FS1"),
|
||||
PINCTRL_PIN(6, "LPSS_SPI_0_RXD"),
|
||||
PINCTRL_PIN(7, "LPSS_SPI_0_TXD"),
|
||||
PINCTRL_PIN(8, "LPSS_SPI_1_CLK"),
|
||||
PINCTRL_PIN(9, "LPSS_SPI_1_FS0"),
|
||||
PINCTRL_PIN(10, "LPSS_SPI_1_FS1"),
|
||||
PINCTRL_PIN(11, "LPSS_SPI_1_FS2"),
|
||||
PINCTRL_PIN(12, "LPSS_SPI_1_RXD"),
|
||||
PINCTRL_PIN(13, "LPSS_SPI_1_TXD"),
|
||||
PINCTRL_PIN(14, "FST_SPI_CS0_B"),
|
||||
PINCTRL_PIN(15, "FST_SPI_CS1_B"),
|
||||
PINCTRL_PIN(16, "FST_SPI_MOSI_IO0"),
|
||||
PINCTRL_PIN(17, "FST_SPI_MISO_IO1"),
|
||||
PINCTRL_PIN(18, "FST_SPI_IO2"),
|
||||
PINCTRL_PIN(19, "FST_SPI_IO3"),
|
||||
PINCTRL_PIN(20, "FST_SPI_CLK"),
|
||||
PINCTRL_PIN(21, "FST_SPI_CLK_FB"),
|
||||
PINCTRL_PIN(22, "PMU_PLTRST_B"),
|
||||
PINCTRL_PIN(23, "PMU_PWRBTN_B"),
|
||||
PINCTRL_PIN(24, "PMU_SLP_S0_B"),
|
||||
PINCTRL_PIN(25, "PMU_SLP_S3_B"),
|
||||
PINCTRL_PIN(26, "PMU_SLP_S4_B"),
|
||||
PINCTRL_PIN(27, "SUSPWRDNACK"),
|
||||
PINCTRL_PIN(28, "EMMC_PWR_EN_B"),
|
||||
PINCTRL_PIN(29, "PMU_AC_PRESENT"),
|
||||
PINCTRL_PIN(30, "PMU_BATLOW_B"),
|
||||
PINCTRL_PIN(31, "PMU_RESETBUTTON_B"),
|
||||
PINCTRL_PIN(32, "PMU_SUSCLK"),
|
||||
PINCTRL_PIN(33, "SUS_STAT_B"),
|
||||
PINCTRL_PIN(34, "LPSS_I2C5_SDA"),
|
||||
PINCTRL_PIN(35, "LPSS_I2C5_SCL"),
|
||||
PINCTRL_PIN(36, "LPSS_I2C6_SDA"),
|
||||
PINCTRL_PIN(37, "LPSS_I2C6_SCL"),
|
||||
PINCTRL_PIN(38, "LPSS_I2C7_SDA"),
|
||||
PINCTRL_PIN(39, "LPSS_I2C7_SCL"),
|
||||
PINCTRL_PIN(40, "PCIE_WAKE0_B"),
|
||||
PINCTRL_PIN(41, "PCIE_WAKE1_B"),
|
||||
PINCTRL_PIN(42, "PCIE_WAKE2_B"),
|
||||
PINCTRL_PIN(43, "PCIE_WAKE3_B"),
|
||||
PINCTRL_PIN(44, "PCIE_CLKREQ0_B"),
|
||||
PINCTRL_PIN(45, "PCIE_CLKREQ1_B"),
|
||||
PINCTRL_PIN(46, "PCIE_CLKREQ2_B"),
|
||||
PINCTRL_PIN(47, "PCIE_CLKREQ3_B"),
|
||||
PINCTRL_PIN(48, "HV_DDI0_DDC_SDA"),
|
||||
PINCTRL_PIN(49, "HV_DDI0_DDC_SCL"),
|
||||
PINCTRL_PIN(50, "HV_DDI1_DDC_SDA"),
|
||||
PINCTRL_PIN(51, "HV_DDI1_DDC_SCL"),
|
||||
PINCTRL_PIN(52, "PANEL0_VDDEN"),
|
||||
PINCTRL_PIN(53, "PANEL0_BKLTEN"),
|
||||
PINCTRL_PIN(54, "PANEL0_BKLTCTL"),
|
||||
PINCTRL_PIN(55, "HV_DDI0_HPD"),
|
||||
PINCTRL_PIN(56, "HV_DDI1_HPD"),
|
||||
PINCTRL_PIN(57, "HV_EDP_HPD"),
|
||||
PINCTRL_PIN(58, "GPIO_134"),
|
||||
PINCTRL_PIN(59, "GPIO_135"),
|
||||
PINCTRL_PIN(60, "GPIO_136"),
|
||||
PINCTRL_PIN(61, "GPIO_137"),
|
||||
PINCTRL_PIN(62, "GPIO_138"),
|
||||
PINCTRL_PIN(63, "GPIO_139"),
|
||||
PINCTRL_PIN(64, "GPIO_140"),
|
||||
PINCTRL_PIN(65, "GPIO_141"),
|
||||
PINCTRL_PIN(66, "GPIO_142"),
|
||||
PINCTRL_PIN(67, "GPIO_143"),
|
||||
PINCTRL_PIN(68, "GPIO_144"),
|
||||
PINCTRL_PIN(69, "GPIO_145"),
|
||||
PINCTRL_PIN(70, "GPIO_146"),
|
||||
PINCTRL_PIN(71, "LPC_ILB_SERIRQ"),
|
||||
PINCTRL_PIN(72, "LPC_CLKOUT0"),
|
||||
PINCTRL_PIN(73, "LPC_CLKOUT1"),
|
||||
PINCTRL_PIN(74, "LPC_AD0"),
|
||||
PINCTRL_PIN(75, "LPC_AD1"),
|
||||
PINCTRL_PIN(76, "LPC_AD2"),
|
||||
PINCTRL_PIN(77, "LPC_AD3"),
|
||||
PINCTRL_PIN(78, "LPC_CLKRUNB"),
|
||||
PINCTRL_PIN(79, "LPC_FRAMEB"),
|
||||
};
|
||||
|
||||
static const unsigned int glk_north_spi0_pins[] = { 3, 4, 5, 6, 7 };
|
||||
static const unsigned int glk_north_spi1_pins[] = { 8, 9, 10, 11, 12, 13 };
|
||||
static const unsigned int glk_north_i2c5_pins[] = { 34, 35 };
|
||||
static const unsigned int glk_north_i2c6_pins[] = { 36, 37 };
|
||||
static const unsigned int glk_north_i2c7_pins[] = { 38, 39 };
|
||||
static const unsigned int glk_north_uart0_pins[] = { 62, 63, 64, 65 };
|
||||
static const unsigned int glk_north_spi0b_pins[] = { 66, 67, 68, 69, 70 };
|
||||
|
||||
static const struct intel_pingroup glk_north_groups[] = {
|
||||
PIN_GROUP("spi0_grp", glk_north_spi0_pins, 1),
|
||||
PIN_GROUP("spi1_grp", glk_north_spi1_pins, 1),
|
||||
PIN_GROUP("i2c5_grp", glk_north_i2c5_pins, 1),
|
||||
PIN_GROUP("i2c6_grp", glk_north_i2c6_pins, 1),
|
||||
PIN_GROUP("i2c7_grp", glk_north_i2c7_pins, 1),
|
||||
PIN_GROUP("uart0_grp", glk_north_uart0_pins, 2),
|
||||
PIN_GROUP("spi0b_grp", glk_north_spi0b_pins, 2),
|
||||
};
|
||||
|
||||
static const char * const glk_north_spi0_groups[] = { "spi0_grp", "spi0b_grp" };
|
||||
static const char * const glk_north_spi1_groups[] = { "spi1_grp" };
|
||||
static const char * const glk_north_i2c5_groups[] = { "i2c5_grp" };
|
||||
static const char * const glk_north_i2c6_groups[] = { "i2c6_grp" };
|
||||
static const char * const glk_north_i2c7_groups[] = { "i2c7_grp" };
|
||||
static const char * const glk_north_uart0_groups[] = { "uart0_grp" };
|
||||
|
||||
static const struct intel_function glk_north_functions[] = {
|
||||
FUNCTION("spi0", glk_north_spi0_groups),
|
||||
FUNCTION("spi1", glk_north_spi1_groups),
|
||||
FUNCTION("i2c5", glk_north_i2c5_groups),
|
||||
FUNCTION("i2c6", glk_north_i2c6_groups),
|
||||
FUNCTION("i2c7", glk_north_i2c7_groups),
|
||||
FUNCTION("uart0", glk_north_uart0_groups),
|
||||
};
|
||||
|
||||
static const struct intel_community glk_north_communities[] = {
|
||||
GLK_COMMUNITY(0, 79),
|
||||
};
|
||||
|
||||
static const struct intel_pinctrl_soc_data glk_north_soc_data = {
|
||||
.uid = "2",
|
||||
.pins = glk_north_pins,
|
||||
.npins = ARRAY_SIZE(glk_north_pins),
|
||||
.groups = glk_north_groups,
|
||||
.ngroups = ARRAY_SIZE(glk_north_groups),
|
||||
.functions = glk_north_functions,
|
||||
.nfunctions = ARRAY_SIZE(glk_north_functions),
|
||||
.communities = glk_north_communities,
|
||||
.ncommunities = ARRAY_SIZE(glk_north_communities),
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc glk_audio_pins[] = {
|
||||
PINCTRL_PIN(0, "AVS_I2S0_MCLK"),
|
||||
PINCTRL_PIN(1, "AVS_I2S0_BCLK"),
|
||||
PINCTRL_PIN(2, "AVS_I2S0_WS_SYNC"),
|
||||
PINCTRL_PIN(3, "AVS_I2S0_SDI"),
|
||||
PINCTRL_PIN(4, "AVS_I2S0_SDO"),
|
||||
PINCTRL_PIN(5, "AVS_I2S1_MCLK"),
|
||||
PINCTRL_PIN(6, "AVS_I2S1_BCLK"),
|
||||
PINCTRL_PIN(7, "AVS_I2S1_WS_SYNC"),
|
||||
PINCTRL_PIN(8, "AVS_I2S1_SDI"),
|
||||
PINCTRL_PIN(9, "AVS_I2S1_SDO"),
|
||||
PINCTRL_PIN(10, "AVS_HDA_BCLK"),
|
||||
PINCTRL_PIN(11, "AVS_HDA_WS_SYNC"),
|
||||
PINCTRL_PIN(12, "AVS_HDA_SDI"),
|
||||
PINCTRL_PIN(13, "AVS_HDA_SDO"),
|
||||
PINCTRL_PIN(14, "AVS_HDA_RSTB"),
|
||||
PINCTRL_PIN(15, "AVS_M_CLK_A1"),
|
||||
PINCTRL_PIN(16, "AVS_M_CLK_B1"),
|
||||
PINCTRL_PIN(17, "AVS_M_DATA_1"),
|
||||
PINCTRL_PIN(18, "AVS_M_CLK_AB2"),
|
||||
PINCTRL_PIN(19, "AVS_M_DATA_2"),
|
||||
};
|
||||
|
||||
static const struct intel_community glk_audio_communities[] = {
|
||||
GLK_COMMUNITY(0, 19),
|
||||
};
|
||||
|
||||
static const struct intel_pinctrl_soc_data glk_audio_soc_data = {
|
||||
.uid = "3",
|
||||
.pins = glk_audio_pins,
|
||||
.npins = ARRAY_SIZE(glk_audio_pins),
|
||||
.communities = glk_audio_communities,
|
||||
.ncommunities = ARRAY_SIZE(glk_audio_communities),
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc glk_scc_pins[] = {
|
||||
PINCTRL_PIN(0, "SMB_ALERTB"),
|
||||
PINCTRL_PIN(1, "SMB_CLK"),
|
||||
PINCTRL_PIN(2, "SMB_DATA"),
|
||||
PINCTRL_PIN(3, "SDCARD_LVL_WP"),
|
||||
PINCTRL_PIN(4, "SDCARD_CLK"),
|
||||
PINCTRL_PIN(5, "SDCARD_CLK_FB"),
|
||||
PINCTRL_PIN(6, "SDCARD_D0"),
|
||||
PINCTRL_PIN(7, "SDCARD_D1"),
|
||||
PINCTRL_PIN(8, "SDCARD_D2"),
|
||||
PINCTRL_PIN(9, "SDCARD_D3"),
|
||||
PINCTRL_PIN(10, "SDCARD_CMD"),
|
||||
PINCTRL_PIN(11, "SDCARD_CD_B"),
|
||||
PINCTRL_PIN(12, "SDCARD_PWR_DOWN_B"),
|
||||
PINCTRL_PIN(13, "GPIO_210"),
|
||||
PINCTRL_PIN(14, "OSC_CLK_OUT_0"),
|
||||
PINCTRL_PIN(15, "OSC_CLK_OUT_1"),
|
||||
PINCTRL_PIN(16, "CNV_BRI_DT"),
|
||||
PINCTRL_PIN(17, "CNV_BRI_RSP"),
|
||||
PINCTRL_PIN(18, "CNV_RGI_DT"),
|
||||
PINCTRL_PIN(19, "CNV_RGI_RSP"),
|
||||
PINCTRL_PIN(20, "CNV_RF_RESET_B"),
|
||||
PINCTRL_PIN(21, "XTAL_CLKREQ"),
|
||||
PINCTRL_PIN(22, "SDIO_CLK_FB"),
|
||||
PINCTRL_PIN(23, "EMMC0_CLK"),
|
||||
PINCTRL_PIN(24, "EMMC0_CLK_FB"),
|
||||
PINCTRL_PIN(25, "EMMC0_D0"),
|
||||
PINCTRL_PIN(26, "EMMC0_D1"),
|
||||
PINCTRL_PIN(27, "EMMC0_D2"),
|
||||
PINCTRL_PIN(28, "EMMC0_D3"),
|
||||
PINCTRL_PIN(29, "EMMC0_D4"),
|
||||
PINCTRL_PIN(30, "EMMC0_D5"),
|
||||
PINCTRL_PIN(31, "EMMC0_D6"),
|
||||
PINCTRL_PIN(32, "EMMC0_D7"),
|
||||
PINCTRL_PIN(33, "EMMC0_CMD"),
|
||||
PINCTRL_PIN(34, "EMMC0_STROBE"),
|
||||
};
|
||||
|
||||
static const unsigned int glk_scc_i2c7_pins[] = { 1, 2 };
|
||||
static const unsigned int glk_scc_sdcard_pins[] = {
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
};
|
||||
static const unsigned int glk_scc_sdio_pins[] = { 16, 17, 18, 19, 20, 21, 22 };
|
||||
static const unsigned int glk_scc_uart1_pins[] = { 16, 17, 18, 19 };
|
||||
static const unsigned int glk_scc_emmc_pins[] = {
|
||||
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
||||
};
|
||||
|
||||
static const struct intel_pingroup glk_scc_groups[] = {
|
||||
PIN_GROUP("i2c7_grp", glk_scc_i2c7_pins, 2),
|
||||
PIN_GROUP("sdcard_grp", glk_scc_sdcard_pins, 1),
|
||||
PIN_GROUP("sdio_grp", glk_scc_sdio_pins, 2),
|
||||
PIN_GROUP("uart1_grp", glk_scc_uart1_pins, 3),
|
||||
PIN_GROUP("emmc_grp", glk_scc_emmc_pins, 1),
|
||||
};
|
||||
|
||||
static const char * const glk_scc_i2c7_groups[] = { "i2c7_grp" };
|
||||
static const char * const glk_scc_sdcard_groups[] = { "sdcard_grp" };
|
||||
static const char * const glk_scc_sdio_groups[] = { "sdio_grp" };
|
||||
static const char * const glk_scc_uart1_groups[] = { "uart1_grp" };
|
||||
static const char * const glk_scc_emmc_groups[] = { "emmc_grp" };
|
||||
|
||||
static const struct intel_function glk_scc_functions[] = {
|
||||
FUNCTION("i2c7", glk_scc_i2c7_groups),
|
||||
FUNCTION("sdcard", glk_scc_sdcard_groups),
|
||||
FUNCTION("sdio", glk_scc_sdio_groups),
|
||||
FUNCTION("uart1", glk_scc_uart1_groups),
|
||||
FUNCTION("emmc", glk_scc_emmc_groups),
|
||||
};
|
||||
|
||||
static const struct intel_community glk_scc_communities[] = {
|
||||
GLK_COMMUNITY(0, 34),
|
||||
};
|
||||
|
||||
static const struct intel_pinctrl_soc_data glk_scc_soc_data = {
|
||||
.uid = "4",
|
||||
.pins = glk_scc_pins,
|
||||
.npins = ARRAY_SIZE(glk_scc_pins),
|
||||
.groups = glk_scc_groups,
|
||||
.ngroups = ARRAY_SIZE(glk_scc_groups),
|
||||
.functions = glk_scc_functions,
|
||||
.nfunctions = ARRAY_SIZE(glk_scc_functions),
|
||||
.communities = glk_scc_communities,
|
||||
.ncommunities = ARRAY_SIZE(glk_scc_communities),
|
||||
};
|
||||
|
||||
static const struct intel_pinctrl_soc_data *glk_pinctrl_soc_data[] = {
|
||||
&glk_northwest_soc_data,
|
||||
&glk_north_soc_data,
|
||||
&glk_audio_soc_data,
|
||||
&glk_scc_soc_data,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct acpi_device_id glk_pinctrl_acpi_match[] = {
|
||||
{ "INT3453" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, glk_pinctrl_acpi_match);
|
||||
|
||||
static int glk_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct intel_pinctrl_soc_data *soc_data = NULL;
|
||||
struct acpi_device *adev;
|
||||
int i;
|
||||
|
||||
adev = ACPI_COMPANION(&pdev->dev);
|
||||
if (!adev)
|
||||
return -ENODEV;
|
||||
|
||||
for (i = 0; glk_pinctrl_soc_data[i]; i++) {
|
||||
if (!strcmp(adev->pnp.unique_id,
|
||||
glk_pinctrl_soc_data[i]->uid)) {
|
||||
soc_data = glk_pinctrl_soc_data[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!soc_data)
|
||||
return -ENODEV;
|
||||
|
||||
return intel_pinctrl_probe(pdev, soc_data);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops glk_pinctrl_pm_ops = {
|
||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_pinctrl_suspend,
|
||||
intel_pinctrl_resume)
|
||||
};
|
||||
|
||||
static struct platform_driver glk_pinctrl_driver = {
|
||||
.probe = glk_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "geminilake-pinctrl",
|
||||
.acpi_match_table = glk_pinctrl_acpi_match,
|
||||
.pm = &glk_pinctrl_pm_ops,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init glk_pinctrl_init(void)
|
||||
{
|
||||
return platform_driver_register(&glk_pinctrl_driver);
|
||||
}
|
||||
subsys_initcall(glk_pinctrl_init);
|
||||
|
||||
static void __exit glk_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&glk_pinctrl_driver);
|
||||
}
|
||||
module_exit(glk_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Mika Westerberg <[email protected]>");
|
||||
MODULE_DESCRIPTION("Intel Gemini Lake SoC pinctrl/GPIO driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinmux.h>
|
||||
|
|
@ -23,6 +24,10 @@
|
|||
#include "pinctrl-intel.h"
|
||||
|
||||
/* Offset from regs */
|
||||
#define REVID 0x000
|
||||
#define REVID_SHIFT 16
|
||||
#define REVID_MASK GENMASK(31, 16)
|
||||
|
||||
#define PADBAR 0x00c
|
||||
#define GPI_IS 0x100
|
||||
#define GPI_GPE_STS 0x140
|
||||
|
|
@ -41,6 +46,7 @@
|
|||
#define PADCFG0_RXEVCFG_EDGE 1
|
||||
#define PADCFG0_RXEVCFG_DISABLED 2
|
||||
#define PADCFG0_RXEVCFG_EDGE_BOTH 3
|
||||
#define PADCFG0_PREGFRXSEL BIT(24)
|
||||
#define PADCFG0_RXINV BIT(23)
|
||||
#define PADCFG0_GPIROUTIOXAPIC BIT(20)
|
||||
#define PADCFG0_GPIROUTSCI BIT(19)
|
||||
|
|
@ -62,9 +68,17 @@
|
|||
#define PADCFG1_TERM_5K 2
|
||||
#define PADCFG1_TERM_1K 1
|
||||
|
||||
#define PADCFG2 0x008
|
||||
#define PADCFG2_DEBEN BIT(0)
|
||||
#define PADCFG2_DEBOUNCE_SHIFT 1
|
||||
#define PADCFG2_DEBOUNCE_MASK GENMASK(4, 1)
|
||||
|
||||
#define DEBOUNCE_PERIOD 31250 /* ns */
|
||||
|
||||
struct intel_pad_context {
|
||||
u32 padcfg0;
|
||||
u32 padcfg1;
|
||||
u32 padcfg2;
|
||||
};
|
||||
|
||||
struct intel_community_context {
|
||||
|
|
@ -126,13 +140,19 @@ static void __iomem *intel_get_padcfg(struct intel_pinctrl *pctrl, unsigned pin,
|
|||
{
|
||||
const struct intel_community *community;
|
||||
unsigned padno;
|
||||
size_t nregs;
|
||||
|
||||
community = intel_get_community(pctrl, pin);
|
||||
if (!community)
|
||||
return NULL;
|
||||
|
||||
padno = pin_to_padno(community, pin);
|
||||
return community->pad_regs + reg + padno * 8;
|
||||
nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2;
|
||||
|
||||
if (reg == PADCFG2 && !(community->features & PINCTRL_FEATURE_DEBOUNCE))
|
||||
return NULL;
|
||||
|
||||
return community->pad_regs + reg + padno * nregs * 4;
|
||||
}
|
||||
|
||||
static bool intel_pad_owned_by_host(struct intel_pinctrl *pctrl, unsigned pin)
|
||||
|
|
@ -244,6 +264,7 @@ static void intel_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
|
|||
unsigned pin)
|
||||
{
|
||||
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
void __iomem *padcfg;
|
||||
u32 cfg0, cfg1, mode;
|
||||
bool locked, acpi;
|
||||
|
||||
|
|
@ -263,6 +284,11 @@ static void intel_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
|
|||
|
||||
seq_printf(s, "0x%08x 0x%08x", cfg0, cfg1);
|
||||
|
||||
/* Dump the additional PADCFG registers if available */
|
||||
padcfg = intel_get_padcfg(pctrl, pin, PADCFG2);
|
||||
if (padcfg)
|
||||
seq_printf(s, " 0x%08x", readl(padcfg));
|
||||
|
||||
locked = intel_pad_locked(pctrl, pin);
|
||||
acpi = intel_pad_acpi_mode(pctrl, pin);
|
||||
|
||||
|
|
@ -432,12 +458,14 @@ static int intel_config_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
{
|
||||
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param = pinconf_to_config_param(*config);
|
||||
const struct intel_community *community;
|
||||
u32 value, term;
|
||||
u16 arg = 0;
|
||||
u32 arg = 0;
|
||||
|
||||
if (!intel_pad_owned_by_host(pctrl, pin))
|
||||
return -ENOTSUPP;
|
||||
|
||||
community = intel_get_community(pctrl, pin);
|
||||
value = readl(intel_get_padcfg(pctrl, pin, PADCFG1));
|
||||
term = (value & PADCFG1_TERM_MASK) >> PADCFG1_TERM_SHIFT;
|
||||
|
||||
|
|
@ -473,6 +501,11 @@ static int intel_config_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
return -EINVAL;
|
||||
|
||||
switch (term) {
|
||||
case PADCFG1_TERM_1K:
|
||||
if (!(community->features & PINCTRL_FEATURE_1K_PD))
|
||||
return -EINVAL;
|
||||
arg = 1000;
|
||||
break;
|
||||
case PADCFG1_TERM_5K:
|
||||
arg = 5000;
|
||||
break;
|
||||
|
|
@ -483,6 +516,24 @@ static int intel_config_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_INPUT_DEBOUNCE: {
|
||||
void __iomem *padcfg2;
|
||||
u32 v;
|
||||
|
||||
padcfg2 = intel_get_padcfg(pctrl, pin, PADCFG2);
|
||||
if (!padcfg2)
|
||||
return -ENOTSUPP;
|
||||
|
||||
v = readl(padcfg2);
|
||||
if (!(v & PADCFG2_DEBEN))
|
||||
return -EINVAL;
|
||||
|
||||
v = (v & PADCFG2_DEBOUNCE_MASK) >> PADCFG2_DEBOUNCE_SHIFT;
|
||||
arg = BIT(v) * DEBOUNCE_PERIOD / 1000;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
|
@ -496,6 +547,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,
|
|||
{
|
||||
unsigned param = pinconf_to_config_param(config);
|
||||
unsigned arg = pinconf_to_config_argument(config);
|
||||
const struct intel_community *community;
|
||||
void __iomem *padcfg1;
|
||||
unsigned long flags;
|
||||
int ret = 0;
|
||||
|
|
@ -503,6 +555,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,
|
|||
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
community = intel_get_community(pctrl, pin);
|
||||
padcfg1 = intel_get_padcfg(pctrl, pin, PADCFG1);
|
||||
value = readl(padcfg1);
|
||||
|
||||
|
|
@ -545,6 +598,13 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,
|
|||
case 5000:
|
||||
value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT;
|
||||
break;
|
||||
case 1000:
|
||||
if (!(community->features & PINCTRL_FEATURE_1K_PD)) {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
|
@ -560,6 +620,53 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int intel_config_set_debounce(struct intel_pinctrl *pctrl, unsigned pin,
|
||||
unsigned debounce)
|
||||
{
|
||||
void __iomem *padcfg0, *padcfg2;
|
||||
unsigned long flags;
|
||||
u32 value0, value2;
|
||||
int ret = 0;
|
||||
|
||||
padcfg2 = intel_get_padcfg(pctrl, pin, PADCFG2);
|
||||
if (!padcfg2)
|
||||
return -ENOTSUPP;
|
||||
|
||||
padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0);
|
||||
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
value0 = readl(padcfg0);
|
||||
value2 = readl(padcfg2);
|
||||
|
||||
/* Disable glitch filter and debouncer */
|
||||
value0 &= ~PADCFG0_PREGFRXSEL;
|
||||
value2 &= ~(PADCFG2_DEBEN | PADCFG2_DEBOUNCE_MASK);
|
||||
|
||||
if (debounce) {
|
||||
unsigned long v;
|
||||
|
||||
v = order_base_2(debounce * 1000 / DEBOUNCE_PERIOD);
|
||||
if (v < 3 || v > 15) {
|
||||
ret = -EINVAL;
|
||||
goto exit_unlock;
|
||||
} else {
|
||||
/* Enable glitch filter and debouncer */
|
||||
value0 |= PADCFG0_PREGFRXSEL;
|
||||
value2 |= v << PADCFG2_DEBOUNCE_SHIFT;
|
||||
value2 |= PADCFG2_DEBEN;
|
||||
}
|
||||
}
|
||||
|
||||
writel(value0, padcfg0);
|
||||
writel(value2, padcfg2);
|
||||
|
||||
exit_unlock:
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int intel_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
unsigned long *configs, unsigned nconfigs)
|
||||
{
|
||||
|
|
@ -579,6 +686,13 @@ static int intel_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
return ret;
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_INPUT_DEBOUNCE:
|
||||
ret = intel_config_set_debounce(pctrl, pin,
|
||||
pinconf_to_config_argument(configs[i]));
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
|
@ -653,6 +767,7 @@ static const struct gpio_chip intel_gpio_chip = {
|
|||
.direction_output = intel_gpio_direction_output,
|
||||
.get = intel_gpio_get,
|
||||
.set = intel_gpio_set,
|
||||
.set_config = gpiochip_generic_config,
|
||||
};
|
||||
|
||||
static void intel_gpio_irq_ack(struct irq_data *d)
|
||||
|
|
@ -892,7 +1007,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
|
|||
pctrl->chip.base = -1;
|
||||
pctrl->irq = irq;
|
||||
|
||||
ret = gpiochip_add_data(&pctrl->chip, pctrl);
|
||||
ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
|
||||
if (ret) {
|
||||
dev_err(pctrl->dev, "failed to register gpiochip\n");
|
||||
return ret;
|
||||
|
|
@ -902,7 +1017,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
|
|||
0, 0, pctrl->soc->npins);
|
||||
if (ret) {
|
||||
dev_err(pctrl->dev, "failed to add GPIO pin range\n");
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -915,24 +1030,19 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
|
|||
dev_name(pctrl->dev), pctrl);
|
||||
if (ret) {
|
||||
dev_err(pctrl->dev, "failed to request interrupt\n");
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = gpiochip_irqchip_add(&pctrl->chip, &intel_gpio_irqchip, 0,
|
||||
handle_bad_irq, IRQ_TYPE_NONE);
|
||||
if (ret) {
|
||||
dev_err(pctrl->dev, "failed to add irqchip\n");
|
||||
goto fail;
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpiochip_set_chained_irqchip(&pctrl->chip, &intel_gpio_irqchip, irq,
|
||||
NULL);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
gpiochip_remove(&pctrl->chip);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int intel_pinctrl_pm_init(struct intel_pinctrl *pctrl)
|
||||
|
|
@ -1013,6 +1123,20 @@ int intel_pinctrl_probe(struct platform_device *pdev,
|
|||
if (IS_ERR(regs))
|
||||
return PTR_ERR(regs);
|
||||
|
||||
/*
|
||||
* Determine community features based on the revision if
|
||||
* not specified already.
|
||||
*/
|
||||
if (!community->features) {
|
||||
u32 rev;
|
||||
|
||||
rev = (readl(regs + REVID) & REVID_MASK) >> REVID_SHIFT;
|
||||
if (rev >= 0x94) {
|
||||
community->features |= PINCTRL_FEATURE_DEBOUNCE;
|
||||
community->features |= PINCTRL_FEATURE_1K_PD;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read offset of the pad configuration registers */
|
||||
padbar = readl(regs + PADBAR);
|
||||
|
||||
|
|
@ -1054,16 +1178,6 @@ int intel_pinctrl_probe(struct platform_device *pdev,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(intel_pinctrl_probe);
|
||||
|
||||
int intel_pinctrl_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct intel_pinctrl *pctrl = platform_get_drvdata(pdev);
|
||||
|
||||
gpiochip_remove(&pctrl->chip);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(intel_pinctrl_remove);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned pin)
|
||||
{
|
||||
|
|
@ -1096,6 +1210,7 @@ int intel_pinctrl_suspend(struct device *dev)
|
|||
pads = pctrl->context.pads;
|
||||
for (i = 0; i < pctrl->soc->npins; i++) {
|
||||
const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i];
|
||||
void __iomem *padcfg;
|
||||
u32 val;
|
||||
|
||||
if (!intel_pinctrl_should_save(pctrl, desc->number))
|
||||
|
|
@ -1105,6 +1220,10 @@ int intel_pinctrl_suspend(struct device *dev)
|
|||
pads[i].padcfg0 = val & ~PADCFG0_GPIORXSTATE;
|
||||
val = readl(intel_get_padcfg(pctrl, desc->number, PADCFG1));
|
||||
pads[i].padcfg1 = val;
|
||||
|
||||
padcfg = intel_get_padcfg(pctrl, desc->number, PADCFG2);
|
||||
if (padcfg)
|
||||
pads[i].padcfg2 = readl(padcfg);
|
||||
}
|
||||
|
||||
communities = pctrl->context.communities;
|
||||
|
|
@ -1177,6 +1296,16 @@ int intel_pinctrl_resume(struct device *dev)
|
|||
dev_dbg(dev, "restored pin %u padcfg1 %#08x\n",
|
||||
desc->number, readl(padcfg));
|
||||
}
|
||||
|
||||
padcfg = intel_get_padcfg(pctrl, desc->number, PADCFG2);
|
||||
if (padcfg) {
|
||||
val = readl(padcfg);
|
||||
if (val != pads[i].padcfg2) {
|
||||
writel(pads[i].padcfg2, padcfg);
|
||||
dev_dbg(dev, "restored pin %u padcfg2 %#08x\n",
|
||||
desc->number, readl(padcfg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
communities = pctrl->context.communities;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ struct intel_function {
|
|||
* @gpp_size: Maximum number of pads in each group, such as PADCFGLOCK,
|
||||
* HOSTSW_OWN, GPI_IS, GPI_IE, etc.
|
||||
* @npins: Number of pins in this community
|
||||
* @features: Additional features supported by the hardware
|
||||
* @regs: Community specific common registers (reserved for core driver)
|
||||
* @pad_regs: Community specific pad registers (reserved for core driver)
|
||||
* @ngpps: Number of groups (hw groups) in this community (reserved for
|
||||
|
|
@ -72,11 +73,16 @@ struct intel_community {
|
|||
unsigned pin_base;
|
||||
unsigned gpp_size;
|
||||
size_t npins;
|
||||
unsigned features;
|
||||
void __iomem *regs;
|
||||
void __iomem *pad_regs;
|
||||
size_t ngpps;
|
||||
};
|
||||
|
||||
/* Additional features supported by the hardware */
|
||||
#define PINCTRL_FEATURE_DEBOUNCE BIT(0)
|
||||
#define PINCTRL_FEATURE_1K_PD BIT(1)
|
||||
|
||||
#define PIN_GROUP(n, p, m) \
|
||||
{ \
|
||||
.name = (n), \
|
||||
|
|
@ -121,8 +127,6 @@ struct intel_pinctrl_soc_data {
|
|||
|
||||
int intel_pinctrl_probe(struct platform_device *pdev,
|
||||
const struct intel_pinctrl_soc_data *soc_data);
|
||||
int intel_pinctrl_remove(struct platform_device *pdev);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
int intel_pinctrl_suspend(struct device *dev);
|
||||
int intel_pinctrl_resume(struct device *dev);
|
||||
|
|
|
|||
|
|
@ -574,7 +574,6 @@ static const struct dev_pm_ops spt_pinctrl_pm_ops = {
|
|||
|
||||
static struct platform_driver spt_pinctrl_driver = {
|
||||
.probe = spt_pinctrl_probe,
|
||||
.remove = intel_pinctrl_remove,
|
||||
.driver = {
|
||||
.name = "sunrisepoint-pinctrl",
|
||||
.acpi_match_table = spt_pinctrl_acpi_match,
|
||||
|
|
|
|||
|
|
@ -10,25 +10,29 @@ config PINCTRL_MTK
|
|||
|
||||
# For ARMv7 SoCs
|
||||
config PINCTRL_MT2701
|
||||
bool "Mediatek MT2701 pin control" if COMPILE_TEST && !MACH_MT2701
|
||||
bool "Mediatek MT2701 pin control"
|
||||
depends on MACH_MT2701 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT2701
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT7623
|
||||
bool "Mediatek MT7623 pin control" if COMPILE_TEST && !MACH_MT7623
|
||||
bool "Mediatek MT7623 pin control"
|
||||
depends on MACH_MT7623 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT7623
|
||||
select PINCTRL_MTK_COMMON
|
||||
|
||||
config PINCTRL_MT8135
|
||||
bool "Mediatek MT8135 pin control" if COMPILE_TEST && !MACH_MT8135
|
||||
bool "Mediatek MT8135 pin control"
|
||||
depends on MACH_MT8135 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT8135
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT8127
|
||||
bool "Mediatek MT8127 pin control" if COMPILE_TEST && !MACH_MT8127
|
||||
bool "Mediatek MT8127 pin control"
|
||||
depends on MACH_MT8127 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT8127
|
||||
select PINCTRL_MTK
|
||||
|
|
@ -43,7 +47,8 @@ config PINCTRL_MT8173
|
|||
|
||||
# For PMIC
|
||||
config PINCTRL_MT6397
|
||||
bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397
|
||||
bool "Mediatek MT6397 pin control"
|
||||
depends on MFD_MT6397 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MFD_MT6397
|
||||
select PINCTRL_MTK
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (c) 2016 John Crispin <john@phrozen.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
|
|
|
|||
|
|
@ -1054,6 +1054,18 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned offset,
|
||||
unsigned long config)
|
||||
{
|
||||
u32 debounce;
|
||||
|
||||
if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
|
||||
return -ENOTSUPP;
|
||||
|
||||
debounce = pinconf_to_config_argument(config);
|
||||
return mtk_gpio_set_debounce(chip, offset, debounce);
|
||||
}
|
||||
|
||||
static const struct gpio_chip mtk_gpio_chip = {
|
||||
.owner = THIS_MODULE,
|
||||
.request = gpiochip_generic_request,
|
||||
|
|
@ -1064,7 +1076,7 @@ static const struct gpio_chip mtk_gpio_chip = {
|
|||
.get = mtk_gpio_get,
|
||||
.set = mtk_gpio_set,
|
||||
.to_irq = mtk_gpio_to_irq,
|
||||
.set_debounce = mtk_gpio_set_debounce,
|
||||
.set_config = mtk_gpio_set_config,
|
||||
.of_gpio_n_cells = 2,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (c) 2016 John Crispin <john@phrozen.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
|
|
|
|||
|
|
@ -232,6 +232,10 @@ static const unsigned int pwm_e_pins[] = { PIN(GPIOX_19, EE_OFF) };
|
|||
static const unsigned int pwm_f_x_pins[] = { PIN(GPIOX_7, EE_OFF) };
|
||||
static const unsigned int pwm_f_y_pins[] = { PIN(GPIOY_15, EE_OFF) };
|
||||
|
||||
static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) };
|
||||
static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) };
|
||||
static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) };
|
||||
|
||||
static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = {
|
||||
MESON_PIN(GPIOAO_0, 0),
|
||||
MESON_PIN(GPIOAO_1, 0),
|
||||
|
|
@ -439,6 +443,11 @@ static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
|
|||
GROUP(eth_txd2, 6, 3),
|
||||
GROUP(eth_txd3, 6, 2),
|
||||
|
||||
/* Bank H */
|
||||
GROUP(hdmi_hpd, 1, 26),
|
||||
GROUP(hdmi_sda, 1, 25),
|
||||
GROUP(hdmi_scl, 1, 24),
|
||||
|
||||
/* Bank DV */
|
||||
GROUP(uart_tx_b, 2, 29),
|
||||
GROUP(uart_rx_b, 2, 28),
|
||||
|
|
@ -635,6 +644,14 @@ static const char * const pwm_f_y_groups[] = {
|
|||
"pwm_f_y",
|
||||
};
|
||||
|
||||
static const char * const hdmi_hpd_groups[] = {
|
||||
"hdmi_hpd",
|
||||
};
|
||||
|
||||
static const char * const hdmi_i2c_groups[] = {
|
||||
"hdmi_sda", "hdmi_scl",
|
||||
};
|
||||
|
||||
static const char * const gpio_aobus_groups[] = {
|
||||
"GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
|
||||
"GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
|
||||
|
|
@ -698,6 +715,8 @@ static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
|
|||
FUNCTION(pwm_e),
|
||||
FUNCTION(pwm_f_x),
|
||||
FUNCTION(pwm_f_y),
|
||||
FUNCTION(hdmi_hpd),
|
||||
FUNCTION(hdmi_i2c),
|
||||
};
|
||||
|
||||
static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
|
||||
|
|
|
|||
|
|
@ -197,6 +197,10 @@ static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) };
|
|||
|
||||
static const unsigned int pwm_e_pins[] = { PIN(GPIOX_16, EE_OFF) };
|
||||
|
||||
static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) };
|
||||
static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) };
|
||||
static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) };
|
||||
|
||||
static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = {
|
||||
MESON_PIN(GPIOAO_0, 0),
|
||||
MESON_PIN(GPIOAO_1, 0),
|
||||
|
|
@ -221,6 +225,8 @@ static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) };
|
|||
|
||||
static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
|
||||
|
||||
static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) };
|
||||
|
||||
static struct meson_pmx_group meson_gxl_periphs_groups[] = {
|
||||
GPIO_GROUP(GPIOZ_0, EE_OFF),
|
||||
GPIO_GROUP(GPIOZ_1, EE_OFF),
|
||||
|
|
@ -362,6 +368,11 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = {
|
|||
GROUP(eth_txd2, 4, 11),
|
||||
GROUP(eth_txd3, 4, 10),
|
||||
|
||||
/* Bank H */
|
||||
GROUP(hdmi_hpd, 6, 31),
|
||||
GROUP(hdmi_sda, 6, 30),
|
||||
GROUP(hdmi_scl, 6, 29),
|
||||
|
||||
/* Bank DV */
|
||||
GROUP(uart_tx_b, 2, 16),
|
||||
GROUP(uart_rx_b, 2, 15),
|
||||
|
|
@ -417,6 +428,7 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = {
|
|||
GROUP(uart_cts_ao_b, 0, 8),
|
||||
GROUP(uart_rts_ao_b, 0, 7),
|
||||
GROUP(remote_input_ao, 0, 0),
|
||||
GROUP(pwm_ao_b, 0, 3),
|
||||
};
|
||||
|
||||
static const char * const gpio_periphs_groups[] = {
|
||||
|
|
@ -505,6 +517,14 @@ static const char * const pwm_e_groups[] = {
|
|||
"pwm_e",
|
||||
};
|
||||
|
||||
static const char * const hdmi_hpd_groups[] = {
|
||||
"hdmi_hpd",
|
||||
};
|
||||
|
||||
static const char * const hdmi_i2c_groups[] = {
|
||||
"hdmi_sda", "hdmi_scl",
|
||||
};
|
||||
|
||||
static const char * const gpio_aobus_groups[] = {
|
||||
"GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
|
||||
"GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
|
||||
|
|
@ -522,6 +542,10 @@ static const char * const remote_input_ao_groups[] = {
|
|||
"remote_input_ao",
|
||||
};
|
||||
|
||||
static const char * const pwm_ao_b_groups[] = {
|
||||
"pwm_ao_b",
|
||||
};
|
||||
|
||||
static struct meson_pmx_func meson_gxl_periphs_functions[] = {
|
||||
FUNCTION(gpio_periphs),
|
||||
FUNCTION(emmc),
|
||||
|
|
@ -536,6 +560,8 @@ static struct meson_pmx_func meson_gxl_periphs_functions[] = {
|
|||
FUNCTION(i2c_c),
|
||||
FUNCTION(eth),
|
||||
FUNCTION(pwm_e),
|
||||
FUNCTION(hdmi_hpd),
|
||||
FUNCTION(hdmi_i2c),
|
||||
};
|
||||
|
||||
static struct meson_pmx_func meson_gxl_aobus_functions[] = {
|
||||
|
|
@ -543,6 +569,7 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = {
|
|||
FUNCTION(uart_ao),
|
||||
FUNCTION(uart_ao_b),
|
||||
FUNCTION(remote_input_ao),
|
||||
FUNCTION(pwm_ao_b),
|
||||
};
|
||||
|
||||
static struct meson_bank meson_gxl_periphs_banks[] = {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
enum pin_config_param param;
|
||||
unsigned int reg, bit;
|
||||
int i, ret;
|
||||
u16 arg;
|
||||
|
||||
ret = meson_get_bank(pc, pin, &bank);
|
||||
if (ret)
|
||||
|
|
@ -268,7 +267,6 @@ static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -23,18 +22,6 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
|
||||
static int armada_370_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int armada_370_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
|
||||
MPP_MODE(0,
|
||||
MPP_FUNCTION(0x0, "gpio", NULL),
|
||||
|
|
@ -384,8 +371,8 @@ static const struct of_device_id armada_370_pinctrl_of_match[] = {
|
|||
{ },
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 65, NULL, armada_370_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 65, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv88f6710_mpp_gpio_ranges[] = {
|
||||
|
|
@ -397,12 +384,6 @@ static struct pinctrl_gpio_range mv88f6710_mpp_gpio_ranges[] = {
|
|||
static int armada_370_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mvebu_pinctrl_soc_info *soc = &armada_370_pinctrl_info;
|
||||
struct resource *res;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
soc->variant = 0; /* no variants for Armada 370 */
|
||||
soc->controls = mv88f6710_mpp_controls;
|
||||
|
|
@ -414,7 +395,7 @@ static int armada_370_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = soc;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver armada_370_pinctrl_driver = {
|
||||
|
|
@ -424,9 +405,4 @@ static struct platform_driver armada_370_pinctrl_driver = {
|
|||
},
|
||||
.probe = armada_370_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(armada_370_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(armada_370_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -23,18 +22,6 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
|
||||
static int armada_375_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int armada_375_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static struct mvebu_mpp_mode mv88f6720_mpp_modes[] = {
|
||||
MPP_MODE(0,
|
||||
MPP_FUNCTION(0x0, "gpio", NULL),
|
||||
|
|
@ -402,8 +389,8 @@ static const struct of_device_id armada_375_pinctrl_of_match[] = {
|
|||
{ },
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 69, NULL, armada_375_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 69, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv88f6720_mpp_gpio_ranges[] = {
|
||||
|
|
@ -415,12 +402,6 @@ static struct pinctrl_gpio_range mv88f6720_mpp_gpio_ranges[] = {
|
|||
static int armada_375_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mvebu_pinctrl_soc_info *soc = &armada_375_pinctrl_info;
|
||||
struct resource *res;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
soc->variant = 0; /* no variants for Armada 375 */
|
||||
soc->controls = mv88f6720_mpp_controls;
|
||||
|
|
@ -432,7 +413,7 @@ static int armada_375_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = soc;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver armada_375_pinctrl_driver = {
|
||||
|
|
@ -442,9 +423,4 @@ static struct platform_driver armada_375_pinctrl_driver = {
|
|||
},
|
||||
.probe = armada_375_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(armada_375_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Armada 375 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(armada_375_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
|
|
@ -22,18 +21,6 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
|
||||
static int armada_38x_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int armada_38x_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
enum {
|
||||
V_88F6810 = BIT(0),
|
||||
V_88F6820 = BIT(1),
|
||||
|
|
@ -409,8 +396,8 @@ static const struct of_device_id armada_38x_pinctrl_of_match[] = {
|
|||
{ },
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl armada_38x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 59, NULL, armada_38x_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl armada_38x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 59, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range armada_38x_mpp_gpio_ranges[] = {
|
||||
|
|
@ -423,16 +410,10 @@ static int armada_38x_pinctrl_probe(struct platform_device *pdev)
|
|||
struct mvebu_pinctrl_soc_info *soc = &armada_38x_pinctrl_info;
|
||||
const struct of_device_id *match =
|
||||
of_match_device(armada_38x_pinctrl_of_match, &pdev->dev);
|
||||
struct resource *res;
|
||||
|
||||
if (!match)
|
||||
return -ENODEV;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
soc->variant = (unsigned) match->data & 0xff;
|
||||
soc->controls = armada_38x_mpp_controls;
|
||||
soc->ncontrols = ARRAY_SIZE(armada_38x_mpp_controls);
|
||||
|
|
@ -443,7 +424,7 @@ static int armada_38x_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = soc;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver armada_38x_pinctrl_driver = {
|
||||
|
|
@ -453,9 +434,4 @@ static struct platform_driver armada_38x_pinctrl_driver = {
|
|||
},
|
||||
.probe = armada_38x_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(armada_38x_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Armada 38x pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(armada_38x_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
|
|
@ -22,18 +21,6 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
|
||||
static int armada_39x_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int armada_39x_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
enum {
|
||||
V_88F6920 = BIT(0),
|
||||
V_88F6925 = BIT(1),
|
||||
|
|
@ -391,8 +378,8 @@ static const struct of_device_id armada_39x_pinctrl_of_match[] = {
|
|||
{ },
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 59, NULL, armada_39x_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 59, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range armada_39x_mpp_gpio_ranges[] = {
|
||||
|
|
@ -405,16 +392,10 @@ static int armada_39x_pinctrl_probe(struct platform_device *pdev)
|
|||
struct mvebu_pinctrl_soc_info *soc = &armada_39x_pinctrl_info;
|
||||
const struct of_device_id *match =
|
||||
of_match_device(armada_39x_pinctrl_of_match, &pdev->dev);
|
||||
struct resource *res;
|
||||
|
||||
if (!match)
|
||||
return -ENODEV;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
soc->variant = (unsigned) match->data & 0xff;
|
||||
soc->controls = armada_39x_mpp_controls;
|
||||
soc->ncontrols = ARRAY_SIZE(armada_39x_mpp_controls);
|
||||
|
|
@ -425,7 +406,7 @@ static int armada_39x_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = soc;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver armada_39x_pinctrl_driver = {
|
||||
|
|
@ -435,9 +416,4 @@ static struct platform_driver armada_39x_pinctrl_driver = {
|
|||
},
|
||||
.probe = armada_39x_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(armada_39x_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Armada 39x pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(armada_39x_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -30,25 +29,18 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
static u32 *mpp_saved_regs;
|
||||
|
||||
static int armada_xp_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int armada_xp_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
enum armada_xp_variant {
|
||||
V_MV78230 = BIT(0),
|
||||
V_MV78260 = BIT(1),
|
||||
V_MV78460 = BIT(2),
|
||||
V_MV78230_PLUS = (V_MV78230 | V_MV78260 | V_MV78460),
|
||||
V_MV78260_PLUS = (V_MV78260 | V_MV78460),
|
||||
V_98DX3236 = BIT(3),
|
||||
V_98DX3336 = BIT(4),
|
||||
V_98DX4251 = BIT(5),
|
||||
V_98DX3236_PLUS = (V_98DX3236 | V_98DX3336 | V_98DX4251),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
|
||||
|
|
@ -360,6 +352,131 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
|
|||
MPP_VAR_FUNCTION(0x1, "dev", "ad31", V_MV78260_PLUS)),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
|
||||
MPP_MODE(0,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "spi0", "mosi", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad8", V_98DX3236_PLUS)),
|
||||
MPP_MODE(1,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "spi0", "miso", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad9", V_98DX3236_PLUS)),
|
||||
MPP_MODE(2,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "spi0", "sck", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad10", V_98DX3236_PLUS)),
|
||||
MPP_MODE(3,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "spi0", "cs0", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad11", V_98DX3236_PLUS)),
|
||||
MPP_MODE(4,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "spi0", "cs1", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "smi", "mdc", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "cs0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(5,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "pex", "rsto", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "cmd", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "bootcs", V_98DX3236_PLUS)),
|
||||
MPP_MODE(6,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "clk", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "a2", V_98DX3236_PLUS)),
|
||||
MPP_MODE(7,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "d0", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ale0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(8,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "d1", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ale1", V_98DX3236_PLUS)),
|
||||
MPP_MODE(9,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "d2", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ready0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(10,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "sd0", "d3", V_98DX4251),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad12", V_98DX3236_PLUS)),
|
||||
MPP_MODE(11,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "uart1", "rxd", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "uart0", "cts", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad13", V_98DX3236_PLUS)),
|
||||
MPP_MODE(12,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x2, "uart1", "txd", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "uart0", "rts", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad14", V_98DX3236_PLUS)),
|
||||
MPP_MODE(13,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "intr", "out", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "ad15", V_98DX3236_PLUS)),
|
||||
MPP_MODE(14,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "i2c0", "sck", V_98DX3236_PLUS)),
|
||||
MPP_MODE(15,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "i2c0", "sda", V_98DX3236_PLUS)),
|
||||
MPP_MODE(16,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "oe", V_98DX3236_PLUS)),
|
||||
MPP_MODE(17,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "clkout", V_98DX3236_PLUS)),
|
||||
MPP_MODE(18,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "uart1", "txd", V_98DX3236_PLUS)),
|
||||
MPP_MODE(19,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "rb", V_98DX3236_PLUS)),
|
||||
MPP_MODE(20,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "we0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(21,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(22,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad1", V_98DX3236_PLUS)),
|
||||
MPP_MODE(23,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad2", V_98DX3236_PLUS)),
|
||||
MPP_MODE(24,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad3", V_98DX3236_PLUS)),
|
||||
MPP_MODE(25,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad4", V_98DX3236_PLUS)),
|
||||
MPP_MODE(26,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad5", V_98DX3236_PLUS)),
|
||||
MPP_MODE(27,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad6", V_98DX3236_PLUS)),
|
||||
MPP_MODE(28,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "ad7", V_98DX3236_PLUS)),
|
||||
MPP_MODE(29,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "a0", V_98DX3236_PLUS)),
|
||||
MPP_MODE(30,
|
||||
MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "dev", "a1", V_98DX3236_PLUS)),
|
||||
MPP_MODE(31,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "slv_smi", "mdc", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "smi", "mdc", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "we1", V_98DX3236_PLUS)),
|
||||
MPP_MODE(32,
|
||||
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x1, "slv_smi", "mdio", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x3, "smi", "mdio", V_98DX3236_PLUS),
|
||||
MPP_VAR_FUNCTION(0x4, "dev", "cs1", V_98DX3236_PLUS)),
|
||||
};
|
||||
|
||||
static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info;
|
||||
|
||||
static const struct of_device_id armada_xp_pinctrl_of_match[] = {
|
||||
|
|
@ -375,11 +492,19 @@ static const struct of_device_id armada_xp_pinctrl_of_match[] = {
|
|||
.compatible = "marvell,mv78460-pinctrl",
|
||||
.data = (void *) V_MV78460,
|
||||
},
|
||||
{
|
||||
.compatible = "marvell,98dx3236-pinctrl",
|
||||
.data = (void *) V_98DX3236,
|
||||
},
|
||||
{
|
||||
.compatible = "marvell,98dx4251-pinctrl",
|
||||
.data = (void *) V_98DX4251,
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv78230_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 48, NULL, armada_xp_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv78230_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 48, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = {
|
||||
|
|
@ -387,8 +512,8 @@ static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = {
|
|||
MPP_GPIO_RANGE(1, 32, 32, 17),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv78260_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv78260_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 66, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = {
|
||||
|
|
@ -397,8 +522,8 @@ static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = {
|
|||
MPP_GPIO_RANGE(2, 64, 64, 3),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv78460_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv78460_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 66, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv78460_mpp_gpio_ranges[] = {
|
||||
|
|
@ -407,6 +532,14 @@ static struct pinctrl_gpio_range mv78460_mpp_gpio_ranges[] = {
|
|||
MPP_GPIO_RANGE(2, 64, 64, 3),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv98dx3236_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 32, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv98dx3236_mpp_gpio_ranges[] = {
|
||||
MPP_GPIO_RANGE(0, 0, 0, 32),
|
||||
};
|
||||
|
||||
static int armada_xp_pinctrl_suspend(struct platform_device *pdev,
|
||||
pm_message_t state)
|
||||
{
|
||||
|
|
@ -417,7 +550,7 @@ static int armada_xp_pinctrl_suspend(struct platform_device *pdev,
|
|||
nregs = DIV_ROUND_UP(soc->nmodes, MVEBU_MPPS_PER_REG);
|
||||
|
||||
for (i = 0; i < nregs; i++)
|
||||
mpp_saved_regs[i] = readl(mpp_base + i * 4);
|
||||
mpp_saved_regs[i] = readl(soc->control_data[0].base + i * 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -431,7 +564,7 @@ static int armada_xp_pinctrl_resume(struct platform_device *pdev)
|
|||
nregs = DIV_ROUND_UP(soc->nmodes, MVEBU_MPPS_PER_REG);
|
||||
|
||||
for (i = 0; i < nregs; i++)
|
||||
writel(mpp_saved_regs[i], mpp_base + i * 4);
|
||||
writel(mpp_saved_regs[i], soc->control_data[0].base + i * 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -441,17 +574,11 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev)
|
|||
struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info;
|
||||
const struct of_device_id *match =
|
||||
of_match_device(armada_xp_pinctrl_of_match, &pdev->dev);
|
||||
struct resource *res;
|
||||
int nregs;
|
||||
|
||||
if (!match)
|
||||
return -ENODEV;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
soc->variant = (unsigned) match->data & 0xff;
|
||||
|
||||
switch (soc->variant) {
|
||||
|
|
@ -488,6 +615,17 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev)
|
|||
soc->gpioranges = mv78460_mpp_gpio_ranges;
|
||||
soc->ngpioranges = ARRAY_SIZE(mv78460_mpp_gpio_ranges);
|
||||
break;
|
||||
case V_98DX3236:
|
||||
case V_98DX3336:
|
||||
case V_98DX4251:
|
||||
/* fall-through */
|
||||
soc->controls = mv98dx3236_mpp_controls;
|
||||
soc->ncontrols = ARRAY_SIZE(mv98dx3236_mpp_controls);
|
||||
soc->modes = mv98dx3236_mpp_modes;
|
||||
soc->nmodes = mv98dx3236_mpp_controls[0].npins;
|
||||
soc->gpioranges = mv98dx3236_mpp_gpio_ranges;
|
||||
soc->ngpioranges = ARRAY_SIZE(mv98dx3236_mpp_gpio_ranges);
|
||||
break;
|
||||
}
|
||||
|
||||
nregs = DIV_ROUND_UP(soc->nmodes, MVEBU_MPPS_PER_REG);
|
||||
|
|
@ -499,7 +637,7 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = soc;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver armada_xp_pinctrl_driver = {
|
||||
|
|
@ -511,9 +649,4 @@ static struct platform_driver armada_xp_pinctrl_driver = {
|
|||
.suspend = armada_xp_pinctrl_suspend,
|
||||
.resume = armada_xp_pinctrl_resume,
|
||||
};
|
||||
|
||||
module_platform_driver(armada_xp_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(armada_xp_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
|
|
@ -61,30 +60,20 @@
|
|||
|
||||
#define CONFIG_PMU BIT(4)
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
static void __iomem *mpp4_base;
|
||||
static void __iomem *pmu_base;
|
||||
static struct regmap *gconfmap;
|
||||
|
||||
static int dove_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int dove_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int dove_pmu_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_pmu_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid, unsigned long *config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned long pmu = readl(mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long func;
|
||||
|
||||
if ((pmu & BIT(pid)) == 0)
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
return mvebu_mmio_mpp_ctrl_get(data, pid, config);
|
||||
|
||||
func = readl(pmu_base + PMU_SIGNAL_SELECT_0 + off);
|
||||
*config = (func >> shift) & MVEBU_MPP_MASK;
|
||||
|
|
@ -93,19 +82,20 @@ static int dove_pmu_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_pmu_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_pmu_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid, unsigned long config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned long pmu = readl(mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long func;
|
||||
|
||||
if ((config & CONFIG_PMU) == 0) {
|
||||
writel(pmu & ~BIT(pid), mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
writel(pmu & ~BIT(pid), data->base + PMU_MPP_GENERAL_CTRL);
|
||||
return mvebu_mmio_mpp_ctrl_set(data, pid, config);
|
||||
}
|
||||
|
||||
writel(pmu | BIT(pid), mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
writel(pmu | BIT(pid), data->base + PMU_MPP_GENERAL_CTRL);
|
||||
func = readl(pmu_base + PMU_SIGNAL_SELECT_0 + off);
|
||||
func &= ~(MVEBU_MPP_MASK << shift);
|
||||
func |= (config & MVEBU_MPP_MASK) << shift;
|
||||
|
|
@ -114,7 +104,8 @@ static int dove_pmu_mpp_ctrl_set(unsigned pid, unsigned long config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_mpp4_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_mpp4_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned long mpp4 = readl(mpp4_base);
|
||||
unsigned long mask;
|
||||
|
|
@ -144,7 +135,8 @@ static int dove_mpp4_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_mpp4_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_mpp4_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config)
|
||||
{
|
||||
unsigned long mpp4 = readl(mpp4_base);
|
||||
unsigned long mask;
|
||||
|
|
@ -178,7 +170,8 @@ static int dove_mpp4_ctrl_set(unsigned pid, unsigned long config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_nand_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_nand_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned int gmpp;
|
||||
|
||||
|
|
@ -188,7 +181,8 @@ static int dove_nand_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_nand_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_nand_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config)
|
||||
{
|
||||
regmap_update_bits(gconfmap, MPP_GENERAL_CONFIG,
|
||||
NAND_GPIO_EN,
|
||||
|
|
@ -196,28 +190,31 @@ static int dove_nand_ctrl_set(unsigned pid, unsigned long config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_audio0_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_audio0_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned long pmu = readl(mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL);
|
||||
|
||||
*config = ((pmu & AU0_AC97_SEL) != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dove_audio0_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_audio0_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config)
|
||||
{
|
||||
unsigned long pmu = readl(mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
unsigned long pmu = readl(data->base + PMU_MPP_GENERAL_CTRL);
|
||||
|
||||
pmu &= ~AU0_AC97_SEL;
|
||||
if (config)
|
||||
pmu |= AU0_AC97_SEL;
|
||||
writel(pmu, mpp_base + PMU_MPP_GENERAL_CTRL);
|
||||
writel(pmu, data->base + PMU_MPP_GENERAL_CTRL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dove_audio1_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_audio1_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned int mpp4 = readl(mpp4_base);
|
||||
unsigned int sspc1;
|
||||
|
|
@ -247,7 +244,8 @@ static int dove_audio1_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_audio1_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config)
|
||||
{
|
||||
unsigned int mpp4 = readl(mpp4_base);
|
||||
|
||||
|
|
@ -274,11 +272,12 @@ static int dove_audio1_ctrl_set(unsigned pid, unsigned long config)
|
|||
* break other functions. If you require all mpps as gpio
|
||||
* enforce gpio setting by pinctrl mapping.
|
||||
*/
|
||||
static int dove_audio1_ctrl_gpio_req(unsigned pid)
|
||||
static int dove_audio1_ctrl_gpio_req(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid)
|
||||
{
|
||||
unsigned long config;
|
||||
|
||||
dove_audio1_ctrl_get(pid, &config);
|
||||
dove_audio1_ctrl_get(data, pid, &config);
|
||||
|
||||
switch (config) {
|
||||
case 0x02: /* i2s1 : gpio[56:57] */
|
||||
|
|
@ -301,14 +300,16 @@ static int dove_audio1_ctrl_gpio_req(unsigned pid)
|
|||
}
|
||||
|
||||
/* mpp[52:57] has gpio pins capable of in and out */
|
||||
static int dove_audio1_ctrl_gpio_dir(unsigned pid, bool input)
|
||||
static int dove_audio1_ctrl_gpio_dir(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid, bool input)
|
||||
{
|
||||
if (pid < 52 || pid > 57)
|
||||
return -ENOTSUPP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dove_twsi_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int dove_twsi_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned int gcfg1;
|
||||
unsigned int gcfg2;
|
||||
|
|
@ -327,7 +328,8 @@ static int dove_twsi_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dove_twsi_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int dove_twsi_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config)
|
||||
{
|
||||
unsigned int gcfg1 = 0;
|
||||
unsigned int gcfg2 = 0;
|
||||
|
|
@ -354,9 +356,9 @@ static int dove_twsi_ctrl_set(unsigned pid, unsigned long config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct mvebu_mpp_ctrl dove_mpp_controls[] = {
|
||||
static const struct mvebu_mpp_ctrl dove_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 15, NULL, dove_pmu_mpp_ctrl),
|
||||
MPP_FUNC_CTRL(16, 23, NULL, dove_mpp_ctrl),
|
||||
MPP_FUNC_CTRL(16, 23, NULL, mvebu_mmio_mpp_ctrl),
|
||||
MPP_FUNC_CTRL(24, 39, "mpp_camera", dove_mpp4_ctrl),
|
||||
MPP_FUNC_CTRL(40, 45, "mpp_sdio0", dove_mpp4_ctrl),
|
||||
MPP_FUNC_CTRL(46, 51, "mpp_sdio1", dove_mpp4_ctrl),
|
||||
|
|
@ -769,6 +771,10 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
|
|||
struct resource fb_res;
|
||||
const struct of_device_id *match =
|
||||
of_match_device(dove_pinctrl_of_match, &pdev->dev);
|
||||
struct mvebu_mpp_ctrl_data *mpp_data;
|
||||
void __iomem *base;
|
||||
int i;
|
||||
|
||||
pdev->dev.platform_data = (void *)match->data;
|
||||
|
||||
/*
|
||||
|
|
@ -783,9 +789,18 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
|
|||
clk_prepare_enable(clk);
|
||||
|
||||
mpp_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, mpp_res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
base = devm_ioremap_resource(&pdev->dev, mpp_res);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
mpp_data = devm_kcalloc(&pdev->dev, dove_pinctrl_info.ncontrols,
|
||||
sizeof(*mpp_data), GFP_KERNEL);
|
||||
if (!mpp_data)
|
||||
return -ENOMEM;
|
||||
|
||||
dove_pinctrl_info.control_data = mpp_data;
|
||||
for (i = 0; i < ARRAY_SIZE(dove_mpp_controls); i++)
|
||||
mpp_data[i].base = base;
|
||||
|
||||
/* prepare fallback resource */
|
||||
memcpy(&fb_res, mpp_res, sizeof(struct resource));
|
||||
|
|
@ -838,24 +853,12 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
|
|||
return mvebu_pinctrl_probe(pdev);
|
||||
}
|
||||
|
||||
static int dove_pinctrl_remove(struct platform_device *pdev)
|
||||
{
|
||||
if (!IS_ERR(clk))
|
||||
clk_disable_unprepare(clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver dove_pinctrl_driver = {
|
||||
.driver = {
|
||||
.name = "dove-pinctrl",
|
||||
.suppress_bind_attrs = true,
|
||||
.of_match_table = dove_pinctrl_of_match,
|
||||
},
|
||||
.probe = dove_pinctrl_probe,
|
||||
.remove = dove_pinctrl_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(dove_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Sebastian Hesselbarth <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Dove pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(dove_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -21,18 +20,6 @@
|
|||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
static void __iomem *mpp_base;
|
||||
|
||||
static int kirkwood_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
{
|
||||
return default_mpp_ctrl_get(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
static int kirkwood_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
{
|
||||
return default_mpp_ctrl_set(mpp_base, pid, config);
|
||||
}
|
||||
|
||||
#define V(f6180, f6190, f6192, f6281, f6282, dx4122) \
|
||||
((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \
|
||||
(f6281 << 3) | (f6282 << 4) | (dx4122 << 5))
|
||||
|
|
@ -370,8 +357,8 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
|
|||
MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0))),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 44, NULL, kirkwood_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 44, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
|
||||
|
|
@ -379,8 +366,8 @@ static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
|
|||
MPP_GPIO_RANGE(1, 35, 35, 10),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 35, NULL, kirkwood_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 35, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
|
||||
|
|
@ -388,8 +375,8 @@ static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
|
|||
MPP_GPIO_RANGE(1, 32, 32, 4),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 49, NULL, kirkwood_mpp_ctrl),
|
||||
static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 49, NULL, mvebu_mmio_mpp_ctrl),
|
||||
};
|
||||
|
||||
static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
|
||||
|
|
@ -469,17 +456,12 @@ static const struct of_device_id kirkwood_pinctrl_of_match[] = {
|
|||
|
||||
static int kirkwood_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
const struct of_device_id *match =
|
||||
of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
|
||||
|
||||
pdev->dev.platform_data = (void *)match->data;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
mpp_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(mpp_base))
|
||||
return PTR_ERR(mpp_base);
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
return mvebu_pinctrl_simple_mmio_probe(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver kirkwood_pinctrl_driver = {
|
||||
|
|
@ -489,9 +471,4 @@ static struct platform_driver kirkwood_pinctrl_driver = {
|
|||
},
|
||||
.probe = kirkwood_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(kirkwood_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Sebastian Hesselbarth <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(kirkwood_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -23,6 +22,8 @@
|
|||
#include <linux/pinctrl/pinconf.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinmux.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include "pinctrl-mvebu.h"
|
||||
|
||||
|
|
@ -38,7 +39,8 @@ struct mvebu_pinctrl_function {
|
|||
|
||||
struct mvebu_pinctrl_group {
|
||||
const char *name;
|
||||
struct mvebu_mpp_ctrl *ctrl;
|
||||
const struct mvebu_mpp_ctrl *ctrl;
|
||||
struct mvebu_mpp_ctrl_data *data;
|
||||
struct mvebu_mpp_ctrl_setting *settings;
|
||||
unsigned num_settings;
|
||||
unsigned gid;
|
||||
|
|
@ -57,6 +59,30 @@ struct mvebu_pinctrl {
|
|||
u8 variant;
|
||||
};
|
||||
|
||||
int mvebu_mmio_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned int pid, unsigned long *config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
|
||||
*config = (readl(data->base + off) >> shift) & MVEBU_MPP_MASK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mvebu_mmio_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned int pid, unsigned long config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned long reg;
|
||||
|
||||
reg = readl(data->base + off) & ~(MVEBU_MPP_MASK << shift);
|
||||
writel(reg | (config << shift), data->base + off);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct mvebu_pinctrl_group *mvebu_pinctrl_find_group_by_pid(
|
||||
struct mvebu_pinctrl *pctl, unsigned pid)
|
||||
{
|
||||
|
|
@ -146,7 +172,7 @@ static int mvebu_pinconf_group_get(struct pinctrl_dev *pctldev,
|
|||
if (!grp->ctrl)
|
||||
return -EINVAL;
|
||||
|
||||
return grp->ctrl->mpp_get(grp->pins[0], config);
|
||||
return grp->ctrl->mpp_get(grp->data, grp->pins[0], config);
|
||||
}
|
||||
|
||||
static int mvebu_pinconf_group_set(struct pinctrl_dev *pctldev,
|
||||
|
|
@ -161,7 +187,7 @@ static int mvebu_pinconf_group_set(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
ret = grp->ctrl->mpp_set(grp->pins[0], configs[i]);
|
||||
ret = grp->ctrl->mpp_set(grp->data, grp->pins[0], configs[i]);
|
||||
if (ret)
|
||||
return ret;
|
||||
} /* for each config */
|
||||
|
|
@ -188,18 +214,19 @@ static void mvebu_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
|||
if (curr->subname)
|
||||
seq_printf(s, "(%s)", curr->subname);
|
||||
if (curr->flags & (MVEBU_SETTING_GPO | MVEBU_SETTING_GPI)) {
|
||||
seq_printf(s, "(");
|
||||
seq_putc(s, '(');
|
||||
if (curr->flags & MVEBU_SETTING_GPI)
|
||||
seq_printf(s, "i");
|
||||
seq_putc(s, 'i');
|
||||
if (curr->flags & MVEBU_SETTING_GPO)
|
||||
seq_printf(s, "o");
|
||||
seq_printf(s, ")");
|
||||
seq_putc(s, 'o');
|
||||
seq_putc(s, ')');
|
||||
}
|
||||
} else
|
||||
seq_printf(s, "current: UNKNOWN");
|
||||
} else {
|
||||
seq_puts(s, "current: UNKNOWN");
|
||||
}
|
||||
|
||||
if (grp->num_settings > 1) {
|
||||
seq_printf(s, ", available = [");
|
||||
seq_puts(s, ", available = [");
|
||||
for (n = 0; n < grp->num_settings; n++) {
|
||||
if (curr == &grp->settings[n])
|
||||
continue;
|
||||
|
|
@ -214,17 +241,16 @@ static void mvebu_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
|||
seq_printf(s, "(%s)", grp->settings[n].subname);
|
||||
if (grp->settings[n].flags &
|
||||
(MVEBU_SETTING_GPO | MVEBU_SETTING_GPI)) {
|
||||
seq_printf(s, "(");
|
||||
seq_putc(s, '(');
|
||||
if (grp->settings[n].flags & MVEBU_SETTING_GPI)
|
||||
seq_printf(s, "i");
|
||||
seq_putc(s, 'i');
|
||||
if (grp->settings[n].flags & MVEBU_SETTING_GPO)
|
||||
seq_printf(s, "o");
|
||||
seq_printf(s, ")");
|
||||
seq_putc(s, 'o');
|
||||
seq_putc(s, ')');
|
||||
}
|
||||
}
|
||||
seq_printf(s, " ]");
|
||||
seq_puts(s, " ]");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static const struct pinconf_ops mvebu_pinconf_ops = {
|
||||
|
|
@ -302,7 +328,7 @@ static int mvebu_pinmux_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
if (grp->ctrl->mpp_gpio_req)
|
||||
return grp->ctrl->mpp_gpio_req(offset);
|
||||
return grp->ctrl->mpp_gpio_req(grp->data, offset);
|
||||
|
||||
setting = mvebu_pinctrl_find_gpio_setting(pctl, grp);
|
||||
if (!setting)
|
||||
|
|
@ -325,7 +351,7 @@ static int mvebu_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
if (grp->ctrl->mpp_gpio_dir)
|
||||
return grp->ctrl->mpp_gpio_dir(offset, input);
|
||||
return grp->ctrl->mpp_gpio_dir(grp->data, offset, input);
|
||||
|
||||
setting = mvebu_pinctrl_find_gpio_setting(pctl, grp);
|
||||
if (!setting)
|
||||
|
|
@ -398,13 +424,9 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
*map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL);
|
||||
if (*map == NULL) {
|
||||
dev_err(pctl->dev,
|
||||
"cannot allocate pinctrl_map memory for %s\n",
|
||||
np->name);
|
||||
*map = kmalloc_array(nmaps, sizeof(**map), GFP_KERNEL);
|
||||
if (!*map)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
n = 0;
|
||||
of_property_for_each_string(np, "marvell,pins", prop, group) {
|
||||
|
|
@ -563,10 +585,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pctl = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pinctrl),
|
||||
GFP_KERNEL);
|
||||
if (!pctl) {
|
||||
dev_err(&pdev->dev, "unable to alloc driver\n");
|
||||
if (!pctl)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pctl->desc.name = dev_name(&pdev->dev);
|
||||
pctl->desc.owner = THIS_MODULE;
|
||||
|
|
@ -582,7 +602,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
pctl->num_groups = 0;
|
||||
pctl->desc.npins = 0;
|
||||
for (n = 0; n < soc->ncontrols; n++) {
|
||||
struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
|
||||
const struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
|
||||
|
||||
pctl->desc.npins += ctrl->npins;
|
||||
/* initialize control's pins[] array */
|
||||
|
|
@ -604,10 +624,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
pdesc = devm_kzalloc(&pdev->dev, pctl->desc.npins *
|
||||
sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
|
||||
if (!pdesc) {
|
||||
dev_err(&pdev->dev, "failed to alloc pinctrl pins\n");
|
||||
if (!pdesc)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for (n = 0; n < pctl->desc.npins; n++)
|
||||
pdesc[n].number = n;
|
||||
|
|
@ -628,9 +646,13 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
/* assign mpp controls to groups */
|
||||
gid = 0;
|
||||
for (n = 0; n < soc->ncontrols; n++) {
|
||||
struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
|
||||
const struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
|
||||
struct mvebu_mpp_ctrl_data *data = soc->control_data ?
|
||||
&soc->control_data[n] : NULL;
|
||||
|
||||
pctl->groups[gid].gid = gid;
|
||||
pctl->groups[gid].ctrl = ctrl;
|
||||
pctl->groups[gid].data = data;
|
||||
pctl->groups[gid].name = ctrl->name;
|
||||
pctl->groups[gid].pins = ctrl->pins;
|
||||
pctl->groups[gid].npins = ctrl->npins;
|
||||
|
|
@ -650,6 +672,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
gid++;
|
||||
pctl->groups[gid].gid = gid;
|
||||
pctl->groups[gid].ctrl = ctrl;
|
||||
pctl->groups[gid].data = data;
|
||||
pctl->groups[gid].name = noname_buf;
|
||||
pctl->groups[gid].pins = &ctrl->pins[k];
|
||||
pctl->groups[gid].npins = 1;
|
||||
|
|
@ -725,3 +748,94 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* mvebu_pinctrl_simple_mmio_probe - probe a simple mmio pinctrl
|
||||
* @pdev: platform device (with platform data already attached)
|
||||
*
|
||||
* Initialise a simple (single base address) mmio pinctrl driver,
|
||||
* assigning the MMIO base address to all mvebu mpp ctrl instances.
|
||||
*/
|
||||
int mvebu_pinctrl_simple_mmio_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev);
|
||||
struct mvebu_mpp_ctrl_data *mpp_data;
|
||||
struct resource *res;
|
||||
void __iomem *base;
|
||||
int i;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
mpp_data = devm_kcalloc(&pdev->dev, soc->ncontrols, sizeof(*mpp_data),
|
||||
GFP_KERNEL);
|
||||
if (!mpp_data)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < soc->ncontrols; i++)
|
||||
mpp_data[i].base = base;
|
||||
|
||||
soc->control_data = mpp_data;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
}
|
||||
|
||||
int mvebu_regmap_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned int pid, unsigned long *config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned int val;
|
||||
int err;
|
||||
|
||||
err = regmap_read(data->regmap.map, data->regmap.offset + off, &val);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
*config = (val >> shift) & MVEBU_MPP_MASK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mvebu_regmap_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned int pid, unsigned long config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
|
||||
return regmap_update_bits(data->regmap.map, data->regmap.offset + off,
|
||||
MVEBU_MPP_MASK << shift, config << shift);
|
||||
}
|
||||
|
||||
int mvebu_pinctrl_simple_regmap_probe(struct platform_device *pdev,
|
||||
struct device *syscon_dev)
|
||||
{
|
||||
struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev);
|
||||
struct mvebu_mpp_ctrl_data *mpp_data;
|
||||
struct regmap *regmap;
|
||||
u32 offset;
|
||||
int i;
|
||||
|
||||
regmap = syscon_node_to_regmap(syscon_dev->of_node);
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
||||
if (of_property_read_u32(pdev->dev.of_node, "offset", &offset))
|
||||
return -EINVAL;
|
||||
|
||||
mpp_data = devm_kcalloc(&pdev->dev, soc->ncontrols, sizeof(*mpp_data),
|
||||
GFP_KERNEL);
|
||||
if (!mpp_data)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < soc->ncontrols; i++) {
|
||||
mpp_data[i].regmap.map = regmap;
|
||||
mpp_data[i].regmap.offset = offset;
|
||||
}
|
||||
|
||||
soc->control_data = mpp_data;
|
||||
|
||||
return mvebu_pinctrl_probe(pdev);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,22 @@
|
|||
#ifndef __PINCTRL_MVEBU_H__
|
||||
#define __PINCTRL_MVEBU_H__
|
||||
|
||||
/**
|
||||
* struct mvebu_mpp_ctrl_data - private data for the mpp ctrl operations
|
||||
* @base: base address of pinctrl hardware
|
||||
* @regmap.map: regmap structure
|
||||
* @regmap.offset: regmap offset
|
||||
*/
|
||||
struct mvebu_mpp_ctrl_data {
|
||||
union {
|
||||
void __iomem *base;
|
||||
struct {
|
||||
struct regmap *map;
|
||||
u32 offset;
|
||||
} regmap;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mvebu_mpp_ctrl - describe a mpp control
|
||||
* @name: name of the control group
|
||||
|
|
@ -37,10 +53,13 @@ struct mvebu_mpp_ctrl {
|
|||
u8 pid;
|
||||
u8 npins;
|
||||
unsigned *pins;
|
||||
int (*mpp_get)(unsigned pid, unsigned long *config);
|
||||
int (*mpp_set)(unsigned pid, unsigned long config);
|
||||
int (*mpp_gpio_req)(unsigned pid);
|
||||
int (*mpp_gpio_dir)(unsigned pid, bool input);
|
||||
int (*mpp_get)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config);
|
||||
int (*mpp_set)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config);
|
||||
int (*mpp_gpio_req)(struct mvebu_mpp_ctrl_data *data, unsigned pid);
|
||||
int (*mpp_gpio_dir)(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
bool input);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -93,6 +112,7 @@ struct mvebu_mpp_mode {
|
|||
* struct mvebu_pinctrl_soc_info - SoC specific info passed to pinctrl-mvebu
|
||||
* @variant: variant mask of soc_info
|
||||
* @controls: list of available mvebu_mpp_ctrls
|
||||
* @control_data: optional array, one entry for each control
|
||||
* @ncontrols: number of available mvebu_mpp_ctrls
|
||||
* @modes: list of available mvebu_mpp_modes
|
||||
* @nmodes: number of available mvebu_mpp_modes
|
||||
|
|
@ -105,7 +125,8 @@ struct mvebu_mpp_mode {
|
|||
*/
|
||||
struct mvebu_pinctrl_soc_info {
|
||||
u8 variant;
|
||||
struct mvebu_mpp_ctrl *controls;
|
||||
const struct mvebu_mpp_ctrl *controls;
|
||||
struct mvebu_mpp_ctrl_data *control_data;
|
||||
int ncontrols;
|
||||
struct mvebu_mpp_mode *modes;
|
||||
int nmodes;
|
||||
|
|
@ -177,30 +198,18 @@ struct mvebu_pinctrl_soc_info {
|
|||
#define MVEBU_MPP_BITS 4
|
||||
#define MVEBU_MPP_MASK 0xf
|
||||
|
||||
static inline int default_mpp_ctrl_get(void __iomem *base, unsigned int pid,
|
||||
unsigned long *config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
|
||||
*config = (readl(base + off) >> shift) & MVEBU_MPP_MASK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int default_mpp_ctrl_set(void __iomem *base, unsigned int pid,
|
||||
unsigned long config)
|
||||
{
|
||||
unsigned off = (pid / MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
unsigned long reg;
|
||||
|
||||
reg = readl(base + off) & ~(MVEBU_MPP_MASK << shift);
|
||||
writel(reg | (config << shift), base + off);
|
||||
|
||||
return 0;
|
||||
}
|
||||
int mvebu_mmio_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config);
|
||||
int mvebu_mmio_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config);
|
||||
int mvebu_regmap_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long *config);
|
||||
int mvebu_regmap_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data, unsigned pid,
|
||||
unsigned long config);
|
||||
|
||||
int mvebu_pinctrl_probe(struct platform_device *pdev);
|
||||
int mvebu_pinctrl_simple_mmio_probe(struct platform_device *pdev);
|
||||
int mvebu_pinctrl_simple_regmap_probe(struct platform_device *pdev,
|
||||
struct device *syscon_dev);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/of.h>
|
||||
|
|
@ -32,7 +31,8 @@
|
|||
static void __iomem *mpp_base;
|
||||
static void __iomem *high_mpp_base;
|
||||
|
||||
static int orion_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
||||
static int orion_mpp_ctrl_get(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid, unsigned long *config)
|
||||
{
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
|
||||
|
|
@ -47,7 +47,8 @@ static int orion_mpp_ctrl_get(unsigned pid, unsigned long *config)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int orion_mpp_ctrl_set(unsigned pid, unsigned long config)
|
||||
static int orion_mpp_ctrl_set(struct mvebu_mpp_ctrl_data *data,
|
||||
unsigned pid, unsigned long config)
|
||||
{
|
||||
unsigned shift = (pid % MVEBU_MPPS_PER_REG) * MVEBU_MPP_BITS;
|
||||
|
||||
|
|
@ -161,7 +162,7 @@ static struct mvebu_mpp_mode orion_mpp_modes[] = {
|
|||
MPP_VAR_FUNCTION(0x5, "gpio", NULL, V_5182)),
|
||||
};
|
||||
|
||||
static struct mvebu_mpp_ctrl orion_mpp_controls[] = {
|
||||
static const struct mvebu_mpp_ctrl orion_mpp_controls[] = {
|
||||
MPP_FUNC_CTRL(0, 19, NULL, orion_mpp_ctrl),
|
||||
};
|
||||
|
||||
|
|
@ -247,9 +248,4 @@ static struct platform_driver orion_pinctrl_driver = {
|
|||
},
|
||||
.probe = orion_pinctrl_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(orion_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
|
||||
MODULE_DESCRIPTION("Marvell Orion pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
builtin_platform_driver(orion_pinctrl_driver);
|
||||
|
|
|
|||
|
|
@ -200,6 +200,18 @@ int pinconf_apply_setting(struct pinctrl_setting const *setting)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
unsigned long *configs, size_t nconfigs)
|
||||
{
|
||||
const struct pinconf_ops *ops;
|
||||
|
||||
ops = pctldev->desc->confops;
|
||||
if (!ops)
|
||||
return -ENOTSUPP;
|
||||
|
||||
return ops->pin_config_set(pctldev, pin, configs, nconfigs);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
static void pinconf_show_config(struct seq_file *s, struct pinctrl_dev *pctldev,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ int pinconf_map_to_setting(struct pinctrl_map const *map,
|
|||
void pinconf_free_setting(struct pinctrl_setting const *setting);
|
||||
int pinconf_apply_setting(struct pinctrl_setting const *setting);
|
||||
|
||||
int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
unsigned long *configs, size_t nconfigs);
|
||||
|
||||
/*
|
||||
* You will only be interested in these if you're using PINCONF
|
||||
* so don't supply any stubs for these.
|
||||
|
|
@ -56,6 +59,12 @@ static inline int pinconf_apply_setting(struct pinctrl_setting const *setting)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
unsigned long *configs, size_t nconfigs)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
|
||||
|
|
|
|||
|
|
@ -164,6 +164,18 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int amd_gpio_set_config(struct gpio_chip *gc, unsigned offset,
|
||||
unsigned long config)
|
||||
{
|
||||
u32 debounce;
|
||||
|
||||
if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
|
||||
return -ENOTSUPP;
|
||||
|
||||
debounce = pinconf_to_config_argument(config);
|
||||
return amd_gpio_set_debounce(gc, offset, debounce);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
||||
{
|
||||
|
|
@ -186,7 +198,7 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
|||
char *output_value;
|
||||
char *output_enable;
|
||||
|
||||
for (bank = 0; bank < AMD_GPIO_TOTAL_BANKS; bank++) {
|
||||
for (bank = 0; bank < gpio_dev->hwbank_num; bank++) {
|
||||
seq_printf(s, "GPIO bank%d\t", bank);
|
||||
|
||||
switch (bank) {
|
||||
|
|
@ -202,10 +214,14 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
|||
i = 128;
|
||||
pin_num = AMD_GPIO_PINS_BANK2 + i;
|
||||
break;
|
||||
case 3:
|
||||
i = 192;
|
||||
pin_num = AMD_GPIO_PINS_BANK3 + i;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
/* Illegal bank number, ignore */
|
||||
continue;
|
||||
}
|
||||
|
||||
for (; i < pin_num; i++) {
|
||||
seq_printf(s, "pin%d\t", i);
|
||||
spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
|
|
@ -215,14 +231,14 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
|||
if (pin_reg & BIT(INTERRUPT_ENABLE_OFF)) {
|
||||
interrupt_enable = "interrupt is enabled|";
|
||||
|
||||
if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF))
|
||||
&& !(pin_reg & BIT(ACTIVE_LEVEL_OFF+1)))
|
||||
if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF)) &&
|
||||
!(pin_reg & BIT(ACTIVE_LEVEL_OFF + 1)))
|
||||
active_level = "Active low|";
|
||||
else if (pin_reg & BIT(ACTIVE_LEVEL_OFF)
|
||||
&& !(pin_reg & BIT(ACTIVE_LEVEL_OFF+1)))
|
||||
else if (pin_reg & BIT(ACTIVE_LEVEL_OFF) &&
|
||||
!(pin_reg & BIT(ACTIVE_LEVEL_OFF + 1)))
|
||||
active_level = "Active high|";
|
||||
else if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF))
|
||||
&& pin_reg & BIT(ACTIVE_LEVEL_OFF+1))
|
||||
else if (!(pin_reg & BIT(ACTIVE_LEVEL_OFF)) &&
|
||||
pin_reg & BIT(ACTIVE_LEVEL_OFF + 1))
|
||||
active_level = "Active on both|";
|
||||
else
|
||||
active_level = "Unknow Active level|";
|
||||
|
|
@ -246,17 +262,17 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
|
|||
interrupt_mask =
|
||||
"interrupt is masked|";
|
||||
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF))
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3))
|
||||
wake_cntrl0 = "enable wakeup in S0i3 state|";
|
||||
else
|
||||
wake_cntrl0 = "disable wakeup in S0i3 state|";
|
||||
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF))
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF_S3))
|
||||
wake_cntrl1 = "enable wakeup in S3 state|";
|
||||
else
|
||||
wake_cntrl1 = "disable wakeup in S3 state|";
|
||||
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF))
|
||||
if (pin_reg & BIT(WAKE_CNTRL_OFF_S4))
|
||||
wake_cntrl2 = "enable wakeup in S4/S5 state|";
|
||||
else
|
||||
wake_cntrl2 = "disable wakeup in S4/S5 state|";
|
||||
|
|
@ -476,6 +492,7 @@ static struct irq_chip amd_gpio_irqchip = {
|
|||
.irq_unmask = amd_gpio_irq_unmask,
|
||||
.irq_eoi = amd_gpio_irq_eoi,
|
||||
.irq_set_type = amd_gpio_irq_set_type,
|
||||
.flags = IRQCHIP_SKIP_SET_WAKE,
|
||||
};
|
||||
|
||||
static void amd_gpio_irq_handler(struct irq_desc *desc)
|
||||
|
|
@ -758,18 +775,19 @@ static int amd_gpio_probe(struct platform_device *pdev)
|
|||
gpio_dev->gc.direction_output = amd_gpio_direction_output;
|
||||
gpio_dev->gc.get = amd_gpio_get_value;
|
||||
gpio_dev->gc.set = amd_gpio_set_value;
|
||||
gpio_dev->gc.set_debounce = amd_gpio_set_debounce;
|
||||
gpio_dev->gc.set_config = amd_gpio_set_config;
|
||||
gpio_dev->gc.dbg_show = amd_gpio_dbg_show;
|
||||
|
||||
gpio_dev->gc.base = 0;
|
||||
gpio_dev->gc.base = -1;
|
||||
gpio_dev->gc.label = pdev->name;
|
||||
gpio_dev->gc.owner = THIS_MODULE;
|
||||
gpio_dev->gc.parent = &pdev->dev;
|
||||
gpio_dev->gc.ngpio = TOTAL_NUMBER_OF_PINS;
|
||||
gpio_dev->gc.ngpio = resource_size(res) / 4;
|
||||
#if defined(CONFIG_OF_GPIO)
|
||||
gpio_dev->gc.of_node = pdev->dev.of_node;
|
||||
#endif
|
||||
|
||||
gpio_dev->hwbank_num = gpio_dev->gc.ngpio / 64;
|
||||
gpio_dev->groups = kerncz_groups;
|
||||
gpio_dev->ngroups = ARRAY_SIZE(kerncz_groups);
|
||||
|
||||
|
|
@ -786,7 +804,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
|
||||
ret = gpiochip_add_pin_range(&gpio_dev->gc, dev_name(&pdev->dev),
|
||||
0, 0, TOTAL_NUMBER_OF_PINS);
|
||||
0, 0, gpio_dev->gc.ngpio);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to add pin range\n");
|
||||
goto out2;
|
||||
|
|
@ -807,7 +825,6 @@ static int amd_gpio_probe(struct platform_device *pdev)
|
|||
&amd_gpio_irqchip,
|
||||
irq_base,
|
||||
amd_gpio_irq_handler);
|
||||
|
||||
platform_set_drvdata(pdev, gpio_dev);
|
||||
|
||||
dev_dbg(&pdev->dev, "amd gpio driver loaded\n");
|
||||
|
|
|
|||
|
|
@ -13,13 +13,12 @@
|
|||
#ifndef _PINCTRL_AMD_H
|
||||
#define _PINCTRL_AMD_H
|
||||
|
||||
#define TOTAL_NUMBER_OF_PINS 192
|
||||
#define AMD_GPIO_PINS_PER_BANK 64
|
||||
#define AMD_GPIO_TOTAL_BANKS 3
|
||||
|
||||
#define AMD_GPIO_PINS_BANK0 63
|
||||
#define AMD_GPIO_PINS_BANK1 64
|
||||
#define AMD_GPIO_PINS_BANK2 56
|
||||
#define AMD_GPIO_PINS_BANK3 32
|
||||
|
||||
#define WAKE_INT_MASTER_REG 0xfc
|
||||
#define EOI_MASK (1 << 29)
|
||||
|
|
@ -35,7 +34,9 @@
|
|||
#define ACTIVE_LEVEL_OFF 9
|
||||
#define INTERRUPT_ENABLE_OFF 11
|
||||
#define INTERRUPT_MASK_OFF 12
|
||||
#define WAKE_CNTRL_OFF 13
|
||||
#define WAKE_CNTRL_OFF_S0I3 13
|
||||
#define WAKE_CNTRL_OFF_S3 14
|
||||
#define WAKE_CNTRL_OFF_S4 15
|
||||
#define PIN_STS_OFF 16
|
||||
#define DRV_STRENGTH_SEL_OFF 17
|
||||
#define PULL_UP_SEL_OFF 19
|
||||
|
|
@ -93,6 +94,7 @@ struct amd_gpio {
|
|||
u32 ngroups;
|
||||
struct pinctrl_dev *pctrl;
|
||||
struct gpio_chip gc;
|
||||
unsigned int hwbank_num;
|
||||
struct resource *res;
|
||||
struct platform_device *pdev;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ static int da850_pupd_pin_config_group_set(struct pinctrl_dev *pctldev,
|
|||
struct da850_pupd_data *data = pinctrl_dev_get_drvdata(pctldev);
|
||||
u32 ena, sel;
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
int i;
|
||||
|
||||
ena = readl(data->base + DA850_PUPD_ENA);
|
||||
|
|
@ -121,7 +120,6 @@ static int da850_pupd_pin_config_group_set(struct pinctrl_dev *pctldev,
|
|||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
|
|
@ -194,6 +192,7 @@ static const struct of_device_id da850_pupd_of_match[] = {
|
|||
{ .compatible = "ti,da850-pupd" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, da850_pupd_of_match);
|
||||
|
||||
static struct platform_driver da850_pupd_driver = {
|
||||
.driver = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2012 Thomas Langer <thomas.langer@lantiq.com>
|
||||
* Copyright (C) 2012 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2012 John Crispin <john@phrozen.org>
|
||||
*/
|
||||
|
||||
#include <linux/gpio.h>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* publishhed by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2012 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2012 John Crispin <john@phrozen.org>
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* publishhed by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2012 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2012 John Crispin <john@phrozen.org>
|
||||
*/
|
||||
|
||||
#ifndef __PINCTRL_LANTIQ_H
|
||||
|
|
|
|||
|
|
@ -904,7 +904,7 @@ static int lpc18xx_pconf_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
|
||||
static int lpc18xx_pconf_set_usb1(struct pinctrl_dev *pctldev,
|
||||
enum pin_config_param param,
|
||||
u16 param_val, u32 *reg)
|
||||
u32 param_val, u32 *reg)
|
||||
{
|
||||
switch (param) {
|
||||
case PIN_CONFIG_LOW_POWER_MODE:
|
||||
|
|
@ -932,7 +932,7 @@ static int lpc18xx_pconf_set_usb1(struct pinctrl_dev *pctldev,
|
|||
|
||||
static int lpc18xx_pconf_set_i2c0(struct pinctrl_dev *pctldev,
|
||||
enum pin_config_param param,
|
||||
u16 param_val, u32 *reg,
|
||||
u32 param_val, u32 *reg,
|
||||
unsigned pin)
|
||||
{
|
||||
u8 shift;
|
||||
|
|
@ -982,7 +982,7 @@ static int lpc18xx_pconf_set_i2c0(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
static int lpc18xx_pconf_set_gpio_pin_int(struct pinctrl_dev *pctldev,
|
||||
u16 param_val, unsigned pin)
|
||||
u32 param_val, unsigned pin)
|
||||
{
|
||||
struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev);
|
||||
u32 val, reg_val, reg_offset = LPC18XX_SCU_PINTSEL0;
|
||||
|
|
@ -1008,7 +1008,7 @@ static int lpc18xx_pconf_set_gpio_pin_int(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
static int lpc18xx_pconf_set_pin(struct pinctrl_dev *pctldev, unsigned param,
|
||||
u16 param_val, u32 *reg, unsigned pin,
|
||||
u32 param_val, u32 *reg, unsigned pin,
|
||||
struct lpc18xx_pin_caps *pin_cap)
|
||||
{
|
||||
switch (param) {
|
||||
|
|
@ -1088,7 +1088,7 @@ static int lpc18xx_pconf_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct lpc18xx_pin_caps *pin_cap;
|
||||
enum pin_config_param param;
|
||||
u16 param_val;
|
||||
u32 param_val;
|
||||
u32 reg;
|
||||
int ret;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ static int max77620_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
struct device *dev = mpci->dev;
|
||||
struct max77620_fps_config *fps_config;
|
||||
int param;
|
||||
u16 param_val;
|
||||
u32 param_val;
|
||||
unsigned int val;
|
||||
unsigned int pu_val;
|
||||
unsigned int pd_val;
|
||||
|
|
|
|||
|
|
@ -860,7 +860,7 @@ static int palmas_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
{
|
||||
struct palmas_pctrl_chip_info *pci = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param;
|
||||
u16 param_val;
|
||||
u32 param_val;
|
||||
const struct palmas_pingroup *g;
|
||||
const struct palmas_pin_info *opt;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -1441,7 +1441,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
struct rockchip_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct rockchip_pin_bank *bank = pin_to_bank(info, pin);
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
int i;
|
||||
int rc;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,26 +33,11 @@
|
|||
#include "core.h"
|
||||
#include "devicetree.h"
|
||||
#include "pinconf.h"
|
||||
#include "pinmux.h"
|
||||
|
||||
#define DRIVER_NAME "pinctrl-single"
|
||||
#define PCS_OFF_DISABLED ~0U
|
||||
|
||||
/**
|
||||
* struct pcs_pingroup - pingroups for a function
|
||||
* @np: pingroup device node pointer
|
||||
* @name: pingroup name
|
||||
* @gpins: array of the pins in the group
|
||||
* @ngpins: number of pins in the group
|
||||
* @node: list node
|
||||
*/
|
||||
struct pcs_pingroup {
|
||||
struct device_node *np;
|
||||
const char *name;
|
||||
int *gpins;
|
||||
int ngpins;
|
||||
struct list_head node;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pcs_func_vals - mux function register offset and value pair
|
||||
* @reg: register virtual address
|
||||
|
|
@ -176,16 +161,10 @@ struct pcs_soc_data {
|
|||
* @bits_per_mux: number of bits per mux
|
||||
* @bits_per_pin: number of bits per pin
|
||||
* @pins: physical pins on the SoC
|
||||
* @pgtree: pingroup index radix tree
|
||||
* @ftree: function index radix tree
|
||||
* @pingroups: list of pingroups
|
||||
* @functions: list of functions
|
||||
* @gpiofuncs: list of gpio functions
|
||||
* @irqs: list of interrupt registers
|
||||
* @chip: chip container for this instance
|
||||
* @domain: IRQ domain for this instance
|
||||
* @ngroups: number of pingroups
|
||||
* @nfuncs: number of functions
|
||||
* @desc: pin controller descriptor
|
||||
* @read: register read function to use
|
||||
* @write: register write function to use
|
||||
|
|
@ -213,16 +192,10 @@ struct pcs_device {
|
|||
bool bits_per_mux;
|
||||
unsigned bits_per_pin;
|
||||
struct pcs_data pins;
|
||||
struct radix_tree_root pgtree;
|
||||
struct radix_tree_root ftree;
|
||||
struct list_head pingroups;
|
||||
struct list_head functions;
|
||||
struct list_head gpiofuncs;
|
||||
struct list_head irqs;
|
||||
struct irq_chip chip;
|
||||
struct irq_domain *domain;
|
||||
unsigned ngroups;
|
||||
unsigned nfuncs;
|
||||
struct pinctrl_desc desc;
|
||||
unsigned (*read)(void __iomem *reg);
|
||||
void (*write)(unsigned val, void __iomem *reg);
|
||||
|
|
@ -288,54 +261,6 @@ static void __maybe_unused pcs_writel(unsigned val, void __iomem *reg)
|
|||
writel(val, reg);
|
||||
}
|
||||
|
||||
static int pcs_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pcs->ngroups;
|
||||
}
|
||||
|
||||
static const char *pcs_get_group_name(struct pinctrl_dev *pctldev,
|
||||
unsigned gselector)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct pcs_pingroup *group;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
group = radix_tree_lookup(&pcs->pgtree, gselector);
|
||||
if (!group) {
|
||||
dev_err(pcs->dev, "%s could not find pingroup%i\n",
|
||||
__func__, gselector);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return group->name;
|
||||
}
|
||||
|
||||
static int pcs_get_group_pins(struct pinctrl_dev *pctldev,
|
||||
unsigned gselector,
|
||||
const unsigned **pins,
|
||||
unsigned *npins)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct pcs_pingroup *group;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
group = radix_tree_lookup(&pcs->pgtree, gselector);
|
||||
if (!group) {
|
||||
dev_err(pcs->dev, "%s could not find pingroup%i\n",
|
||||
__func__, gselector);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*pins = group->gpins;
|
||||
*npins = group->ngpins;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev,
|
||||
struct seq_file *s,
|
||||
unsigned pin)
|
||||
|
|
@ -369,67 +294,21 @@ static int pcs_dt_node_to_map(struct pinctrl_dev *pctldev,
|
|||
struct pinctrl_map **map, unsigned *num_maps);
|
||||
|
||||
static const struct pinctrl_ops pcs_pinctrl_ops = {
|
||||
.get_groups_count = pcs_get_groups_count,
|
||||
.get_group_name = pcs_get_group_name,
|
||||
.get_group_pins = pcs_get_group_pins,
|
||||
.get_groups_count = pinctrl_generic_get_group_count,
|
||||
.get_group_name = pinctrl_generic_get_group_name,
|
||||
.get_group_pins = pinctrl_generic_get_group_pins,
|
||||
.pin_dbg_show = pcs_pin_dbg_show,
|
||||
.dt_node_to_map = pcs_dt_node_to_map,
|
||||
.dt_free_map = pcs_dt_free_map,
|
||||
};
|
||||
|
||||
static int pcs_get_functions_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pcs->nfuncs;
|
||||
}
|
||||
|
||||
static const char *pcs_get_function_name(struct pinctrl_dev *pctldev,
|
||||
unsigned fselector)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct pcs_function *func;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
func = radix_tree_lookup(&pcs->ftree, fselector);
|
||||
if (!func) {
|
||||
dev_err(pcs->dev, "%s could not find function%i\n",
|
||||
__func__, fselector);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return func->name;
|
||||
}
|
||||
|
||||
static int pcs_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
unsigned fselector,
|
||||
const char * const **groups,
|
||||
unsigned * const ngroups)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct pcs_function *func;
|
||||
|
||||
pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
func = radix_tree_lookup(&pcs->ftree, fselector);
|
||||
if (!func) {
|
||||
dev_err(pcs->dev, "%s could not find function%i\n",
|
||||
__func__, fselector);
|
||||
return -EINVAL;
|
||||
}
|
||||
*groups = func->pgnames;
|
||||
*ngroups = func->npgnames;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pcs_get_function(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
struct pcs_function **func)
|
||||
{
|
||||
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct pin_desc *pdesc = pin_desc_get(pctldev, pin);
|
||||
const struct pinctrl_setting_mux *setting;
|
||||
struct function_desc *function;
|
||||
unsigned fselector;
|
||||
|
||||
/* If pin is not described in DTS & enabled, mux_setting is NULL. */
|
||||
|
|
@ -437,7 +316,8 @@ static int pcs_get_function(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
if (!setting)
|
||||
return -ENOTSUPP;
|
||||
fselector = setting->func;
|
||||
*func = radix_tree_lookup(&pcs->ftree, fselector);
|
||||
function = pinmux_generic_get_function(pctldev, fselector);
|
||||
*func = function->data;
|
||||
if (!(*func)) {
|
||||
dev_err(pcs->dev, "%s could not find function%i\n",
|
||||
__func__, fselector);
|
||||
|
|
@ -450,6 +330,7 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, unsigned fselector,
|
|||
unsigned group)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct function_desc *function;
|
||||
struct pcs_function *func;
|
||||
int i;
|
||||
|
||||
|
|
@ -457,7 +338,8 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, unsigned fselector,
|
|||
/* If function mask is null, needn't enable it. */
|
||||
if (!pcs->fmask)
|
||||
return 0;
|
||||
func = radix_tree_lookup(&pcs->ftree, fselector);
|
||||
function = pinmux_generic_get_function(pctldev, fselector);
|
||||
func = function->data;
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -515,9 +397,9 @@ static int pcs_request_gpio(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
|
||||
static const struct pinmux_ops pcs_pinmux_ops = {
|
||||
.get_functions_count = pcs_get_functions_count,
|
||||
.get_function_name = pcs_get_function_name,
|
||||
.get_function_groups = pcs_get_function_groups,
|
||||
.get_functions_count = pinmux_generic_get_function_count,
|
||||
.get_function_name = pinmux_generic_get_function_name,
|
||||
.get_function_groups = pinmux_generic_get_function_groups,
|
||||
.set_mux = pcs_set_mux,
|
||||
.gpio_request_enable = pcs_request_gpio,
|
||||
};
|
||||
|
|
@ -622,7 +504,7 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct pcs_function *func;
|
||||
unsigned offset = 0, shift = 0, i, data, ret;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
int j;
|
||||
|
||||
ret = pcs_get_function(pctldev, pin, &func);
|
||||
|
|
@ -685,7 +567,7 @@ static int pcs_pinconf_group_get(struct pinctrl_dev *pctldev,
|
|||
unsigned npins, old = 0;
|
||||
int i, ret;
|
||||
|
||||
ret = pcs_get_group_pins(pctldev, group, &pins, &npins);
|
||||
ret = pinctrl_generic_get_group_pins(pctldev, group, &pins, &npins);
|
||||
if (ret)
|
||||
return ret;
|
||||
for (i = 0; i < npins; i++) {
|
||||
|
|
@ -707,7 +589,7 @@ static int pcs_pinconf_group_set(struct pinctrl_dev *pctldev,
|
|||
unsigned npins;
|
||||
int i, ret;
|
||||
|
||||
ret = pcs_get_group_pins(pctldev, group, &pins, &npins);
|
||||
ret = pinctrl_generic_get_group_pins(pctldev, group, &pins, &npins);
|
||||
if (ret)
|
||||
return ret;
|
||||
for (i = 0; i < npins; i++) {
|
||||
|
|
@ -859,77 +741,24 @@ static struct pcs_function *pcs_add_function(struct pcs_device *pcs,
|
|||
unsigned npgnames)
|
||||
{
|
||||
struct pcs_function *function;
|
||||
int res;
|
||||
|
||||
function = devm_kzalloc(pcs->dev, sizeof(*function), GFP_KERNEL);
|
||||
if (!function)
|
||||
return NULL;
|
||||
|
||||
function->name = name;
|
||||
function->vals = vals;
|
||||
function->nvals = nvals;
|
||||
function->pgnames = pgnames;
|
||||
function->npgnames = npgnames;
|
||||
|
||||
mutex_lock(&pcs->mutex);
|
||||
list_add_tail(&function->node, &pcs->functions);
|
||||
radix_tree_insert(&pcs->ftree, pcs->nfuncs, function);
|
||||
pcs->nfuncs++;
|
||||
mutex_unlock(&pcs->mutex);
|
||||
res = pinmux_generic_add_function(pcs->pctl, name,
|
||||
pgnames, npgnames,
|
||||
function);
|
||||
if (res)
|
||||
return NULL;
|
||||
|
||||
return function;
|
||||
}
|
||||
|
||||
static void pcs_remove_function(struct pcs_device *pcs,
|
||||
struct pcs_function *function)
|
||||
{
|
||||
int i;
|
||||
|
||||
mutex_lock(&pcs->mutex);
|
||||
for (i = 0; i < pcs->nfuncs; i++) {
|
||||
struct pcs_function *found;
|
||||
|
||||
found = radix_tree_lookup(&pcs->ftree, i);
|
||||
if (found == function)
|
||||
radix_tree_delete(&pcs->ftree, i);
|
||||
}
|
||||
list_del(&function->node);
|
||||
mutex_unlock(&pcs->mutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* pcs_add_pingroup() - add a pingroup to the pingroup list
|
||||
* @pcs: pcs driver instance
|
||||
* @np: device node of the mux entry
|
||||
* @name: name of the pingroup
|
||||
* @gpins: array of the pins that belong to the group
|
||||
* @ngpins: number of pins in the group
|
||||
*/
|
||||
static int pcs_add_pingroup(struct pcs_device *pcs,
|
||||
struct device_node *np,
|
||||
const char *name,
|
||||
int *gpins,
|
||||
int ngpins)
|
||||
{
|
||||
struct pcs_pingroup *pingroup;
|
||||
|
||||
pingroup = devm_kzalloc(pcs->dev, sizeof(*pingroup), GFP_KERNEL);
|
||||
if (!pingroup)
|
||||
return -ENOMEM;
|
||||
|
||||
pingroup->name = name;
|
||||
pingroup->np = np;
|
||||
pingroup->gpins = gpins;
|
||||
pingroup->ngpins = ngpins;
|
||||
|
||||
mutex_lock(&pcs->mutex);
|
||||
list_add_tail(&pingroup->node, &pcs->pingroups);
|
||||
radix_tree_insert(&pcs->pgtree, pcs->ngroups, pingroup);
|
||||
pcs->ngroups++;
|
||||
mutex_unlock(&pcs->mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pcs_get_pin_by_offset() - get a pin index based on the register offset
|
||||
* @pcs: pcs driver instance
|
||||
|
|
@ -1100,10 +929,9 @@ static int pcs_parse_pinconf(struct pcs_device *pcs, struct device_node *np,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void pcs_free_pingroups(struct pcs_device *pcs);
|
||||
|
||||
/**
|
||||
* smux_parse_one_pinctrl_entry() - parses a device tree mux entry
|
||||
* @pctldev: pin controller device
|
||||
* @pcs: pinctrl driver instance
|
||||
* @np: device node of the mux entry
|
||||
* @map: map entry
|
||||
|
|
@ -1134,7 +962,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
|
|||
|
||||
rows = pinctrl_count_index_with_args(np, name);
|
||||
if (rows <= 0) {
|
||||
dev_err(pcs->dev, "Ivalid number of rows: %d\n", rows);
|
||||
dev_err(pcs->dev, "Invalid number of rows: %d\n", rows);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -1186,7 +1014,7 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
|
|||
goto free_pins;
|
||||
}
|
||||
|
||||
res = pcs_add_pingroup(pcs, np, np->name, pins, found);
|
||||
res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs);
|
||||
if (res < 0)
|
||||
goto free_function;
|
||||
|
||||
|
|
@ -1205,10 +1033,10 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
|
|||
return 0;
|
||||
|
||||
free_pingroups:
|
||||
pcs_free_pingroups(pcs);
|
||||
pinctrl_generic_remove_last_group(pcs->pctl);
|
||||
*num_maps = 1;
|
||||
free_function:
|
||||
pcs_remove_function(pcs, function);
|
||||
pinmux_generic_remove_last_function(pcs->pctl);
|
||||
|
||||
free_pins:
|
||||
devm_kfree(pcs->dev, pins);
|
||||
|
|
@ -1320,7 +1148,7 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
|
|||
goto free_pins;
|
||||
}
|
||||
|
||||
res = pcs_add_pingroup(pcs, np, np->name, pins, found);
|
||||
res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs);
|
||||
if (res < 0)
|
||||
goto free_function;
|
||||
|
||||
|
|
@ -1337,11 +1165,10 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
|
|||
return 0;
|
||||
|
||||
free_pingroups:
|
||||
pcs_free_pingroups(pcs);
|
||||
pinctrl_generic_remove_last_group(pcs->pctl);
|
||||
*num_maps = 1;
|
||||
free_function:
|
||||
pcs_remove_function(pcs, function);
|
||||
|
||||
pinmux_generic_remove_last_function(pcs->pctl);
|
||||
free_pins:
|
||||
devm_kfree(pcs->dev, pins);
|
||||
|
||||
|
|
@ -1408,60 +1235,6 @@ free_map:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* pcs_free_funcs() - free memory used by functions
|
||||
* @pcs: pcs driver instance
|
||||
*/
|
||||
static void pcs_free_funcs(struct pcs_device *pcs)
|
||||
{
|
||||
struct list_head *pos, *tmp;
|
||||
int i;
|
||||
|
||||
mutex_lock(&pcs->mutex);
|
||||
for (i = 0; i < pcs->nfuncs; i++) {
|
||||
struct pcs_function *func;
|
||||
|
||||
func = radix_tree_lookup(&pcs->ftree, i);
|
||||
if (!func)
|
||||
continue;
|
||||
radix_tree_delete(&pcs->ftree, i);
|
||||
}
|
||||
list_for_each_safe(pos, tmp, &pcs->functions) {
|
||||
struct pcs_function *function;
|
||||
|
||||
function = list_entry(pos, struct pcs_function, node);
|
||||
list_del(&function->node);
|
||||
}
|
||||
mutex_unlock(&pcs->mutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* pcs_free_pingroups() - free memory used by pingroups
|
||||
* @pcs: pcs driver instance
|
||||
*/
|
||||
static void pcs_free_pingroups(struct pcs_device *pcs)
|
||||
{
|
||||
struct list_head *pos, *tmp;
|
||||
int i;
|
||||
|
||||
mutex_lock(&pcs->mutex);
|
||||
for (i = 0; i < pcs->ngroups; i++) {
|
||||
struct pcs_pingroup *pingroup;
|
||||
|
||||
pingroup = radix_tree_lookup(&pcs->pgtree, i);
|
||||
if (!pingroup)
|
||||
continue;
|
||||
radix_tree_delete(&pcs->pgtree, i);
|
||||
}
|
||||
list_for_each_safe(pos, tmp, &pcs->pingroups) {
|
||||
struct pcs_pingroup *pingroup;
|
||||
|
||||
pingroup = list_entry(pos, struct pcs_pingroup, node);
|
||||
list_del(&pingroup->node);
|
||||
}
|
||||
mutex_unlock(&pcs->mutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* pcs_irq_free() - free interrupt
|
||||
* @pcs: pcs driver instance
|
||||
|
|
@ -1490,8 +1263,7 @@ static void pcs_free_resources(struct pcs_device *pcs)
|
|||
{
|
||||
pcs_irq_free(pcs);
|
||||
pinctrl_unregister(pcs->pctl);
|
||||
pcs_free_funcs(pcs);
|
||||
pcs_free_pingroups(pcs);
|
||||
|
||||
#if IS_BUILTIN(CONFIG_PINCTRL_SINGLE)
|
||||
if (pcs->missing_nr_pinctrl_cells)
|
||||
of_remove_property(pcs->np, pcs->missing_nr_pinctrl_cells);
|
||||
|
|
@ -1885,8 +1657,6 @@ static int pcs_probe(struct platform_device *pdev)
|
|||
pcs->np = np;
|
||||
raw_spin_lock_init(&pcs->lock);
|
||||
mutex_init(&pcs->mutex);
|
||||
INIT_LIST_HEAD(&pcs->pingroups);
|
||||
INIT_LIST_HEAD(&pcs->functions);
|
||||
INIT_LIST_HEAD(&pcs->gpiofuncs);
|
||||
soc = match->data;
|
||||
pcs->flags = soc->flags;
|
||||
|
|
@ -1947,8 +1717,6 @@ static int pcs_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
INIT_RADIX_TREE(&pcs->pgtree, GFP_KERNEL);
|
||||
INIT_RADIX_TREE(&pcs->ftree, GFP_KERNEL);
|
||||
platform_set_drvdata(pdev, pcs);
|
||||
|
||||
switch (pcs->width) {
|
||||
|
|
@ -1979,10 +1747,9 @@ static int pcs_probe(struct platform_device *pdev)
|
|||
if (ret < 0)
|
||||
goto free;
|
||||
|
||||
pcs->pctl = pinctrl_register(&pcs->desc, pcs->dev, pcs);
|
||||
if (IS_ERR(pcs->pctl)) {
|
||||
ret = pinctrl_register_and_init(&pcs->desc, pcs->dev, pcs, &pcs->pctl);
|
||||
if (ret) {
|
||||
dev_err(pcs->dev, "could not register single pinctrl driver\n");
|
||||
ret = PTR_ERR(pcs->pctl);
|
||||
goto free;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -424,41 +424,6 @@ static int sx150x_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
return !!(value & BIT(offset));
|
||||
}
|
||||
|
||||
static int sx150x_gpio_set_single_ended(struct gpio_chip *chip,
|
||||
unsigned int offset,
|
||||
enum single_ended_mode mode)
|
||||
{
|
||||
struct sx150x_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
int ret;
|
||||
|
||||
switch (mode) {
|
||||
case LINE_MODE_PUSH_PULL:
|
||||
if (pctl->data->model != SX150X_789 ||
|
||||
sx150x_pin_is_oscio(pctl, offset))
|
||||
return 0;
|
||||
|
||||
ret = regmap_write_bits(pctl->regmap,
|
||||
pctl->data->pri.x789.reg_drain,
|
||||
BIT(offset), 0);
|
||||
break;
|
||||
|
||||
case LINE_MODE_OPEN_DRAIN:
|
||||
if (pctl->data->model != SX150X_789 ||
|
||||
sx150x_pin_is_oscio(pctl, offset))
|
||||
return -ENOTSUPP;
|
||||
|
||||
ret = regmap_write_bits(pctl->regmap,
|
||||
pctl->data->pri.x789.reg_drain,
|
||||
BIT(offset), BIT(offset));
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTSUPP;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __sx150x_gpio_set(struct sx150x_pinctrl *pctl, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
|
|
@ -811,16 +776,26 @@ static int sx150x_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
break;
|
||||
|
||||
case PIN_CONFIG_DRIVE_OPEN_DRAIN:
|
||||
ret = sx150x_gpio_set_single_ended(&pctl->gpio,
|
||||
pin, LINE_MODE_OPEN_DRAIN);
|
||||
if (pctl->data->model != SX150X_789 ||
|
||||
sx150x_pin_is_oscio(pctl, pin))
|
||||
return -ENOTSUPP;
|
||||
|
||||
ret = regmap_write_bits(pctl->regmap,
|
||||
pctl->data->pri.x789.reg_drain,
|
||||
BIT(pin), BIT(pin));
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_DRIVE_PUSH_PULL:
|
||||
ret = sx150x_gpio_set_single_ended(&pctl->gpio,
|
||||
pin, LINE_MODE_PUSH_PULL);
|
||||
if (pctl->data->model != SX150X_789 ||
|
||||
sx150x_pin_is_oscio(pctl, pin))
|
||||
return 0;
|
||||
|
||||
ret = regmap_write_bits(pctl->regmap,
|
||||
pctl->data->pri.x789.reg_drain,
|
||||
BIT(pin), 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
@ -1178,7 +1153,7 @@ static int sx150x_probe(struct i2c_client *client,
|
|||
pctl->gpio.direction_output = sx150x_gpio_direction_output;
|
||||
pctl->gpio.get = sx150x_gpio_get;
|
||||
pctl->gpio.set = sx150x_gpio_set;
|
||||
pctl->gpio.set_single_ended = sx150x_gpio_set_single_ended;
|
||||
pctl->gpio.set_config = gpiochip_generic_config;
|
||||
pctl->gpio.parent = dev;
|
||||
#ifdef CONFIG_OF_GPIO
|
||||
pctl->gpio.of_node = dev->of_node;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* publishhed by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2012 John Crispin <blogic@openwrt.org>
|
||||
* Copyright (C) 2012 John Crispin <john@phrozen.org>
|
||||
* Copyright (C) 2015 Martin Schiller <mschiller@tdt.de>
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -99,37 +99,24 @@ static int pin_request(struct pinctrl_dev *pctldev,
|
|||
dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
|
||||
pin, desc->name, owner);
|
||||
|
||||
if (gpio_range) {
|
||||
/* There's no need to support multiple GPIO requests */
|
||||
if (desc->gpio_owner) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->gpio_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
if (ops->strict && desc->mux_usecount &&
|
||||
strcmp(desc->mux_owner, owner)) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->mux_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
if ((!gpio_range || ops->strict) &&
|
||||
desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->mux_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((gpio_range || ops->strict) && desc->gpio_owner) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->gpio_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (gpio_range) {
|
||||
desc->gpio_owner = owner;
|
||||
} else {
|
||||
if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->mux_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
if (ops->strict && desc->gpio_owner) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->gpio_owner, owner);
|
||||
goto out;
|
||||
}
|
||||
|
||||
desc->mux_usecount++;
|
||||
if (desc->mux_usecount > 1)
|
||||
return 0;
|
||||
|
|
@ -695,3 +682,176 @@ void pinmux_init_device_debugfs(struct dentry *devroot,
|
|||
}
|
||||
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS
|
||||
|
||||
/**
|
||||
* pinmux_generic_get_function_count() - returns number of functions
|
||||
* @pctldev: pin controller device
|
||||
*/
|
||||
int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return pctldev->num_functions;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function_count);
|
||||
|
||||
/**
|
||||
* pinmux_generic_get_function_name() - returns the function name
|
||||
* @pctldev: pin controller device
|
||||
* @selector: function number
|
||||
*/
|
||||
const char *
|
||||
pinmux_generic_get_function_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree,
|
||||
selector);
|
||||
if (!function)
|
||||
return NULL;
|
||||
|
||||
return function->name;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function_name);
|
||||
|
||||
/**
|
||||
* pinmux_generic_get_function_groups() - gets the function groups
|
||||
* @pctldev: pin controller device
|
||||
* @selector: function number
|
||||
* @groups: array of pin groups
|
||||
* @num_groups: number of pin groups
|
||||
*/
|
||||
int pinmux_generic_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
const char * const **groups,
|
||||
unsigned * const num_groups)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree,
|
||||
selector);
|
||||
if (!function) {
|
||||
dev_err(pctldev->dev, "%s could not find function%i\n",
|
||||
__func__, selector);
|
||||
return -EINVAL;
|
||||
}
|
||||
*groups = function->group_names;
|
||||
*num_groups = function->num_group_names;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function_groups);
|
||||
|
||||
/**
|
||||
* pinmux_generic_get_function() - returns a function based on the number
|
||||
* @pctldev: pin controller device
|
||||
* @group_selector: function number
|
||||
*/
|
||||
struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree,
|
||||
selector);
|
||||
if (!function)
|
||||
return NULL;
|
||||
|
||||
return function;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function);
|
||||
|
||||
/**
|
||||
* pinmux_generic_get_function_groups() - gets the function groups
|
||||
* @pctldev: pin controller device
|
||||
* @name: name of the function
|
||||
* @groups: array of pin groups
|
||||
* @num_groups: number of pin groups
|
||||
* @data: pin controller driver specific data
|
||||
*/
|
||||
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
const char *name,
|
||||
const char **groups,
|
||||
const unsigned int num_groups,
|
||||
void *data)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = devm_kzalloc(pctldev->dev, sizeof(*function), GFP_KERNEL);
|
||||
if (!function)
|
||||
return -ENOMEM;
|
||||
|
||||
function->name = name;
|
||||
function->group_names = groups;
|
||||
function->num_group_names = num_groups;
|
||||
function->data = data;
|
||||
|
||||
radix_tree_insert(&pctldev->pin_function_tree, pctldev->num_functions,
|
||||
function);
|
||||
|
||||
pctldev->num_functions++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_add_function);
|
||||
|
||||
/**
|
||||
* pinmux_generic_remove_function() - removes a numbered function
|
||||
* @pctldev: pin controller device
|
||||
* @selector: function number
|
||||
*
|
||||
* Note that the caller must take care of locking.
|
||||
*/
|
||||
int pinmux_generic_remove_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree,
|
||||
selector);
|
||||
if (!function)
|
||||
return -ENOENT;
|
||||
|
||||
radix_tree_delete(&pctldev->pin_function_tree, selector);
|
||||
devm_kfree(pctldev->dev, function);
|
||||
|
||||
pctldev->num_functions--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_remove_function);
|
||||
|
||||
/**
|
||||
* pinmux_generic_free_functions() - removes all functions
|
||||
* @pctldev: pin controller device
|
||||
*
|
||||
* Note that the caller must take care of locking.
|
||||
*/
|
||||
void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct radix_tree_iter iter;
|
||||
struct function_desc *function;
|
||||
unsigned long *indices;
|
||||
void **slot;
|
||||
int i = 0;
|
||||
|
||||
indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *
|
||||
pctldev->num_functions, GFP_KERNEL);
|
||||
if (!indices)
|
||||
return;
|
||||
|
||||
radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)
|
||||
indices[i++] = iter.index;
|
||||
|
||||
for (i = 0; i < pctldev->num_functions; i++) {
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree,
|
||||
indices[i]);
|
||||
radix_tree_delete(&pctldev->pin_function_tree, indices[i]);
|
||||
devm_kfree(pctldev->dev, function);
|
||||
}
|
||||
|
||||
pctldev->num_functions = 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GENERIC_PINMUX_FUNCTIONS */
|
||||
|
|
|
|||
|
|
@ -111,3 +111,59 @@ static inline void pinmux_init_device_debugfs(struct dentry *devroot,
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS
|
||||
|
||||
/**
|
||||
* struct function_desc - generic function descriptor
|
||||
* @name: name of the function
|
||||
* @group_names: array of pin group names
|
||||
* @num_group_names: number of pin group names
|
||||
* @data: pin controller driver specific data
|
||||
*/
|
||||
struct function_desc {
|
||||
const char *name;
|
||||
const char **group_names;
|
||||
int num_group_names;
|
||||
void *data;
|
||||
};
|
||||
|
||||
int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev);
|
||||
|
||||
const char *
|
||||
pinmux_generic_get_function_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector);
|
||||
|
||||
int pinmux_generic_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
const char * const **groups,
|
||||
unsigned * const num_groups);
|
||||
|
||||
struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector);
|
||||
|
||||
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
const char *name,
|
||||
const char **groups,
|
||||
unsigned const num_groups,
|
||||
void *data);
|
||||
|
||||
int pinmux_generic_remove_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector);
|
||||
|
||||
static inline int
|
||||
pinmux_generic_remove_last_function(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
return pinmux_generic_remove_function(pctldev,
|
||||
pctldev->num_functions - 1);
|
||||
}
|
||||
|
||||
void pinmux_generic_free_functions(struct pinctrl_dev *pctldev);
|
||||
|
||||
#else
|
||||
|
||||
static inline void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GENERIC_PINMUX_FUNCTIONS */
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ struct msm_pinctrl {
|
|||
struct notifier_block restart_nb;
|
||||
int irq;
|
||||
|
||||
spinlock_t lock;
|
||||
raw_spinlock_t lock;
|
||||
|
||||
DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
|
||||
DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO);
|
||||
|
|
@ -153,14 +153,14 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
if (WARN_ON(i == g->nfuncs))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->ctl_reg);
|
||||
val &= ~mask;
|
||||
val |= i << g->mux_bit;
|
||||
writel(val, pctrl->regs + g->ctl_reg);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -323,14 +323,14 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
|
|||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
/* set output value */
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
val = readl(pctrl->regs + g->io_reg);
|
||||
if (arg)
|
||||
val |= BIT(g->out_bit);
|
||||
else
|
||||
val &= ~BIT(g->out_bit);
|
||||
writel(val, pctrl->regs + g->io_reg);
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
/* enable output */
|
||||
arg = 1;
|
||||
|
|
@ -351,12 +351,12 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
val = readl(pctrl->regs + g->ctl_reg);
|
||||
val &= ~(mask << bit);
|
||||
val |= arg << bit;
|
||||
writel(val, pctrl->regs + g->ctl_reg);
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -384,13 +384,13 @@ static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
|||
|
||||
g = &pctrl->soc->groups[offset];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->ctl_reg);
|
||||
val &= ~BIT(g->oe_bit);
|
||||
writel(val, pctrl->regs + g->ctl_reg);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -404,7 +404,7 @@ static int msm_gpio_direction_output(struct gpio_chip *chip, unsigned offset, in
|
|||
|
||||
g = &pctrl->soc->groups[offset];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->io_reg);
|
||||
if (value)
|
||||
|
|
@ -417,7 +417,7 @@ static int msm_gpio_direction_output(struct gpio_chip *chip, unsigned offset, in
|
|||
val |= BIT(g->oe_bit);
|
||||
writel(val, pctrl->regs + g->ctl_reg);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -443,7 +443,7 @@ static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
|||
|
||||
g = &pctrl->soc->groups[offset];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->io_reg);
|
||||
if (value)
|
||||
|
|
@ -452,7 +452,7 @@ static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
|
|||
val &= ~BIT(g->out_bit);
|
||||
writel(val, pctrl->regs + g->io_reg);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
|
@ -571,7 +571,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)
|
|||
|
||||
g = &pctrl->soc->groups[d->hwirq];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->intr_cfg_reg);
|
||||
val &= ~BIT(g->intr_enable_bit);
|
||||
|
|
@ -579,7 +579,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)
|
|||
|
||||
clear_bit(d->hwirq, pctrl->enabled_irqs);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
}
|
||||
|
||||
static void msm_gpio_irq_unmask(struct irq_data *d)
|
||||
|
|
@ -592,7 +592,7 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
|
|||
|
||||
g = &pctrl->soc->groups[d->hwirq];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->intr_status_reg);
|
||||
val &= ~BIT(g->intr_status_bit);
|
||||
|
|
@ -604,7 +604,7 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
|
|||
|
||||
set_bit(d->hwirq, pctrl->enabled_irqs);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
}
|
||||
|
||||
static void msm_gpio_irq_ack(struct irq_data *d)
|
||||
|
|
@ -617,7 +617,7 @@ static void msm_gpio_irq_ack(struct irq_data *d)
|
|||
|
||||
g = &pctrl->soc->groups[d->hwirq];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
val = readl(pctrl->regs + g->intr_status_reg);
|
||||
if (g->intr_ack_high)
|
||||
|
|
@ -629,7 +629,7 @@ static void msm_gpio_irq_ack(struct irq_data *d)
|
|||
if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
|
||||
msm_gpio_update_dual_edge_pos(pctrl, g, d);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
}
|
||||
|
||||
static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
||||
|
|
@ -642,7 +642,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
|||
|
||||
g = &pctrl->soc->groups[d->hwirq];
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
/*
|
||||
* For hw without possibility of detecting both edges
|
||||
|
|
@ -716,7 +716,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
|||
if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
|
||||
msm_gpio_update_dual_edge_pos(pctrl, g, d);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
||||
irq_set_handler_locked(d, handle_level_irq);
|
||||
|
|
@ -732,11 +732,11 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
|
|||
struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&pctrl->lock, flags);
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
|
||||
irq_set_irq_wake(pctrl->irq, on);
|
||||
|
||||
spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
raw_spin_unlock_irqrestore(&pctrl->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -882,7 +882,7 @@ int msm_pinctrl_probe(struct platform_device *pdev,
|
|||
pctrl->soc = soc_data;
|
||||
pctrl->chip = msm_gpio_template;
|
||||
|
||||
spin_lock_init(&pctrl->lock);
|
||||
raw_spin_lock_init(&pctrl->lock);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
pctrl->regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
|
|
|
|||
|
|
@ -193,9 +193,9 @@ static const struct pinctrl_pin_desc msm8660_pins[] = {
|
|||
PINCTRL_PIN(171, "GPIO_171"),
|
||||
PINCTRL_PIN(172, "GPIO_172"),
|
||||
|
||||
PINCTRL_PIN(173, "SDC1_CLK"),
|
||||
PINCTRL_PIN(174, "SDC1_CMD"),
|
||||
PINCTRL_PIN(175, "SDC1_DATA"),
|
||||
PINCTRL_PIN(173, "SDC4_CLK"),
|
||||
PINCTRL_PIN(174, "SDC4_CMD"),
|
||||
PINCTRL_PIN(175, "SDC4_DATA"),
|
||||
PINCTRL_PIN(176, "SDC3_CLK"),
|
||||
PINCTRL_PIN(177, "SDC3_CMD"),
|
||||
PINCTRL_PIN(178, "SDC3_DATA"),
|
||||
|
|
|
|||
|
|
@ -24,11 +24,15 @@
|
|||
#include <linux/irqdomain.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/soc/samsung/exynos-pmu.h>
|
||||
#include <linux/soc/samsung/exynos-regs-pmu.h>
|
||||
|
||||
#include "pinctrl-samsung.h"
|
||||
#include "pinctrl-exynos.h"
|
||||
|
|
@ -528,10 +532,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
|
|||
|
||||
weint_data = devm_kzalloc(dev, bank->nr_pins
|
||||
* sizeof(*weint_data), GFP_KERNEL);
|
||||
if (!weint_data) {
|
||||
dev_err(dev, "could not allocate memory for weint_data\n");
|
||||
if (!weint_data)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for (idx = 0; idx < bank->nr_pins; ++idx) {
|
||||
irq = irq_of_parse_and_map(bank->of_node, idx);
|
||||
|
|
@ -559,10 +561,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
|
|||
|
||||
muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
|
||||
+ muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
|
||||
if (!muxed_data) {
|
||||
dev_err(dev, "could not allocate memory for muxed_data\n");
|
||||
if (!muxed_data)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
irq_set_chained_handler_and_data(irq, exynos_irq_demux_eint16_31,
|
||||
muxed_data);
|
||||
|
|
@ -644,6 +644,60 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata)
|
|||
exynos_pinctrl_resume_bank(drvdata, bank);
|
||||
}
|
||||
|
||||
/* Retention control for S5PV210 are located at the end of clock controller */
|
||||
#define S5P_OTHERS 0xE000
|
||||
|
||||
#define S5P_OTHERS_RET_IO (1 << 31)
|
||||
#define S5P_OTHERS_RET_CF (1 << 30)
|
||||
#define S5P_OTHERS_RET_MMC (1 << 29)
|
||||
#define S5P_OTHERS_RET_UART (1 << 28)
|
||||
|
||||
static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata)
|
||||
{
|
||||
void *clk_base = drvdata->retention_ctrl->priv;
|
||||
u32 tmp;
|
||||
|
||||
tmp = __raw_readl(clk_base + S5P_OTHERS);
|
||||
tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF | S5P_OTHERS_RET_MMC |
|
||||
S5P_OTHERS_RET_UART);
|
||||
__raw_writel(tmp, clk_base + S5P_OTHERS);
|
||||
}
|
||||
|
||||
static struct samsung_retention_ctrl *
|
||||
s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata,
|
||||
const struct samsung_retention_data *data)
|
||||
{
|
||||
struct samsung_retention_ctrl *ctrl;
|
||||
struct device_node *np;
|
||||
void *clk_base;
|
||||
|
||||
ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL);
|
||||
if (!ctrl)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
|
||||
if (!np) {
|
||||
pr_err("%s: failed to find clock controller DT node\n",
|
||||
__func__);
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
clk_base = of_iomap(np, 0);
|
||||
if (!clk_base) {
|
||||
pr_err("%s: failed to map clock registers\n", __func__);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
ctrl->priv = clk_base;
|
||||
ctrl->disable = s5pv210_retention_disable;
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
static const struct samsung_retention_data s5pv210_retention_data __initconst = {
|
||||
.init = s5pv210_retention_init,
|
||||
};
|
||||
|
||||
/* pin banks of s5pv210 pin-controller */
|
||||
static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
|
||||
|
|
@ -691,9 +745,58 @@ const struct samsung_pin_ctrl s5pv210_pin_ctrl[] __initconst = {
|
|||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &s5pv210_retention_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* Pad retention control code for accessing PMU regmap */
|
||||
static atomic_t exynos_shared_retention_refcnt;
|
||||
|
||||
static void exynos_retention_enable(struct samsung_pinctrl_drv_data *drvdata)
|
||||
{
|
||||
if (drvdata->retention_ctrl->refcnt)
|
||||
atomic_inc(drvdata->retention_ctrl->refcnt);
|
||||
}
|
||||
|
||||
static void exynos_retention_disable(struct samsung_pinctrl_drv_data *drvdata)
|
||||
{
|
||||
struct samsung_retention_ctrl *ctrl = drvdata->retention_ctrl;
|
||||
struct regmap *pmu_regs = ctrl->priv;
|
||||
int i;
|
||||
|
||||
if (ctrl->refcnt && !atomic_dec_and_test(ctrl->refcnt))
|
||||
return;
|
||||
|
||||
for (i = 0; i < ctrl->nr_regs; i++)
|
||||
regmap_write(pmu_regs, ctrl->regs[i], ctrl->value);
|
||||
}
|
||||
|
||||
static struct samsung_retention_ctrl *
|
||||
exynos_retention_init(struct samsung_pinctrl_drv_data *drvdata,
|
||||
const struct samsung_retention_data *data)
|
||||
{
|
||||
struct samsung_retention_ctrl *ctrl;
|
||||
struct regmap *pmu_regs;
|
||||
|
||||
ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL);
|
||||
if (!ctrl)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
pmu_regs = exynos_get_pmu_regmap();
|
||||
if (IS_ERR(pmu_regs))
|
||||
return ERR_CAST(pmu_regs);
|
||||
|
||||
ctrl->priv = pmu_regs;
|
||||
ctrl->regs = data->regs;
|
||||
ctrl->nr_regs = data->nr_regs;
|
||||
ctrl->value = data->value;
|
||||
ctrl->refcnt = data->refcnt;
|
||||
ctrl->enable = exynos_retention_enable;
|
||||
ctrl->disable = exynos_retention_disable;
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
/* pin banks of exynos3250 pin-controller 0 */
|
||||
static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
|
||||
|
|
@ -725,6 +828,30 @@ static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst =
|
|||
EXYNOS_PIN_BANK_EINTW(8, 0xc60, "gpx3", 0x0c),
|
||||
};
|
||||
|
||||
/*
|
||||
* PMU pad retention groups for Exynos3250 doesn't match pin banks, so handle
|
||||
* them all together
|
||||
*/
|
||||
static const u32 exynos3250_retention_regs[] = {
|
||||
S5P_PAD_RET_MAUDIO_OPTION,
|
||||
S5P_PAD_RET_GPIO_OPTION,
|
||||
S5P_PAD_RET_UART_OPTION,
|
||||
S5P_PAD_RET_MMCA_OPTION,
|
||||
S5P_PAD_RET_MMCB_OPTION,
|
||||
S5P_PAD_RET_EBIA_OPTION,
|
||||
S5P_PAD_RET_EBIB_OPTION,
|
||||
S5P_PAD_RET_MMC2_OPTION,
|
||||
S5P_PAD_RET_SPI_OPTION,
|
||||
};
|
||||
|
||||
static const struct samsung_retention_data exynos3250_retention_data __initconst = {
|
||||
.regs = exynos3250_retention_regs,
|
||||
.nr_regs = ARRAY_SIZE(exynos3250_retention_regs),
|
||||
.value = EXYNOS_WAKEUP_FROM_LOWPWR,
|
||||
.refcnt = &exynos_shared_retention_refcnt,
|
||||
.init = exynos_retention_init,
|
||||
};
|
||||
|
||||
/*
|
||||
* Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes
|
||||
* two gpio/pin-mux/pinconfig controllers.
|
||||
|
|
@ -737,6 +864,7 @@ const struct samsung_pin_ctrl exynos3250_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos3250_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos3250_pin_banks1,
|
||||
|
|
@ -745,6 +873,7 @@ const struct samsung_pin_ctrl exynos3250_pin_ctrl[] __initconst = {
|
|||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos3250_retention_data,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -797,6 +926,36 @@ static const struct samsung_pin_bank_data exynos4210_pin_banks2[] __initconst =
|
|||
EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
|
||||
};
|
||||
|
||||
/* PMU pad retention groups registers for Exynos4 (without audio) */
|
||||
static const u32 exynos4_retention_regs[] = {
|
||||
S5P_PAD_RET_GPIO_OPTION,
|
||||
S5P_PAD_RET_UART_OPTION,
|
||||
S5P_PAD_RET_MMCA_OPTION,
|
||||
S5P_PAD_RET_MMCB_OPTION,
|
||||
S5P_PAD_RET_EBIA_OPTION,
|
||||
S5P_PAD_RET_EBIB_OPTION,
|
||||
};
|
||||
|
||||
static const struct samsung_retention_data exynos4_retention_data __initconst = {
|
||||
.regs = exynos4_retention_regs,
|
||||
.nr_regs = ARRAY_SIZE(exynos4_retention_regs),
|
||||
.value = EXYNOS_WAKEUP_FROM_LOWPWR,
|
||||
.refcnt = &exynos_shared_retention_refcnt,
|
||||
.init = exynos_retention_init,
|
||||
};
|
||||
|
||||
/* PMU retention control for audio pins can be tied to audio pin bank */
|
||||
static const u32 exynos4_audio_retention_regs[] = {
|
||||
S5P_PAD_RET_MAUDIO_OPTION,
|
||||
};
|
||||
|
||||
static const struct samsung_retention_data exynos4_audio_retention_data __initconst = {
|
||||
.regs = exynos4_audio_retention_regs,
|
||||
.nr_regs = ARRAY_SIZE(exynos4_audio_retention_regs),
|
||||
.value = EXYNOS_WAKEUP_FROM_LOWPWR,
|
||||
.init = exynos_retention_init,
|
||||
};
|
||||
|
||||
/*
|
||||
* Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes
|
||||
* three gpio/pin-mux/pinconfig controllers.
|
||||
|
|
@ -809,6 +968,7 @@ const struct samsung_pin_ctrl exynos4210_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos4210_pin_banks1,
|
||||
|
|
@ -817,10 +977,12 @@ const struct samsung_pin_ctrl exynos4210_pin_ctrl[] __initconst = {
|
|||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 2 data */
|
||||
.pin_banks = exynos4210_pin_banks2,
|
||||
.nr_banks = ARRAY_SIZE(exynos4210_pin_banks2),
|
||||
.retention_data = &exynos4_audio_retention_data,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -894,6 +1056,7 @@ const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos4x12_pin_banks1,
|
||||
|
|
@ -902,6 +1065,7 @@ const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
|
|||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 2 data */
|
||||
.pin_banks = exynos4x12_pin_banks2,
|
||||
|
|
@ -909,6 +1073,7 @@ const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_audio_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 3 data */
|
||||
.pin_banks = exynos4x12_pin_banks3,
|
||||
|
|
@ -919,81 +1084,6 @@ const struct samsung_pin_ctrl exynos4x12_pin_ctrl[] __initconst = {
|
|||
},
|
||||
};
|
||||
|
||||
/* pin banks of exynos4415 pin-controller 0 */
|
||||
static const struct samsung_pin_bank_data exynos4415_pin_banks0[] = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpd0", 0x14),
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpd1", 0x18),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf0", 0x30),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpf1", 0x34),
|
||||
EXYNOS_PIN_BANK_EINTG(1, 0x1C0, "gpf2", 0x38),
|
||||
};
|
||||
|
||||
/* pin banks of exynos4415 pin-controller 1 */
|
||||
static const struct samsung_pin_bank_data exynos4415_pin_banks1[] = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpk0", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x0A0, "gpk3", 0x14),
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x0C0, "gpl0", 0x18),
|
||||
EXYNOS_PIN_BANK_EINTN(6, 0x120, "mp00"),
|
||||
EXYNOS_PIN_BANK_EINTN(4, 0x140, "mp01"),
|
||||
EXYNOS_PIN_BANK_EINTN(6, 0x160, "mp02"),
|
||||
EXYNOS_PIN_BANK_EINTN(8, 0x180, "mp03"),
|
||||
EXYNOS_PIN_BANK_EINTN(8, 0x1A0, "mp04"),
|
||||
EXYNOS_PIN_BANK_EINTN(8, 0x1C0, "mp05"),
|
||||
EXYNOS_PIN_BANK_EINTN(8, 0x1E0, "mp06"),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x260, "gpm0", 0x24),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x280, "gpm1", 0x28),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x2A0, "gpm2", 0x2c),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x2C0, "gpm3", 0x30),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x2E0, "gpm4", 0x34),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
|
||||
};
|
||||
|
||||
/* pin banks of exynos4415 pin-controller 2 */
|
||||
static const struct samsung_pin_bank_data exynos4415_pin_banks2[] = {
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTN(2, 0x000, "etc1"),
|
||||
};
|
||||
|
||||
/*
|
||||
* Samsung pinctrl driver data for Exynos4415 SoC. Exynos4415 SoC includes
|
||||
* three gpio/pin-mux/pinconfig controllers.
|
||||
*/
|
||||
const struct samsung_pin_ctrl exynos4415_pin_ctrl[] = {
|
||||
{
|
||||
/* pin-controller instance 0 data */
|
||||
.pin_banks = exynos4415_pin_banks0,
|
||||
.nr_banks = ARRAY_SIZE(exynos4415_pin_banks0),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos4415_pin_banks1,
|
||||
.nr_banks = ARRAY_SIZE(exynos4415_pin_banks1),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 2 data */
|
||||
.pin_banks = exynos4415_pin_banks2,
|
||||
.nr_banks = ARRAY_SIZE(exynos4415_pin_banks2),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
},
|
||||
};
|
||||
|
||||
/* pin banks of exynos5250 pin-controller 0 */
|
||||
static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
|
||||
|
|
@ -1063,6 +1153,7 @@ const struct samsung_pin_ctrl exynos5250_pin_ctrl[] __initconst = {
|
|||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos5250_pin_banks1,
|
||||
|
|
@ -1070,6 +1161,7 @@ const struct samsung_pin_ctrl exynos5250_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 2 data */
|
||||
.pin_banks = exynos5250_pin_banks2,
|
||||
|
|
@ -1084,6 +1176,7 @@ const struct samsung_pin_ctrl exynos5250_pin_ctrl[] __initconst = {
|
|||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
.retention_data = &exynos4_audio_retention_data,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -1310,6 +1403,30 @@ static const struct samsung_pin_bank_data exynos5420_pin_banks4[] __initconst =
|
|||
EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
|
||||
};
|
||||
|
||||
/* PMU pad retention groups registers for Exynos5420 (without audio) */
|
||||
static const u32 exynos5420_retention_regs[] = {
|
||||
EXYNOS_PAD_RET_DRAM_OPTION,
|
||||
EXYNOS_PAD_RET_JTAG_OPTION,
|
||||
EXYNOS5420_PAD_RET_GPIO_OPTION,
|
||||
EXYNOS5420_PAD_RET_UART_OPTION,
|
||||
EXYNOS5420_PAD_RET_MMCA_OPTION,
|
||||
EXYNOS5420_PAD_RET_MMCB_OPTION,
|
||||
EXYNOS5420_PAD_RET_MMCC_OPTION,
|
||||
EXYNOS5420_PAD_RET_HSI_OPTION,
|
||||
EXYNOS_PAD_RET_EBIA_OPTION,
|
||||
EXYNOS_PAD_RET_EBIB_OPTION,
|
||||
EXYNOS5420_PAD_RET_SPI_OPTION,
|
||||
EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION,
|
||||
};
|
||||
|
||||
static const struct samsung_retention_data exynos5420_retention_data __initconst = {
|
||||
.regs = exynos5420_retention_regs,
|
||||
.nr_regs = ARRAY_SIZE(exynos5420_retention_regs),
|
||||
.value = EXYNOS_WAKEUP_FROM_LOWPWR,
|
||||
.refcnt = &exynos_shared_retention_refcnt,
|
||||
.init = exynos_retention_init,
|
||||
};
|
||||
|
||||
/*
|
||||
* Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
|
||||
* four gpio/pin-mux/pinconfig controllers.
|
||||
|
|
@ -1321,114 +1438,119 @@ const struct samsung_pin_ctrl exynos5420_pin_ctrl[] __initconst = {
|
|||
.nr_banks = ARRAY_SIZE(exynos5420_pin_banks0),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.retention_data = &exynos5420_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 1 data */
|
||||
.pin_banks = exynos5420_pin_banks1,
|
||||
.nr_banks = ARRAY_SIZE(exynos5420_pin_banks1),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.retention_data = &exynos5420_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 2 data */
|
||||
.pin_banks = exynos5420_pin_banks2,
|
||||
.nr_banks = ARRAY_SIZE(exynos5420_pin_banks2),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.retention_data = &exynos5420_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 3 data */
|
||||
.pin_banks = exynos5420_pin_banks3,
|
||||
.nr_banks = ARRAY_SIZE(exynos5420_pin_banks3),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.retention_data = &exynos5420_retention_data,
|
||||
}, {
|
||||
/* pin-controller instance 4 data */
|
||||
.pin_banks = exynos5420_pin_banks4,
|
||||
.nr_banks = ARRAY_SIZE(exynos5420_pin_banks4),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.retention_data = &exynos4_audio_retention_data,
|
||||
},
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - ALIVE */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks0[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
|
||||
EXYNOS5433_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04),
|
||||
EXYNOS5433_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08),
|
||||
EXYNOS5433_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c),
|
||||
EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x020, "gpf1", 0x1004, 1),
|
||||
EXYNOS5433_PIN_BANK_EINTW_EXT(4, 0x040, "gpf2", 0x1008, 1),
|
||||
EXYNOS5433_PIN_BANK_EINTW_EXT(4, 0x060, "gpf3", 0x100c, 1),
|
||||
EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x080, "gpf4", 0x1010, 1),
|
||||
EXYNOS5433_PIN_BANK_EINTW_EXT(8, 0x0a0, "gpf5", 0x1014, 1),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c),
|
||||
EXYNOS_PIN_BANK_EINTW_EXT(8, 0x020, "gpf1", 0x1004, 1),
|
||||
EXYNOS_PIN_BANK_EINTW_EXT(4, 0x040, "gpf2", 0x1008, 1),
|
||||
EXYNOS_PIN_BANK_EINTW_EXT(4, 0x060, "gpf3", 0x100c, 1),
|
||||
EXYNOS_PIN_BANK_EINTW_EXT(8, 0x080, "gpf4", 0x1010, 1),
|
||||
EXYNOS_PIN_BANK_EINTW_EXT(8, 0x0a0, "gpf5", 0x1014, 1),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - AUD */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks1[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
|
||||
EXYNOS5433_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks1[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - CPIF */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks2[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks2[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - eSE */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks3[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks3[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - FINGER */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks4[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks4[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - FSYS */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks5[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00),
|
||||
EXYNOS5433_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04),
|
||||
EXYNOS5433_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x060, "gpr1", 0x0c),
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x080, "gpr2", 0x10),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x0a0, "gpr3", 0x14),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpr1", 0x0c),
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpr2", 0x10),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpr3", 0x14),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - IMEM */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks6[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks6[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - NFC */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks7[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks7[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - PERIC */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks8[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00),
|
||||
EXYNOS5433_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08),
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x060, "gpc1", 0x0c),
|
||||
EXYNOS5433_PIN_BANK_EINTG(6, 0x080, "gpc2", 0x10),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x0a0, "gpc3", 0x14),
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x0c0, "gpg0", 0x18),
|
||||
EXYNOS5433_PIN_BANK_EINTG(4, 0x0e0, "gpd0", 0x1c),
|
||||
EXYNOS5433_PIN_BANK_EINTG(6, 0x100, "gpd1", 0x20),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x120, "gpd2", 0x24),
|
||||
EXYNOS5433_PIN_BANK_EINTG(5, 0x140, "gpd4", 0x28),
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x160, "gpd8", 0x2c),
|
||||
EXYNOS5433_PIN_BANK_EINTG(7, 0x180, "gpd6", 0x30),
|
||||
EXYNOS5433_PIN_BANK_EINTG(3, 0x1a0, "gpd7", 0x34),
|
||||
EXYNOS5433_PIN_BANK_EINTG(5, 0x1c0, "gpg1", 0x38),
|
||||
EXYNOS5433_PIN_BANK_EINTG(2, 0x1e0, "gpg2", 0x3c),
|
||||
EXYNOS5433_PIN_BANK_EINTG(8, 0x200, "gpg3", 0x40),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08),
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x060, "gpc1", 0x0c),
|
||||
EXYNOS_PIN_BANK_EINTG(6, 0x080, "gpc2", 0x10),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpc3", 0x14),
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x0c0, "gpg0", 0x18),
|
||||
EXYNOS_PIN_BANK_EINTG(4, 0x0e0, "gpd0", 0x1c),
|
||||
EXYNOS_PIN_BANK_EINTG(6, 0x100, "gpd1", 0x20),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpd2", 0x24),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x140, "gpd4", 0x28),
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x160, "gpd8", 0x2c),
|
||||
EXYNOS_PIN_BANK_EINTG(7, 0x180, "gpd6", 0x30),
|
||||
EXYNOS_PIN_BANK_EINTG(3, 0x1a0, "gpd7", 0x34),
|
||||
EXYNOS_PIN_BANK_EINTG(5, 0x1c0, "gpg1", 0x38),
|
||||
EXYNOS_PIN_BANK_EINTG(2, 0x1e0, "gpg2", 0x3c),
|
||||
EXYNOS_PIN_BANK_EINTG(8, 0x200, "gpg3", 0x40),
|
||||
};
|
||||
|
||||
/* pin banks of exynos5433 pin-controller - TOUCH */
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks9[] = {
|
||||
EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00),
|
||||
static const struct samsung_pin_bank_data exynos5433_pin_banks9[] __initconst = {
|
||||
EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00),
|
||||
};
|
||||
|
||||
/*
|
||||
* Samsung pinctrl driver data for Exynos5433 SoC. Exynos5433 SoC includes
|
||||
* ten gpio/pin-mux/pinconfig controllers.
|
||||
*/
|
||||
const struct samsung_pin_ctrl exynos5433_pin_ctrl[] = {
|
||||
const struct samsung_pin_ctrl exynos5433_pin_ctrl[] __initconst = {
|
||||
{
|
||||
/* pin-controller instance 0 data */
|
||||
.pin_banks = exynos5433_pin_banks0,
|
||||
|
|
|
|||
|
|
@ -489,10 +489,8 @@ static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
|
|||
|
||||
data = devm_kzalloc(dev, sizeof(*data)
|
||||
+ nr_domains * sizeof(*data->domains), GFP_KERNEL);
|
||||
if (!data) {
|
||||
dev_err(dev, "failed to allocate handler data\n");
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
}
|
||||
data->drvdata = d;
|
||||
|
||||
bank = d->pin_banks;
|
||||
|
|
@ -715,10 +713,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d)
|
|||
return -ENODEV;
|
||||
|
||||
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
dev_err(dev, "could not allocate memory for wkup eint data\n");
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
}
|
||||
data->drvdata = d;
|
||||
|
||||
for (i = 0; i < NUM_EINT0_IRQ; ++i) {
|
||||
|
|
@ -751,10 +747,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d)
|
|||
|
||||
ddata = devm_kzalloc(dev,
|
||||
sizeof(*ddata) + nr_eints, GFP_KERNEL);
|
||||
if (!ddata) {
|
||||
dev_err(dev, "failed to allocate domain data\n");
|
||||
if (!ddata)
|
||||
return -ENOMEM;
|
||||
}
|
||||
ddata->bank = bank;
|
||||
|
||||
bank->irq_domain = irq_domain_add_linear(bank->of_node,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
|
||||
#include "../core.h"
|
||||
#include "pinctrl-samsung.h"
|
||||
|
|
@ -48,9 +48,6 @@ static struct pin_config {
|
|||
{ "samsung,pin-val", PINCFG_TYPE_DAT },
|
||||
};
|
||||
|
||||
/* Global list of devices (struct samsung_pinctrl_drv_data) */
|
||||
static LIST_HEAD(drvdata_list);
|
||||
|
||||
static unsigned int pin_base;
|
||||
|
||||
static int samsung_get_group_count(struct pinctrl_dev *pctldev)
|
||||
|
|
@ -93,10 +90,8 @@ static int reserve_map(struct device *dev, struct pinctrl_map **map,
|
|||
return 0;
|
||||
|
||||
new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL);
|
||||
if (!new_map) {
|
||||
dev_err(dev, "krealloc(map) failed\n");
|
||||
if (!new_map)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map));
|
||||
|
||||
|
|
@ -133,10 +128,8 @@ static int add_map_configs(struct device *dev, struct pinctrl_map **map,
|
|||
|
||||
dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
|
||||
GFP_KERNEL);
|
||||
if (!dup_configs) {
|
||||
dev_err(dev, "kmemdup(configs) failed\n");
|
||||
if (!dup_configs)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
(*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
|
||||
(*map)[*num_maps].data.configs.group_or_pin = group;
|
||||
|
|
@ -156,10 +149,8 @@ static int add_config(struct device *dev, unsigned long **configs,
|
|||
|
||||
new_configs = krealloc(*configs, sizeof(*new_configs) * new_num,
|
||||
GFP_KERNEL);
|
||||
if (!new_configs) {
|
||||
dev_err(dev, "krealloc(configs) failed\n");
|
||||
if (!new_configs)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
new_configs[old_num] = config;
|
||||
|
||||
|
|
@ -356,7 +347,7 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
|
|||
|
||||
/* enable or disable a pinmux function */
|
||||
static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector,
|
||||
unsigned group, bool enable)
|
||||
unsigned group)
|
||||
{
|
||||
struct samsung_pinctrl_drv_data *drvdata;
|
||||
const struct samsung_pin_bank_type *type;
|
||||
|
|
@ -386,8 +377,7 @@ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector,
|
|||
|
||||
data = readl(reg + type->reg_offset[PINCFG_TYPE_FUNC]);
|
||||
data &= ~(mask << shift);
|
||||
if (enable)
|
||||
data |= func->val << shift;
|
||||
data |= func->val << shift;
|
||||
writel(data, reg + type->reg_offset[PINCFG_TYPE_FUNC]);
|
||||
|
||||
spin_unlock_irqrestore(&bank->slock, flags);
|
||||
|
|
@ -398,7 +388,7 @@ static int samsung_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
unsigned selector,
|
||||
unsigned group)
|
||||
{
|
||||
samsung_pinmux_setup(pctldev, selector, group, true);
|
||||
samsung_pinmux_setup(pctldev, selector, group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -756,10 +746,8 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions(
|
|||
|
||||
functions = devm_kzalloc(dev, func_cnt * sizeof(*functions),
|
||||
GFP_KERNEL);
|
||||
if (!functions) {
|
||||
dev_err(dev, "failed to allocate memory for function list\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
if (!functions)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
func = functions;
|
||||
|
||||
/*
|
||||
|
|
@ -850,10 +838,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
|
|||
|
||||
pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
|
||||
drvdata->nr_pins, GFP_KERNEL);
|
||||
if (!pindesc) {
|
||||
dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n");
|
||||
if (!pindesc)
|
||||
return -ENOMEM;
|
||||
}
|
||||
ctrldesc->pins = pindesc;
|
||||
ctrldesc->npins = drvdata->nr_pins;
|
||||
|
||||
|
|
@ -867,10 +853,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev,
|
|||
*/
|
||||
pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH *
|
||||
drvdata->nr_pins, GFP_KERNEL);
|
||||
if (!pin_names) {
|
||||
dev_err(&pdev->dev, "mem alloc for pin names failed\n");
|
||||
if (!pin_names)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* for each pin, the name of the pin is pin-bank name + pin number */
|
||||
for (bank = 0; bank < drvdata->nr_banks; bank++) {
|
||||
|
|
@ -968,15 +952,12 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id samsung_pinctrl_dt_match[];
|
||||
|
||||
/* retrieve the soc specific data */
|
||||
static const struct samsung_pin_ctrl *
|
||||
samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
|
||||
struct platform_device *pdev)
|
||||
{
|
||||
int id;
|
||||
const struct of_device_id *match;
|
||||
struct device_node *node = pdev->dev.of_node;
|
||||
struct device_node *np;
|
||||
const struct samsung_pin_bank_data *bdata;
|
||||
|
|
@ -991,8 +972,8 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
|
|||
dev_err(&pdev->dev, "failed to get alias id\n");
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
match = of_match_node(samsung_pinctrl_dt_match, node);
|
||||
ctrl = (struct samsung_pin_ctrl *)match->data + id;
|
||||
ctrl = of_device_get_match_data(&pdev->dev);
|
||||
ctrl += id;
|
||||
|
||||
d->suspend = ctrl->suspend;
|
||||
d->resume = ctrl->resume;
|
||||
|
|
@ -1007,10 +988,9 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
|
|||
|
||||
for (i = 0; i < ctrl->nr_ext_resources + 1; i++) {
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
|
||||
virt_base[i] = devm_ioremap(&pdev->dev, res->start,
|
||||
resource_size(res));
|
||||
virt_base[i] = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(virt_base[i]))
|
||||
return ERR_PTR(-EIO);
|
||||
return ERR_CAST(virt_base[i]);
|
||||
}
|
||||
|
||||
bank = d->pin_banks;
|
||||
|
|
@ -1075,6 +1055,13 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
|
|||
if (res)
|
||||
drvdata->irq = res->start;
|
||||
|
||||
if (ctrl->retention_data) {
|
||||
drvdata->retention_ctrl = ctrl->retention_data->init(drvdata,
|
||||
ctrl->retention_data);
|
||||
if (IS_ERR(drvdata->retention_ctrl))
|
||||
return PTR_ERR(drvdata->retention_ctrl);
|
||||
}
|
||||
|
||||
ret = samsung_gpiolib_register(pdev, drvdata);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -1092,22 +1079,17 @@ static int samsung_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, drvdata);
|
||||
|
||||
/* Add to the global list */
|
||||
list_add_tail(&drvdata->node, &drvdata_list);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
/**
|
||||
* samsung_pinctrl_suspend_dev - save pinctrl state for suspend for a device
|
||||
* samsung_pinctrl_suspend - save pinctrl state for suspend
|
||||
*
|
||||
* Save data for all banks handled by this device.
|
||||
*/
|
||||
static void samsung_pinctrl_suspend_dev(
|
||||
struct samsung_pinctrl_drv_data *drvdata)
|
||||
static int __maybe_unused samsung_pinctrl_suspend(struct device *dev)
|
||||
{
|
||||
struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < drvdata->nr_banks; i++) {
|
||||
|
|
@ -1141,18 +1123,23 @@ static void samsung_pinctrl_suspend_dev(
|
|||
|
||||
if (drvdata->suspend)
|
||||
drvdata->suspend(drvdata);
|
||||
if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable)
|
||||
drvdata->retention_ctrl->enable(drvdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* samsung_pinctrl_resume_dev - restore pinctrl state from suspend for a device
|
||||
* samsung_pinctrl_resume - restore pinctrl state from suspend
|
||||
*
|
||||
* Restore one of the banks that was saved during suspend.
|
||||
*
|
||||
* We don't bother doing anything complicated to avoid glitching lines since
|
||||
* we're called before pad retention is turned off.
|
||||
*/
|
||||
static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata)
|
||||
static int __maybe_unused samsung_pinctrl_resume(struct device *dev)
|
||||
{
|
||||
struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev);
|
||||
int i;
|
||||
|
||||
if (drvdata->resume)
|
||||
|
|
@ -1188,48 +1175,13 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata)
|
|||
if (widths[type])
|
||||
writel(bank->pm_save[type], reg + offs[type]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* samsung_pinctrl_suspend - save pinctrl state for suspend
|
||||
*
|
||||
* Save data for all banks across all devices.
|
||||
*/
|
||||
static int samsung_pinctrl_suspend(void)
|
||||
{
|
||||
struct samsung_pinctrl_drv_data *drvdata;
|
||||
|
||||
list_for_each_entry(drvdata, &drvdata_list, node) {
|
||||
samsung_pinctrl_suspend_dev(drvdata);
|
||||
}
|
||||
if (drvdata->retention_ctrl && drvdata->retention_ctrl->disable)
|
||||
drvdata->retention_ctrl->disable(drvdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* samsung_pinctrl_resume - restore pinctrl state for suspend
|
||||
*
|
||||
* Restore data for all banks across all devices.
|
||||
*/
|
||||
static void samsung_pinctrl_resume(void)
|
||||
{
|
||||
struct samsung_pinctrl_drv_data *drvdata;
|
||||
|
||||
list_for_each_entry_reverse(drvdata, &drvdata_list, node) {
|
||||
samsung_pinctrl_resume_dev(drvdata);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define samsung_pinctrl_suspend NULL
|
||||
#define samsung_pinctrl_resume NULL
|
||||
#endif
|
||||
|
||||
static struct syscore_ops samsung_pinctrl_syscore_ops = {
|
||||
.suspend = samsung_pinctrl_suspend,
|
||||
.resume = samsung_pinctrl_resume,
|
||||
};
|
||||
|
||||
static const struct of_device_id samsung_pinctrl_dt_match[] = {
|
||||
#ifdef CONFIG_PINCTRL_EXYNOS
|
||||
{ .compatible = "samsung,exynos3250-pinctrl",
|
||||
|
|
@ -1238,8 +1190,6 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
|
|||
.data = (void *)exynos4210_pin_ctrl },
|
||||
{ .compatible = "samsung,exynos4x12-pinctrl",
|
||||
.data = (void *)exynos4x12_pin_ctrl },
|
||||
{ .compatible = "samsung,exynos4415-pinctrl",
|
||||
.data = (void *)exynos4415_pin_ctrl },
|
||||
{ .compatible = "samsung,exynos5250-pinctrl",
|
||||
.data = (void *)exynos5250_pin_ctrl },
|
||||
{ .compatible = "samsung,exynos5260-pinctrl",
|
||||
|
|
@ -1273,25 +1223,23 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);
|
||||
|
||||
static const struct dev_pm_ops samsung_pinctrl_pm_ops = {
|
||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend,
|
||||
samsung_pinctrl_resume)
|
||||
};
|
||||
|
||||
static struct platform_driver samsung_pinctrl_driver = {
|
||||
.probe = samsung_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "samsung-pinctrl",
|
||||
.of_match_table = samsung_pinctrl_dt_match,
|
||||
.suppress_bind_attrs = true,
|
||||
.pm = &samsung_pinctrl_pm_ops,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init samsung_pinctrl_drv_register(void)
|
||||
{
|
||||
/*
|
||||
* Register syscore ops for save/restore of registers across suspend.
|
||||
* It's important to ensure that this driver is running at an earlier
|
||||
* initcall level than any arch-specific init calls that install syscore
|
||||
* ops that turn off pad retention (like exynos_pm_resume).
|
||||
*/
|
||||
register_syscore_ops(&samsung_pinctrl_syscore_ops);
|
||||
|
||||
return platform_driver_register(&samsung_pinctrl_driver);
|
||||
}
|
||||
postcore_initcall(samsung_pinctrl_drv_register);
|
||||
|
|
|
|||
|
|
@ -184,11 +184,49 @@ struct samsung_pin_bank {
|
|||
u32 pm_save[PINCFG_TYPE_NUM + 1]; /* +1 to handle double CON registers*/
|
||||
};
|
||||
|
||||
/**
|
||||
* struct samsung_retention_data: runtime pin-bank retention control data.
|
||||
* @regs: array of PMU registers to control pad retention.
|
||||
* @nr_regs: number of registers in @regs array.
|
||||
* @value: value to store to registers to turn off retention.
|
||||
* @refcnt: atomic counter if retention control affects more than one bank.
|
||||
* @priv: retention control code private data
|
||||
* @enable: platform specific callback to enter retention mode.
|
||||
* @disable: platform specific callback to exit retention mode.
|
||||
**/
|
||||
struct samsung_retention_ctrl {
|
||||
const u32 *regs;
|
||||
int nr_regs;
|
||||
u32 value;
|
||||
atomic_t *refcnt;
|
||||
void *priv;
|
||||
void (*enable)(struct samsung_pinctrl_drv_data *);
|
||||
void (*disable)(struct samsung_pinctrl_drv_data *);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct samsung_retention_data: represent a pin-bank retention control data.
|
||||
* @regs: array of PMU registers to control pad retention.
|
||||
* @nr_regs: number of registers in @regs array.
|
||||
* @value: value to store to registers to turn off retention.
|
||||
* @refcnt: atomic counter if retention control affects more than one bank.
|
||||
* @init: platform specific callback to initialize retention control.
|
||||
**/
|
||||
struct samsung_retention_data {
|
||||
const u32 *regs;
|
||||
int nr_regs;
|
||||
u32 value;
|
||||
atomic_t *refcnt;
|
||||
struct samsung_retention_ctrl *(*init)(struct samsung_pinctrl_drv_data *,
|
||||
const struct samsung_retention_data *);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct samsung_pin_ctrl: represent a pin controller.
|
||||
* @pin_banks: list of pin banks included in this controller.
|
||||
* @nr_banks: number of pin banks.
|
||||
* @nr_ext_resources: number of the extra base address for pin banks.
|
||||
* @retention_data: configuration data for retention control.
|
||||
* @eint_gpio_init: platform specific callback to setup the external gpio
|
||||
* interrupts for the controller.
|
||||
* @eint_wkup_init: platform specific callback to setup the external wakeup
|
||||
|
|
@ -198,6 +236,7 @@ struct samsung_pin_ctrl {
|
|||
const struct samsung_pin_bank_data *pin_banks;
|
||||
u32 nr_banks;
|
||||
int nr_ext_resources;
|
||||
const struct samsung_retention_data *retention_data;
|
||||
|
||||
int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *);
|
||||
int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *);
|
||||
|
|
@ -219,6 +258,7 @@ struct samsung_pin_ctrl {
|
|||
* @nr_function: number of such pin functions.
|
||||
* @pin_base: starting system wide pin number.
|
||||
* @nr_pins: number of pins supported by the controller.
|
||||
* @retention_ctrl: retention control runtime data.
|
||||
*/
|
||||
struct samsung_pinctrl_drv_data {
|
||||
struct list_head node;
|
||||
|
|
@ -238,6 +278,8 @@ struct samsung_pinctrl_drv_data {
|
|||
unsigned int pin_base;
|
||||
unsigned int nr_pins;
|
||||
|
||||
struct samsung_retention_ctrl *retention_ctrl;
|
||||
|
||||
void (*suspend)(struct samsung_pinctrl_drv_data *);
|
||||
void (*resume)(struct samsung_pinctrl_drv_data *);
|
||||
};
|
||||
|
|
@ -273,7 +315,6 @@ struct samsung_pmx_func {
|
|||
extern const struct samsung_pin_ctrl exynos3250_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos4210_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos4x12_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos4415_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos5250_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos5260_pin_ctrl[];
|
||||
extern const struct samsung_pin_ctrl exynos5410_pin_ctrl[];
|
||||
|
|
|
|||
|
|
@ -1691,6 +1691,72 @@ static const struct sh_pfc_pin pinmux_pins[] = {
|
|||
PINMUX_GPIO_GP_ALL(),
|
||||
};
|
||||
|
||||
/* - ADI -------------------------------------------------------------------- */
|
||||
static const unsigned int adi_common_pins[] = {
|
||||
/* ADIDATA, ADICS/SAMP, ADICLK */
|
||||
RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25), RCAR_GP_PIN(6, 26),
|
||||
};
|
||||
static const unsigned int adi_common_mux[] = {
|
||||
/* ADIDATA, ADICS/SAMP, ADICLK */
|
||||
ADIDATA_MARK, ADICS_SAMP_MARK, ADICLK_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel0_pins[] = {
|
||||
/* ADICHS 0 */
|
||||
RCAR_GP_PIN(6, 27),
|
||||
};
|
||||
static const unsigned int adi_chsel0_mux[] = {
|
||||
/* ADICHS 0 */
|
||||
ADICHS0_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel1_pins[] = {
|
||||
/* ADICHS 1 */
|
||||
RCAR_GP_PIN(6, 28),
|
||||
};
|
||||
static const unsigned int adi_chsel1_mux[] = {
|
||||
/* ADICHS 1 */
|
||||
ADICHS1_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel2_pins[] = {
|
||||
/* ADICHS 2 */
|
||||
RCAR_GP_PIN(6, 29),
|
||||
};
|
||||
static const unsigned int adi_chsel2_mux[] = {
|
||||
/* ADICHS 2 */
|
||||
ADICHS2_MARK,
|
||||
};
|
||||
static const unsigned int adi_common_b_pins[] = {
|
||||
/* ADIDATA B, ADICS/SAMP B, ADICLK B */
|
||||
RCAR_GP_PIN(5, 25), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27),
|
||||
};
|
||||
static const unsigned int adi_common_b_mux[] = {
|
||||
/* ADIDATA B, ADICS/SAMP B, ADICLK B */
|
||||
ADIDATA_B_MARK, ADICS_SAMP_B_MARK, ADICLK_B_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel0_b_pins[] = {
|
||||
/* ADICHS B 0 */
|
||||
RCAR_GP_PIN(5, 28),
|
||||
};
|
||||
static const unsigned int adi_chsel0_b_mux[] = {
|
||||
/* ADICHS B 0 */
|
||||
ADICHS0_B_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel1_b_pins[] = {
|
||||
/* ADICHS B 1 */
|
||||
RCAR_GP_PIN(5, 29),
|
||||
};
|
||||
static const unsigned int adi_chsel1_b_mux[] = {
|
||||
/* ADICHS B 1 */
|
||||
ADICHS1_B_MARK,
|
||||
};
|
||||
static const unsigned int adi_chsel2_b_pins[] = {
|
||||
/* ADICHS B 2 */
|
||||
RCAR_GP_PIN(5, 30),
|
||||
};
|
||||
static const unsigned int adi_chsel2_b_mux[] = {
|
||||
/* ADICHS B 2 */
|
||||
ADICHS2_B_MARK,
|
||||
};
|
||||
|
||||
/* - Audio Clock ------------------------------------------------------------ */
|
||||
static const unsigned int audio_clk_a_pins[] = {
|
||||
/* CLK */
|
||||
|
|
@ -4343,6 +4409,14 @@ static const unsigned int vin2_clk_mux[] = {
|
|||
};
|
||||
|
||||
static const struct sh_pfc_pin_group pinmux_groups[] = {
|
||||
SH_PFC_PIN_GROUP(adi_common),
|
||||
SH_PFC_PIN_GROUP(adi_chsel0),
|
||||
SH_PFC_PIN_GROUP(adi_chsel1),
|
||||
SH_PFC_PIN_GROUP(adi_chsel2),
|
||||
SH_PFC_PIN_GROUP(adi_common_b),
|
||||
SH_PFC_PIN_GROUP(adi_chsel0_b),
|
||||
SH_PFC_PIN_GROUP(adi_chsel1_b),
|
||||
SH_PFC_PIN_GROUP(adi_chsel2_b),
|
||||
SH_PFC_PIN_GROUP(audio_clk_a),
|
||||
SH_PFC_PIN_GROUP(audio_clk_b),
|
||||
SH_PFC_PIN_GROUP(audio_clk_b_b),
|
||||
|
|
@ -4687,6 +4761,17 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
|
|||
SH_PFC_PIN_GROUP(vin2_clk),
|
||||
};
|
||||
|
||||
static const char * const adi_groups[] = {
|
||||
"adi_common",
|
||||
"adi_chsel0",
|
||||
"adi_chsel1",
|
||||
"adi_chsel2",
|
||||
"adi_common_b",
|
||||
"adi_chsel0_b",
|
||||
"adi_chsel1_b",
|
||||
"adi_chsel2_b",
|
||||
};
|
||||
|
||||
static const char * const audio_clk_groups[] = {
|
||||
"audio_clk_a",
|
||||
"audio_clk_b",
|
||||
|
|
@ -5192,6 +5277,7 @@ static const char * const vin2_groups[] = {
|
|||
};
|
||||
|
||||
static const struct sh_pfc_function pinmux_functions[] = {
|
||||
SH_PFC_FUNCTION(adi),
|
||||
SH_PFC_FUNCTION(audio_clk),
|
||||
SH_PFC_FUNCTION(avb),
|
||||
SH_PFC_FUNCTION(can0),
|
||||
|
|
@ -6455,6 +6541,7 @@ const struct sh_pfc_soc_info r8a7791_pinmux_info = {
|
|||
#ifdef CONFIG_PINCTRL_PFC_R8A7793
|
||||
const struct sh_pfc_soc_info r8a7793_pinmux_info = {
|
||||
.name = "r8a77930_pfc",
|
||||
.ops = &r8a7791_pinmux_ops,
|
||||
.unlock_reg = 0xe6060000, /* PMMR */
|
||||
|
||||
.function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ MOD_SEL0_2_1 MOD_SEL1_2 \
|
|||
FM(AVB_TXCREFCLK) FM(AVB_MDIO) \
|
||||
FM(CLKOUT) FM(PRESETOUT) \
|
||||
FM(DU_DOTCLKIN0) FM(DU_DOTCLKIN1) FM(DU_DOTCLKIN2) FM(DU_DOTCLKIN3) \
|
||||
FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF)
|
||||
FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF) FM(TDI) FM(TCK) FM(TRST) FM(EXTALR)
|
||||
|
||||
enum {
|
||||
PINMUX_RESERVED = 0,
|
||||
|
|
@ -1461,46 +1461,50 @@ static const struct sh_pfc_pin pinmux_pins[] = {
|
|||
* number for each pin. To this end use the pin layout from
|
||||
* R-Car H3SiP to calculate a unique number for each pin.
|
||||
*/
|
||||
SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('F', 1, CLKOUT, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST#, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 7, DU_DOTCLKIN2, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 8, AVB_TX_CTL, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 9, AVB_MDIO, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('C', 1, PRESETOUT#, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('F', 1, CLKOUT, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 3, QSPI1_SPCLK, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 5, QSPI1_SSL, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 6, RPC_WP#, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('V', 7, RPC_RESET#, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('W', 3, QSPI0_SPCLK, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 3, QSPI0_SSL, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 6, QSPI0_IO2, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG('Y', 7, RPC_INT#, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 4, QSPI0_MISO_IO1, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'), 6, QSPI0_IO3, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 3, QSPI1_IO3, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 5, QSPI0_MOSI_IO0, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'), 7, QSPI1_MOSI_IO0, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST#, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 4, QSPI1_IO2, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'), 5, QSPI1_MISO_IO1, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 7, DU_DOTCLKIN0, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'), 8, DU_DOTCLKIN1, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 7, DU_DOTCLKIN2, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 8, DU_DOTCLKIN3, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
|
||||
SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS),
|
||||
};
|
||||
|
||||
/* - AUDIO CLOCK ------------------------------------------------------------ */
|
||||
|
|
@ -5415,167 +5419,211 @@ static int r8a7795_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc
|
|||
#define PU6 0x18
|
||||
|
||||
static const struct sh_pfc_bias_info bias_info[] = {
|
||||
{ RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */
|
||||
{ RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */
|
||||
{ RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */
|
||||
{ RCAR_GP_PIN(2, 11), PU0, 31 }, /* AVB_PHY_INT */
|
||||
{ RCAR_GP_PIN(2, 10), PU0, 30 }, /* AVB_MAGIC */
|
||||
{ RCAR_GP_PIN(2, 9), PU0, 29 }, /* AVB_MDC */
|
||||
{ PIN_NUMBER('A', 9), PU0, 28 }, /* AVB_MDIO */
|
||||
{ PIN_NUMBER('A', 12), PU0, 27 }, /* AVB_TXCREFCLK */
|
||||
{ PIN_NUMBER('B', 17), PU0, 26 }, /* AVB_TD3 */
|
||||
{ PIN_NUMBER('A', 17), PU0, 25 }, /* AVB_TD2 */
|
||||
{ PIN_NUMBER('B', 18), PU0, 24 }, /* AVB_TD1 */
|
||||
{ PIN_NUMBER('A', 18), PU0, 23 }, /* AVB_TD0 */
|
||||
{ PIN_NUMBER('A', 19), PU0, 22 }, /* AVB_TXC */
|
||||
{ PIN_NUMBER('A', 8), PU0, 21 }, /* AVB_TX_CTL */
|
||||
{ PIN_NUMBER('B', 14), PU0, 20 }, /* AVB_RD3 */
|
||||
{ PIN_NUMBER('A', 14), PU0, 19 }, /* AVB_RD2 */
|
||||
{ PIN_NUMBER('B', 13), PU0, 18 }, /* AVB_RD1 */
|
||||
{ PIN_NUMBER('A', 13), PU0, 17 }, /* AVB_RD0 */
|
||||
{ PIN_NUMBER('B', 19), PU0, 16 }, /* AVB_RXC */
|
||||
{ PIN_NUMBER('A', 16), PU0, 15 }, /* AVB_RX_CTL */
|
||||
{ PIN_NUMBER('V', 7), PU0, 14 }, /* RPC_RESET# */
|
||||
{ PIN_NUMBER('V', 6), PU0, 13 }, /* RPC_WP# */
|
||||
{ PIN_NUMBER('Y', 7), PU0, 12 }, /* RPC_INT# */
|
||||
{ PIN_NUMBER('V', 5), PU0, 11 }, /* QSPI1_SSL */
|
||||
{ PIN_A_NUMBER('C', 3), PU0, 10 }, /* QSPI1_IO3 */
|
||||
{ PIN_A_NUMBER('E', 4), PU0, 9 }, /* QSPI1_IO2 */
|
||||
{ PIN_A_NUMBER('E', 5), PU0, 8 }, /* QSPI1_MISO_IO1 */
|
||||
{ PIN_A_NUMBER('C', 7), PU0, 7 }, /* QSPI1_MOSI_IO0 */
|
||||
{ PIN_NUMBER('V', 3), PU0, 6 }, /* QSPI1_SPCLK */
|
||||
{ PIN_NUMBER('Y', 3), PU0, 5 }, /* QSPI0_SSL */
|
||||
{ PIN_A_NUMBER('B', 6), PU0, 4 }, /* QSPI0_IO3 */
|
||||
{ PIN_NUMBER('Y', 6), PU0, 3 }, /* QSPI0_IO2 */
|
||||
{ PIN_A_NUMBER('B', 4), PU0, 2 }, /* QSPI0_MISO_IO1 */
|
||||
{ PIN_A_NUMBER('C', 5), PU0, 1 }, /* QSPI0_MOSI_IO0 */
|
||||
{ PIN_NUMBER('W', 3), PU0, 0 }, /* QSPI0_SPCLK */
|
||||
|
||||
{ RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */
|
||||
{ RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */
|
||||
{ RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */
|
||||
{ RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */
|
||||
{ RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */
|
||||
{ RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */
|
||||
{ RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */
|
||||
{ RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */
|
||||
{ RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */
|
||||
{ RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */
|
||||
{ RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */
|
||||
{ RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */
|
||||
{ RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */
|
||||
{ RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */
|
||||
{ RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */
|
||||
{ RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */
|
||||
{ RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */
|
||||
{ RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */
|
||||
{ RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */
|
||||
{ RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */
|
||||
{ RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */
|
||||
{ RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */
|
||||
{ RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */
|
||||
{ RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */
|
||||
{ RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */
|
||||
{ RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */
|
||||
{ RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */
|
||||
{ RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */
|
||||
{ RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */
|
||||
{ RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */
|
||||
{ RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */
|
||||
{ RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */
|
||||
{ RCAR_GP_PIN(1, 19), PU1, 31 }, /* A19 */
|
||||
{ RCAR_GP_PIN(1, 18), PU1, 30 }, /* A18 */
|
||||
{ RCAR_GP_PIN(1, 17), PU1, 29 }, /* A17 */
|
||||
{ RCAR_GP_PIN(1, 16), PU1, 28 }, /* A16 */
|
||||
{ RCAR_GP_PIN(1, 15), PU1, 27 }, /* A15 */
|
||||
{ RCAR_GP_PIN(1, 14), PU1, 26 }, /* A14 */
|
||||
{ RCAR_GP_PIN(1, 13), PU1, 25 }, /* A13 */
|
||||
{ RCAR_GP_PIN(1, 12), PU1, 24 }, /* A12 */
|
||||
{ RCAR_GP_PIN(1, 11), PU1, 23 }, /* A11 */
|
||||
{ RCAR_GP_PIN(1, 10), PU1, 22 }, /* A10 */
|
||||
{ RCAR_GP_PIN(1, 9), PU1, 21 }, /* A9 */
|
||||
{ RCAR_GP_PIN(1, 8), PU1, 20 }, /* A8 */
|
||||
{ RCAR_GP_PIN(1, 7), PU1, 19 }, /* A7 */
|
||||
{ RCAR_GP_PIN(1, 6), PU1, 18 }, /* A6 */
|
||||
{ RCAR_GP_PIN(1, 5), PU1, 17 }, /* A5 */
|
||||
{ RCAR_GP_PIN(1, 4), PU1, 16 }, /* A4 */
|
||||
{ RCAR_GP_PIN(1, 3), PU1, 15 }, /* A3 */
|
||||
{ RCAR_GP_PIN(1, 2), PU1, 14 }, /* A2 */
|
||||
{ RCAR_GP_PIN(1, 1), PU1, 13 }, /* A1 */
|
||||
{ RCAR_GP_PIN(1, 0), PU1, 12 }, /* A0 */
|
||||
{ RCAR_GP_PIN(2, 8), PU1, 11 }, /* PWM2_A */
|
||||
{ RCAR_GP_PIN(2, 7), PU1, 10 }, /* PWM1_A */
|
||||
{ RCAR_GP_PIN(2, 6), PU1, 9 }, /* PWM0 */
|
||||
{ RCAR_GP_PIN(2, 5), PU1, 8 }, /* IRQ5 */
|
||||
{ RCAR_GP_PIN(2, 4), PU1, 7 }, /* IRQ4 */
|
||||
{ RCAR_GP_PIN(2, 3), PU1, 6 }, /* IRQ3 */
|
||||
{ RCAR_GP_PIN(2, 2), PU1, 5 }, /* IRQ2 */
|
||||
{ RCAR_GP_PIN(2, 1), PU1, 4 }, /* IRQ1 */
|
||||
{ RCAR_GP_PIN(2, 0), PU1, 3 }, /* IRQ0 */
|
||||
{ RCAR_GP_PIN(2, 14), PU1, 2 }, /* AVB_AVTP_CAPTURE_A */
|
||||
{ RCAR_GP_PIN(2, 13), PU1, 1 }, /* AVB_AVTP_MATCH_A */
|
||||
{ RCAR_GP_PIN(2, 12), PU1, 0 }, /* AVB_LINK */
|
||||
|
||||
{ RCAR_GP_PIN(7, 3), PU2, 29 }, /* HDMI1_CEC */
|
||||
{ RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */
|
||||
{ RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */
|
||||
{ RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */
|
||||
{ RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */
|
||||
{ RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */
|
||||
{ RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */
|
||||
{ RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */
|
||||
{ RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */
|
||||
{ RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */
|
||||
{ RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */
|
||||
{ RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */
|
||||
{ RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */
|
||||
{ RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */
|
||||
{ RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */
|
||||
{ RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */
|
||||
{ RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */
|
||||
{ RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */
|
||||
{ RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */
|
||||
{ RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */
|
||||
{ RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */
|
||||
{ RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */
|
||||
{ RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */
|
||||
{ RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */
|
||||
{ RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */
|
||||
{ RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */
|
||||
{ RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */
|
||||
{ RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */
|
||||
{ PIN_A_NUMBER('P', 8), PU2, 31 }, /* DU_DOTCLKIN1 */
|
||||
{ PIN_A_NUMBER('P', 7), PU2, 30 }, /* DU_DOTCLKIN0 */
|
||||
{ RCAR_GP_PIN(7, 3), PU2, 29 }, /* HDMI1_CEC */
|
||||
{ RCAR_GP_PIN(7, 2), PU2, 28 }, /* HDMI0_CEC */
|
||||
{ RCAR_GP_PIN(7, 1), PU2, 27 }, /* AVS2 */
|
||||
{ RCAR_GP_PIN(7, 0), PU2, 26 }, /* AVS1 */
|
||||
{ RCAR_GP_PIN(0, 15), PU2, 25 }, /* D15 */
|
||||
{ RCAR_GP_PIN(0, 14), PU2, 24 }, /* D14 */
|
||||
{ RCAR_GP_PIN(0, 13), PU2, 23 }, /* D13 */
|
||||
{ RCAR_GP_PIN(0, 12), PU2, 22 }, /* D12 */
|
||||
{ RCAR_GP_PIN(0, 11), PU2, 21 }, /* D11 */
|
||||
{ RCAR_GP_PIN(0, 10), PU2, 20 }, /* D10 */
|
||||
{ RCAR_GP_PIN(0, 9), PU2, 19 }, /* D9 */
|
||||
{ RCAR_GP_PIN(0, 8), PU2, 18 }, /* D8 */
|
||||
{ RCAR_GP_PIN(0, 7), PU2, 17 }, /* D7 */
|
||||
{ RCAR_GP_PIN(0, 6), PU2, 16 }, /* D6 */
|
||||
{ RCAR_GP_PIN(0, 5), PU2, 15 }, /* D5 */
|
||||
{ RCAR_GP_PIN(0, 4), PU2, 14 }, /* D4 */
|
||||
{ RCAR_GP_PIN(0, 3), PU2, 13 }, /* D3 */
|
||||
{ RCAR_GP_PIN(0, 2), PU2, 12 }, /* D2 */
|
||||
{ RCAR_GP_PIN(0, 1), PU2, 11 }, /* D1 */
|
||||
{ RCAR_GP_PIN(0, 0), PU2, 10 }, /* D0 */
|
||||
{ PIN_NUMBER('C', 1), PU2, 9 }, /* PRESETOUT# */
|
||||
{ RCAR_GP_PIN(1, 27), PU2, 8 }, /* EX_WAIT0_A */
|
||||
{ RCAR_GP_PIN(1, 26), PU2, 7 }, /* WE1_N */
|
||||
{ RCAR_GP_PIN(1, 25), PU2, 6 }, /* WE0_N */
|
||||
{ RCAR_GP_PIN(1, 24), PU2, 5 }, /* RD_WR_N */
|
||||
{ RCAR_GP_PIN(1, 23), PU2, 4 }, /* RD_N */
|
||||
{ RCAR_GP_PIN(1, 22), PU2, 3 }, /* BS_N */
|
||||
{ RCAR_GP_PIN(1, 21), PU2, 2 }, /* CS1_N_A26 */
|
||||
{ RCAR_GP_PIN(1, 20), PU2, 1 }, /* CS0_N */
|
||||
{ PIN_NUMBER('F', 1), PU2, 0 }, /* CLKOUT */
|
||||
|
||||
{ RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */
|
||||
{ RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */
|
||||
{ RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */
|
||||
{ RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */
|
||||
{ RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */
|
||||
{ RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */
|
||||
{ RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */
|
||||
{ RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */
|
||||
{ RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */
|
||||
{ RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */
|
||||
{ RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */
|
||||
{ RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */
|
||||
{ RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */
|
||||
{ RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */
|
||||
{ RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */
|
||||
{ RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */
|
||||
{ RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */
|
||||
{ RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */
|
||||
{ RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */
|
||||
{ RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */
|
||||
{ RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */
|
||||
{ RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */
|
||||
{ RCAR_GP_PIN(4, 9), PU3, 31 }, /* SD3_DAT0 */
|
||||
{ RCAR_GP_PIN(4, 8), PU3, 30 }, /* SD3_CMD */
|
||||
{ RCAR_GP_PIN(4, 7), PU3, 29 }, /* SD3_CLK */
|
||||
{ RCAR_GP_PIN(4, 6), PU3, 28 }, /* SD2_DS */
|
||||
{ RCAR_GP_PIN(4, 5), PU3, 27 }, /* SD2_DAT3 */
|
||||
{ RCAR_GP_PIN(4, 4), PU3, 26 }, /* SD2_DAT2 */
|
||||
{ RCAR_GP_PIN(4, 3), PU3, 25 }, /* SD2_DAT1 */
|
||||
{ RCAR_GP_PIN(4, 2), PU3, 24 }, /* SD2_DAT0 */
|
||||
{ RCAR_GP_PIN(4, 1), PU3, 23 }, /* SD2_CMD */
|
||||
{ RCAR_GP_PIN(4, 0), PU3, 22 }, /* SD2_CLK */
|
||||
{ RCAR_GP_PIN(3, 11), PU3, 21 }, /* SD1_DAT3 */
|
||||
{ RCAR_GP_PIN(3, 10), PU3, 20 }, /* SD1_DAT2 */
|
||||
{ RCAR_GP_PIN(3, 9), PU3, 19 }, /* SD1_DAT1 */
|
||||
{ RCAR_GP_PIN(3, 8), PU3, 18 }, /* SD1_DAT0 */
|
||||
{ RCAR_GP_PIN(3, 7), PU3, 17 }, /* SD1_CMD */
|
||||
{ RCAR_GP_PIN(3, 6), PU3, 16 }, /* SD1_CLK */
|
||||
{ RCAR_GP_PIN(3, 5), PU3, 15 }, /* SD0_DAT3 */
|
||||
{ RCAR_GP_PIN(3, 4), PU3, 14 }, /* SD0_DAT2 */
|
||||
{ RCAR_GP_PIN(3, 3), PU3, 13 }, /* SD0_DAT1 */
|
||||
{ RCAR_GP_PIN(3, 2), PU3, 12 }, /* SD0_DAT0 */
|
||||
{ RCAR_GP_PIN(3, 1), PU3, 11 }, /* SD0_CMD */
|
||||
{ RCAR_GP_PIN(3, 0), PU3, 10 }, /* SD0_CLK */
|
||||
{ PIN_A_NUMBER('T', 30), PU3, 9 }, /* ASEBRK */
|
||||
/* bit 8 n/a */
|
||||
{ PIN_A_NUMBER('R', 29), PU3, 7 }, /* TDI */
|
||||
{ PIN_A_NUMBER('R', 30), PU3, 6 }, /* TMS */
|
||||
{ PIN_A_NUMBER('T', 27), PU3, 5 }, /* TCK */
|
||||
{ PIN_A_NUMBER('R', 26), PU3, 4 }, /* TRST# */
|
||||
{ PIN_A_NUMBER('D', 39), PU3, 3 }, /* EXTALR*/
|
||||
{ PIN_A_NUMBER('D', 38), PU3, 2 }, /* FSCLKST# */
|
||||
{ PIN_A_NUMBER('R', 8), PU3, 1 }, /* DU_DOTCLKIN3 */
|
||||
{ PIN_A_NUMBER('R', 7), PU3, 0 }, /* DU_DOTCLKIN2 */
|
||||
|
||||
{ RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */
|
||||
{ RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */
|
||||
{ RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */
|
||||
{ RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */
|
||||
{ RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */
|
||||
{ RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */
|
||||
{ RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */
|
||||
{ RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */
|
||||
{ RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */
|
||||
{ RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */
|
||||
{ RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */
|
||||
{ RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */
|
||||
{ RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */
|
||||
{ RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */
|
||||
{ RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */
|
||||
{ RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */
|
||||
{ RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */
|
||||
{ RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */
|
||||
{ RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */
|
||||
{ RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */
|
||||
{ RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */
|
||||
{ RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */
|
||||
{ RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */
|
||||
{ RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */
|
||||
{ RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */
|
||||
{ RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */
|
||||
{ RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */
|
||||
{ RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */
|
||||
{ RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */
|
||||
{ RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */
|
||||
{ RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */
|
||||
{ RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */
|
||||
{ RCAR_GP_PIN(5, 19), PU4, 31 }, /* MSIOF0_SS1 */
|
||||
{ RCAR_GP_PIN(5, 18), PU4, 30 }, /* MSIOF0_SYNC */
|
||||
{ RCAR_GP_PIN(5, 17), PU4, 29 }, /* MSIOF0_SCK */
|
||||
{ RCAR_GP_PIN(5, 16), PU4, 28 }, /* HRTS0_N */
|
||||
{ RCAR_GP_PIN(5, 15), PU4, 27 }, /* HCTS0_N */
|
||||
{ RCAR_GP_PIN(5, 14), PU4, 26 }, /* HTX0 */
|
||||
{ RCAR_GP_PIN(5, 13), PU4, 25 }, /* HRX0 */
|
||||
{ RCAR_GP_PIN(5, 12), PU4, 24 }, /* HSCK0 */
|
||||
{ RCAR_GP_PIN(5, 11), PU4, 23 }, /* RX2_A */
|
||||
{ RCAR_GP_PIN(5, 10), PU4, 22 }, /* TX2_A */
|
||||
{ RCAR_GP_PIN(5, 9), PU4, 21 }, /* SCK2 */
|
||||
{ RCAR_GP_PIN(5, 8), PU4, 20 }, /* RTS1_N_TANS */
|
||||
{ RCAR_GP_PIN(5, 7), PU4, 19 }, /* CTS1_N */
|
||||
{ RCAR_GP_PIN(5, 6), PU4, 18 }, /* TX1_A */
|
||||
{ RCAR_GP_PIN(5, 5), PU4, 17 }, /* RX1_A */
|
||||
{ RCAR_GP_PIN(5, 4), PU4, 16 }, /* RTS0_N_TANS */
|
||||
{ RCAR_GP_PIN(5, 3), PU4, 15 }, /* CTS0_N */
|
||||
{ RCAR_GP_PIN(5, 2), PU4, 14 }, /* TX0 */
|
||||
{ RCAR_GP_PIN(5, 1), PU4, 13 }, /* RX0 */
|
||||
{ RCAR_GP_PIN(5, 0), PU4, 12 }, /* SCK0 */
|
||||
{ RCAR_GP_PIN(3, 15), PU4, 11 }, /* SD1_WP */
|
||||
{ RCAR_GP_PIN(3, 14), PU4, 10 }, /* SD1_CD */
|
||||
{ RCAR_GP_PIN(3, 13), PU4, 9 }, /* SD0_WP */
|
||||
{ RCAR_GP_PIN(3, 12), PU4, 8 }, /* SD0_CD */
|
||||
{ RCAR_GP_PIN(4, 17), PU4, 7 }, /* SD3_DS */
|
||||
{ RCAR_GP_PIN(4, 16), PU4, 6 }, /* SD3_DAT7 */
|
||||
{ RCAR_GP_PIN(4, 15), PU4, 5 }, /* SD3_DAT6 */
|
||||
{ RCAR_GP_PIN(4, 14), PU4, 4 }, /* SD3_DAT5 */
|
||||
{ RCAR_GP_PIN(4, 13), PU4, 3 }, /* SD3_DAT4 */
|
||||
{ RCAR_GP_PIN(4, 12), PU4, 2 }, /* SD3_DAT3 */
|
||||
{ RCAR_GP_PIN(4, 11), PU4, 1 }, /* SD3_DAT2 */
|
||||
{ RCAR_GP_PIN(4, 10), PU4, 0 }, /* SD3_DAT1 */
|
||||
|
||||
{ RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */
|
||||
{ RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */
|
||||
{ RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */
|
||||
{ RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */
|
||||
{ RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */
|
||||
{ RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */
|
||||
{ RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */
|
||||
{ RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */
|
||||
{ RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */
|
||||
{ RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */
|
||||
{ RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */
|
||||
{ RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */
|
||||
{ RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */
|
||||
{ RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */
|
||||
{ RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */
|
||||
{ RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */
|
||||
{ RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */
|
||||
{ RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */
|
||||
{ RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS34 */
|
||||
{ RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK34 */
|
||||
{ RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */
|
||||
{ RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */
|
||||
{ RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */
|
||||
{ RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */
|
||||
{ RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */
|
||||
{ RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */
|
||||
{ RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */
|
||||
{ RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */
|
||||
{ RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */
|
||||
{ RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */
|
||||
{ RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */
|
||||
{ RCAR_GP_PIN(6, 24), PU5, 31 }, /* USB0_PWEN */
|
||||
{ RCAR_GP_PIN(6, 23), PU5, 30 }, /* AUDIO_CLKB_B */
|
||||
{ RCAR_GP_PIN(6, 22), PU5, 29 }, /* AUDIO_CLKA_A */
|
||||
{ RCAR_GP_PIN(6, 21), PU5, 28 }, /* SSI_SDATA9_A */
|
||||
{ RCAR_GP_PIN(6, 20), PU5, 27 }, /* SSI_SDATA8 */
|
||||
{ RCAR_GP_PIN(6, 19), PU5, 26 }, /* SSI_SDATA7 */
|
||||
{ RCAR_GP_PIN(6, 18), PU5, 25 }, /* SSI_WS78 */
|
||||
{ RCAR_GP_PIN(6, 17), PU5, 24 }, /* SSI_SCK78 */
|
||||
{ RCAR_GP_PIN(6, 16), PU5, 23 }, /* SSI_SDATA6 */
|
||||
{ RCAR_GP_PIN(6, 15), PU5, 22 }, /* SSI_WS6 */
|
||||
{ RCAR_GP_PIN(6, 14), PU5, 21 }, /* SSI_SCK6 */
|
||||
{ RCAR_GP_PIN(6, 13), PU5, 20 }, /* SSI_SDATA5 */
|
||||
{ RCAR_GP_PIN(6, 12), PU5, 19 }, /* SSI_WS5 */
|
||||
{ RCAR_GP_PIN(6, 11), PU5, 18 }, /* SSI_SCK5 */
|
||||
{ RCAR_GP_PIN(6, 10), PU5, 17 }, /* SSI_SDATA4 */
|
||||
{ RCAR_GP_PIN(6, 9), PU5, 16 }, /* SSI_WS4 */
|
||||
{ RCAR_GP_PIN(6, 8), PU5, 15 }, /* SSI_SCK4 */
|
||||
{ RCAR_GP_PIN(6, 7), PU5, 14 }, /* SSI_SDATA3 */
|
||||
{ RCAR_GP_PIN(6, 6), PU5, 13 }, /* SSI_WS34 */
|
||||
{ RCAR_GP_PIN(6, 5), PU5, 12 }, /* SSI_SCK34 */
|
||||
{ RCAR_GP_PIN(6, 4), PU5, 11 }, /* SSI_SDATA2_A */
|
||||
{ RCAR_GP_PIN(6, 3), PU5, 10 }, /* SSI_SDATA1_A */
|
||||
{ RCAR_GP_PIN(6, 2), PU5, 9 }, /* SSI_SDATA0 */
|
||||
{ RCAR_GP_PIN(6, 1), PU5, 8 }, /* SSI_WS01239 */
|
||||
{ RCAR_GP_PIN(6, 0), PU5, 7 }, /* SSI_SCK01239 */
|
||||
{ PIN_NUMBER('H', 37), PU5, 6 }, /* MLB_REF */
|
||||
{ RCAR_GP_PIN(5, 25), PU5, 5 }, /* MLB_DAT */
|
||||
{ RCAR_GP_PIN(5, 24), PU5, 4 }, /* MLB_SIG */
|
||||
{ RCAR_GP_PIN(5, 23), PU5, 3 }, /* MLB_CLK */
|
||||
{ RCAR_GP_PIN(5, 22), PU5, 2 }, /* MSIOF0_RXD */
|
||||
{ RCAR_GP_PIN(5, 21), PU5, 1 }, /* MSIOF0_SS2 */
|
||||
{ RCAR_GP_PIN(5, 20), PU5, 0 }, /* MSIOF0_TXD */
|
||||
|
||||
{ RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB31_OVC */
|
||||
{ RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB31_PWEN */
|
||||
{ RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */
|
||||
{ RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */
|
||||
{ RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */
|
||||
{ RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */
|
||||
{ RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */
|
||||
{ RCAR_GP_PIN(6, 31), PU6, 6 }, /* USB31_OVC */
|
||||
{ RCAR_GP_PIN(6, 30), PU6, 5 }, /* USB31_PWEN */
|
||||
{ RCAR_GP_PIN(6, 29), PU6, 4 }, /* USB30_OVC */
|
||||
{ RCAR_GP_PIN(6, 28), PU6, 3 }, /* USB30_PWEN */
|
||||
{ RCAR_GP_PIN(6, 27), PU6, 2 }, /* USB1_OVC */
|
||||
{ RCAR_GP_PIN(6, 26), PU6, 1 }, /* USB1_PWEN */
|
||||
{ RCAR_GP_PIN(6, 25), PU6, 0 }, /* USB0_OVC */
|
||||
};
|
||||
|
||||
static unsigned int r8a7795_pinmux_get_bias(struct sh_pfc *pfc,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -816,6 +816,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
|
|||
pmx->pctl_desc.pins = pmx->pins;
|
||||
pmx->pctl_desc.npins = pfc->info->nr_pins;
|
||||
|
||||
pmx->pctl = devm_pinctrl_register(pfc->dev, &pmx->pctl_desc, pmx);
|
||||
return PTR_ERR_OR_ZERO(pmx->pctl);
|
||||
return devm_pinctrl_register_and_init(pfc->dev, &pmx->pctl_desc, pmx,
|
||||
&pmx->pctl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5322,7 +5322,8 @@ static int atlas7_pin_config_set(struct pinctrl_dev *pctldev,
|
|||
unsigned pin, unsigned long *configs,
|
||||
unsigned num_configs)
|
||||
{
|
||||
u16 param, arg;
|
||||
u16 param;
|
||||
u32 arg;
|
||||
int idx, err;
|
||||
|
||||
for (idx = 0; idx < num_configs; idx++) {
|
||||
|
|
@ -5420,14 +5421,15 @@ static int atlas7_pinmux_probe(struct platform_device *pdev)
|
|||
sys2pci_np = of_find_node_by_name(NULL, "sys2pci");
|
||||
if (!sys2pci_np)
|
||||
return -EINVAL;
|
||||
|
||||
ret = of_address_to_resource(sys2pci_np, 0, &res);
|
||||
of_node_put(sys2pci_np);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pmx->sys2pci_base = devm_ioremap_resource(&pdev->dev, &res);
|
||||
if (IS_ERR(pmx->sys2pci_base)) {
|
||||
of_node_put(sys2pci_np);
|
||||
if (IS_ERR(pmx->sys2pci_base))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pmx->dev = &pdev->dev;
|
||||
|
||||
|
|
@ -5443,7 +5445,7 @@ static int atlas7_pinmux_probe(struct platform_device *pdev)
|
|||
pmx->regs[idx] = of_iomap(np, idx);
|
||||
if (!pmx->regs[idx]) {
|
||||
dev_err(&pdev->dev,
|
||||
"can't map ioc bank#%d registers\n", idx);
|
||||
"can't map ioc bank#%d registers\n", idx);
|
||||
ret = -ENOMEM;
|
||||
goto unmap_io;
|
||||
}
|
||||
|
|
@ -6056,8 +6058,8 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
|
|||
ret = gpiochip_add_data(chip, a7gc);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev,
|
||||
"%s: error in probe function with status %d\n",
|
||||
np->name, ret);
|
||||
"%s: error in probe function with status %d\n",
|
||||
np->name, ret);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
|
@ -705,7 +705,6 @@ static const struct of_device_id plgpio_of_match[] = {
|
|||
{ .compatible = "st,spear-plgpio" },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, plgpio_of_match);
|
||||
|
||||
static struct platform_driver plgpio_driver = {
|
||||
.probe = plgpio_probe,
|
||||
|
|
@ -721,7 +720,3 @@ static int __init plgpio_init(void)
|
|||
return platform_driver_register(&plgpio_driver);
|
||||
}
|
||||
subsys_initcall(plgpio_init);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "pinctrl-spear.h"
|
||||
|
|
@ -2717,14 +2716,3 @@ static int __init spear1310_pinctrl_init(void)
|
|||
return platform_driver_register(&spear1310_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(spear1310_pinctrl_init);
|
||||
|
||||
static void __exit spear1310_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&spear1310_pinctrl_driver);
|
||||
}
|
||||
module_exit(spear1310_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "pinctrl-spear.h"
|
||||
|
|
@ -2033,14 +2032,3 @@ static int __init spear1340_pinctrl_init(void)
|
|||
return platform_driver_register(&spear1340_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(spear1340_pinctrl_init);
|
||||
|
||||
static void __exit spear1340_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&spear1340_pinctrl_driver);
|
||||
}
|
||||
module_exit(spear1340_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "pinctrl-spear3xx.h"
|
||||
|
|
@ -690,14 +689,3 @@ static int __init spear300_pinctrl_init(void)
|
|||
return platform_driver_register(&spear300_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(spear300_pinctrl_init);
|
||||
|
||||
static void __exit spear300_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&spear300_pinctrl_driver);
|
||||
}
|
||||
module_exit(spear300_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "pinctrl-spear3xx.h"
|
||||
|
|
@ -413,14 +412,3 @@ static int __init spear310_pinctrl_init(void)
|
|||
return platform_driver_register(&spear310_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(spear310_pinctrl_init);
|
||||
|
||||
static void __exit spear310_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&spear310_pinctrl_driver);
|
||||
}
|
||||
module_exit(spear310_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(of, spear310_pinctrl_of_match);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "pinctrl-spear3xx.h"
|
||||
|
|
@ -3454,14 +3453,3 @@ static int __init spear320_pinctrl_init(void)
|
|||
return platform_driver_register(&spear320_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(spear320_pinctrl_init);
|
||||
|
||||
static void __exit spear320_pinctrl_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&spear320_pinctrl_driver);
|
||||
}
|
||||
module_exit(spear320_pinctrl_exit);
|
||||
|
||||
MODULE_AUTHOR("Viresh Kumar <[email protected]>");
|
||||
MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
|
||||
|
|
|
|||
|
|
@ -20,4 +20,9 @@ config PINCTRL_STM32F746
|
|||
default MACH_STM32F746
|
||||
select PINCTRL_STM32
|
||||
|
||||
config PINCTRL_STM32H743
|
||||
bool "STMicroelectronics STM32H743 pin control" if COMPILE_TEST && !MACH_STM32H743
|
||||
depends on OF && IRQ_DOMAIN_HIERARCHY
|
||||
default MACH_STM32H743
|
||||
select PINCTRL_STM32
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ obj-$(CONFIG_PINCTRL_STM32) += pinctrl-stm32.o
|
|||
# SoC Drivers
|
||||
obj-$(CONFIG_PINCTRL_STM32F429) += pinctrl-stm32f429.o
|
||||
obj-$(CONFIG_PINCTRL_STM32F746) += pinctrl-stm32f746.o
|
||||
obj-$(CONFIG_PINCTRL_STM32H743) += pinctrl-stm32h743.o
|
||||
|
|
|
|||
|
|
@ -236,6 +236,15 @@ static void stm32_gpio_domain_activate(struct irq_domain *d,
|
|||
struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent);
|
||||
|
||||
regmap_field_write(pctl->irqmux[irq_data->hwirq], bank->range.id);
|
||||
gpiochip_lock_as_irq(&bank->gpio_chip, irq_data->hwirq);
|
||||
}
|
||||
|
||||
static void stm32_gpio_domain_deactivate(struct irq_domain *d,
|
||||
struct irq_data *irq_data)
|
||||
{
|
||||
struct stm32_gpio_bank *bank = d->host_data;
|
||||
|
||||
gpiochip_unlock_as_irq(&bank->gpio_chip, irq_data->hwirq);
|
||||
}
|
||||
|
||||
static int stm32_gpio_domain_alloc(struct irq_domain *d,
|
||||
|
|
@ -243,11 +252,9 @@ static int stm32_gpio_domain_alloc(struct irq_domain *d,
|
|||
unsigned int nr_irqs, void *data)
|
||||
{
|
||||
struct stm32_gpio_bank *bank = d->host_data;
|
||||
struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent);
|
||||
struct irq_fwspec *fwspec = data;
|
||||
struct irq_fwspec parent_fwspec;
|
||||
irq_hw_number_t hwirq;
|
||||
int ret;
|
||||
|
||||
hwirq = fwspec->param[0];
|
||||
parent_fwspec.fwnode = d->parent->fwnode;
|
||||
|
|
@ -258,35 +265,15 @@ static int stm32_gpio_domain_alloc(struct irq_domain *d,
|
|||
irq_domain_set_hwirq_and_chip(d, virq, hwirq, &stm32_gpio_irq_chip,
|
||||
bank);
|
||||
|
||||
ret = gpiochip_lock_as_irq(&bank->gpio_chip, hwirq);
|
||||
if (ret) {
|
||||
dev_err(pctl->dev, "Unable to configure STM32 %s%ld as IRQ\n",
|
||||
bank->gpio_chip.label, hwirq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = irq_domain_alloc_irqs_parent(d, virq, nr_irqs, &parent_fwspec);
|
||||
if (ret)
|
||||
gpiochip_unlock_as_irq(&bank->gpio_chip, hwirq);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void stm32_gpio_domain_free(struct irq_domain *d, unsigned int virq,
|
||||
unsigned int nr_irqs)
|
||||
{
|
||||
struct stm32_gpio_bank *bank = d->host_data;
|
||||
struct irq_data *data = irq_get_irq_data(virq);
|
||||
|
||||
irq_domain_free_irqs_common(d, virq, nr_irqs);
|
||||
gpiochip_unlock_as_irq(&bank->gpio_chip, data->hwirq);
|
||||
return irq_domain_alloc_irqs_parent(d, virq, nr_irqs, &parent_fwspec);
|
||||
}
|
||||
|
||||
static const struct irq_domain_ops stm32_gpio_domain_ops = {
|
||||
.translate = stm32_gpio_domain_translate,
|
||||
.alloc = stm32_gpio_domain_alloc,
|
||||
.free = stm32_gpio_domain_free,
|
||||
.free = irq_domain_free_irqs_common,
|
||||
.activate = stm32_gpio_domain_activate,
|
||||
.deactivate = stm32_gpio_domain_deactivate,
|
||||
};
|
||||
|
||||
/* Pinctrl functions */
|
||||
|
|
@ -631,6 +618,7 @@ static const struct pinmux_ops stm32_pmx_ops = {
|
|||
.get_function_groups = stm32_pmx_get_func_groups,
|
||||
.set_mux = stm32_pmx_set_mux,
|
||||
.gpio_set_direction = stm32_pmx_gpio_set_direction,
|
||||
.strict = true,
|
||||
};
|
||||
|
||||
/* Pinconf functions */
|
||||
|
|
|
|||
1980
drivers/pinctrl/stm32/pinctrl-stm32h743.c
Normal file
1980
drivers/pinctrl/stm32/pinctrl-stm32h743.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -9,26 +9,14 @@ config PINCTRL_SUN4I_A10
|
|||
def_bool MACH_SUN4I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN5I_A10S
|
||||
config PINCTRL_SUN5I
|
||||
def_bool MACH_SUN5I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN5I_A13
|
||||
def_bool MACH_SUN5I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_GR8
|
||||
def_bool MACH_SUN5I
|
||||
select PINCTRL_SUNXI_COMMON
|
||||
|
||||
config PINCTRL_SUN6I_A31
|
||||
def_bool MACH_SUN6I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN6I_A31S
|
||||
def_bool MACH_SUN6I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN6I_A31_R
|
||||
def_bool MACH_SUN6I
|
||||
depends on RESET_CONTROLLER
|
||||
|
|
@ -63,6 +51,10 @@ config PINCTRL_SUN8I_H3_R
|
|||
def_bool MACH_SUN8I
|
||||
select PINCTRL_SUNXI_COMMON
|
||||
|
||||
config PINCTRL_SUN8I_V3S
|
||||
def_bool MACH_SUN8I
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN9I_A80
|
||||
def_bool MACH_SUN9I
|
||||
select PINCTRL_SUNXI
|
||||
|
|
@ -76,4 +68,8 @@ config PINCTRL_SUN50I_A64
|
|||
bool
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
config PINCTRL_SUN50I_H5
|
||||
bool
|
||||
select PINCTRL_SUNXI
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -3,11 +3,8 @@ obj-y += pinctrl-sunxi.o
|
|||
|
||||
# SoC Drivers
|
||||
obj-$(CONFIG_PINCTRL_SUN4I_A10) += pinctrl-sun4i-a10.o
|
||||
obj-$(CONFIG_PINCTRL_SUN5I_A10S) += pinctrl-sun5i-a10s.o
|
||||
obj-$(CONFIG_PINCTRL_SUN5I_A13) += pinctrl-sun5i-a13.o
|
||||
obj-$(CONFIG_PINCTRL_GR8) += pinctrl-gr8.o
|
||||
obj-$(CONFIG_PINCTRL_SUN5I) += pinctrl-sun5i.o
|
||||
obj-$(CONFIG_PINCTRL_SUN6I_A31) += pinctrl-sun6i-a31.o
|
||||
obj-$(CONFIG_PINCTRL_SUN6I_A31S) += pinctrl-sun6i-a31s.o
|
||||
obj-$(CONFIG_PINCTRL_SUN6I_A31_R) += pinctrl-sun6i-a31-r.o
|
||||
obj-$(CONFIG_PINCTRL_SUN7I_A20) += pinctrl-sun7i-a20.o
|
||||
obj-$(CONFIG_PINCTRL_SUN8I_A23) += pinctrl-sun8i-a23.o
|
||||
|
|
@ -17,5 +14,7 @@ obj-$(CONFIG_PINCTRL_SUN50I_A64) += pinctrl-sun50i-a64.o
|
|||
obj-$(CONFIG_PINCTRL_SUN8I_A83T) += pinctrl-sun8i-a83t.o
|
||||
obj-$(CONFIG_PINCTRL_SUN8I_H3) += pinctrl-sun8i-h3.o
|
||||
obj-$(CONFIG_PINCTRL_SUN8I_H3_R) += pinctrl-sun8i-h3-r.o
|
||||
obj-$(CONFIG_PINCTRL_SUN8I_V3S) += pinctrl-sun8i-v3s.o
|
||||
obj-$(CONFIG_PINCTRL_SUN50I_H5) += pinctrl-sun50i-h5.o
|
||||
obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o
|
||||
obj-$(CONFIG_PINCTRL_SUN9I_A80_R) += pinctrl-sun9i-a80-r.o
|
||||
|
|
|
|||
|
|
@ -1,536 +0,0 @@
|
|||
/*
|
||||
* NextThing GR8 SoCs pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2016 Mylene Josserand
|
||||
*
|
||||
* Based on pinctrl-sun5i-a13.c
|
||||
*
|
||||
* Mylene Josserand <mylene.josserand@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun5i_gr8_pins[] = {
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm0"),
|
||||
SUNXI_FUNCTION(0x3, "spdif"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 16)), /* EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ir0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 17)), /* EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ir0"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 18)), /* EINT18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 19)), /* EINT19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* BCLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 20)), /* EINT20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* LRCK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 21)), /* EINT21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 22)), /* EINT22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DI */
|
||||
SUNXI_FUNCTION(0x3, "spdif"), /* DI */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 23)), /* EINT23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
|
||||
SUNXI_FUNCTION(0x3, "spdif"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* MS0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* CK0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 26)), /* EINT26 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DO0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 27)), /* EINT27 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DI0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 28)), /* EINT28 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCE1 */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* NRE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ4 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ5 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ6 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQS */
|
||||
SUNXI_FUNCTION(0x3, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION(0x4, "uart3")), /* RTS */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "uart2")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "uart2")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "uart2")), /* CTS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "uart2")), /* RTS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ECRS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ECOL */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXD0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXD1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXD2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXD3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXERR */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXDV */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXD0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D20 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXD1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D21 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXD2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D22 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXD3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D23 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXEN */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* DE */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ETXERR*/
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* EMDC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* EMDIO */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* PCLK */
|
||||
SUNXI_FUNCTION(0x4, "spi2"), /* CS0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 14)), /* EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* ERR */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x4, "spi2"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 15)), /* EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* SYNC */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x4, "spi2")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* DVLD */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x4, "spi2")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ts0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* RX */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* MS1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "uart0")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "uart0")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "gps"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 0)), /* EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "gps"), /* SIGN */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 1)), /* EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x2, "gps"), /* MAG */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 2)), /* EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* BS */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 3)), /* EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 4)), /* EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 5)), /* EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 6)), /* EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* D2 */
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 7)), /* EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "ms"), /* D3 */
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 8)), /* EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 9)), /* EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 10)), /* EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 11)), /* EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 12)), /* EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
|
||||
SUNXI_FUNCTION(0x3, "pwm1"),
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 13)), /* EINT13 */
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun5i_gr8_pinctrl_data = {
|
||||
.pins = sun5i_gr8_pins,
|
||||
.npins = ARRAY_SIZE(sun5i_gr8_pins),
|
||||
.irq_banks = 1,
|
||||
};
|
||||
|
||||
static int sun5i_gr8_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun5i_gr8_pinctrl_data);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun5i_gr8_pinctrl_match[] = {
|
||||
{ .compatible = "nextthing,gr8-pinctrl", },
|
||||
{}
|
||||
};
|
||||
|
||||
static struct platform_driver sun5i_gr8_pinctrl_driver = {
|
||||
.probe = sun5i_gr8_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "gr8-pinctrl",
|
||||
.of_match_table = sun5i_gr8_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun5i_gr8_pinctrl_driver);
|
||||
558
drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
Normal file
558
drivers/pinctrl/sunxi/pinctrl-sun50i-h5.c
Normal file
|
|
@ -0,0 +1,558 @@
|
|||
/*
|
||||
* Allwinner H5 SoC pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
|
||||
*
|
||||
* Based on pinctrl-sun8i-h3.c, which is:
|
||||
* Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
|
||||
*
|
||||
* Based on pinctrl-sun8i-a23.c, which is:
|
||||
* Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org>
|
||||
* Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun50i_h5_pins[] = {
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* TX */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* MS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* CK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* CTS */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DI */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0"), /* RX */
|
||||
SUNXI_FUNCTION(0x3, "pwm0"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "sim"), /* PWREN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "sim"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "sim"), /* DATA */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "sim"), /* RST */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "sim"), /* DET */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "di"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */
|
||||
SUNXI_FUNCTION(0x3, "di"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spdif"), /* OUT */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* SYNC */
|
||||
SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */
|
||||
SUNXI_FUNCTION(0x3, "sim"), /* VPPEN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */
|
||||
SUNXI_FUNCTION(0x3, "sim"), /* VPPPP */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* WE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* ALE */
|
||||
SUNXI_FUNCTION(0x3, "spi0"), /* MISO */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* DS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* CLE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* CE0 */
|
||||
SUNXI_FUNCTION(0x4, "spi0")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* RE */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQS */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* RST */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXD3 */
|
||||
SUNXI_FUNCTION(0x3, "di"), /* TX */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXD2 */
|
||||
SUNXI_FUNCTION(0x3, "di"), /* RX */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* ERR */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXD1 */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* SYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXD0 */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* DVLD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXCK */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXCTL/RXDV */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* RXERR */
|
||||
SUNXI_FUNCTION(0x4, "ts2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXD3 */
|
||||
SUNXI_FUNCTION(0x4, "ts2"), /* D3 */
|
||||
SUNXI_FUNCTION(0x5, "ts3")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXD2 */
|
||||
SUNXI_FUNCTION(0x4, "ts2"), /* D4 */
|
||||
SUNXI_FUNCTION(0x5, "ts3")), /* ERR */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXD1 */
|
||||
SUNXI_FUNCTION(0x4, "ts2"), /* D5 */
|
||||
SUNXI_FUNCTION(0x5, "ts3")), /* SYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXD0 */
|
||||
SUNXI_FUNCTION(0x4, "ts2"), /* D6 */
|
||||
SUNXI_FUNCTION(0x5, "ts3")), /* DVLD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* CRS */
|
||||
SUNXI_FUNCTION(0x4, "ts2"), /* D7 */
|
||||
SUNXI_FUNCTION(0x5, "ts3")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXCK */
|
||||
SUNXI_FUNCTION(0x4, "sim")), /* PWREN */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXCTL/TXEN */
|
||||
SUNXI_FUNCTION(0x4, "sim")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* TXERR */
|
||||
SUNXI_FUNCTION(0x4, "sim")), /* DATA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* CLKIN/COL */
|
||||
SUNXI_FUNCTION(0x4, "sim")), /* RST */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* MDC */
|
||||
SUNXI_FUNCTION(0x4, "sim")), /* DET */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac")), /* MDIO */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* ERR */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* SYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* DVLD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "ts0")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "ts1")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "ts1")), /* ERR */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "ts1")), /* SYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "ts1")), /* DVLD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "ts1")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* SDA */
|
||||
SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "sim")), /* VPPEN */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "sim")), /* VPPPP */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* MS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PF_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DI */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PF_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "uart0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PF_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PF_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "uart0"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PF_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* CK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PF_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PF_EINT6 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PG_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PG_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PG_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PG_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PG_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PG_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PG_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PG_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PG_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PG_EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s1"), /* SYNC */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PG_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s1"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PG_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), /* PG_EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PG_EINT13 */
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data = {
|
||||
.pins = sun50i_h5_pins,
|
||||
.npins = ARRAY_SIZE(sun50i_h5_pins),
|
||||
.irq_banks = 2,
|
||||
.irq_read_needs_mux = true
|
||||
};
|
||||
|
||||
static int sun50i_h5_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun50i_h5_pinctrl_data);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun50i_h5_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun50i-h5-pinctrl", },
|
||||
{}
|
||||
};
|
||||
|
||||
static struct platform_driver sun50i_h5_pinctrl_driver = {
|
||||
.probe = sun50i_h5_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "sun50i-h5-pinctrl",
|
||||
.of_match_table = sun50i_h5_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun50i_h5_pinctrl_driver);
|
||||
|
|
@ -1,403 +0,0 @@
|
|||
/*
|
||||
* Allwinner A13 SoCs pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2014 Maxime Ripard
|
||||
*
|
||||
* Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun5i_a13_pins[] = {
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm"),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 16)), /* EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ir0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 17)), /* EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ir0"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 18)), /* EINT18 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NWE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NALE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCE1 */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* NCE0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* NRE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NRB0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NRB1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ2 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ3 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ4 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ5 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ6 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQS */
|
||||
SUNXI_FUNCTION(0x4, "uart3")), /* RTS */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D7 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D15 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* DE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* HSYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* VSYNC */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* PCLK */
|
||||
SUNXI_FUNCTION(0x4, "spi2"), /* CS0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 14)), /* EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x4, "spi2"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 15)), /* EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x4, "spi2")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x4, "spi2")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "mmc2")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "csi0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* RX */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0")), /* D2 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 0)), /* EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 1)), /* EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 2)), /* EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 3)), /* EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 4)), /* EINT4 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 9)), /* EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 10)), /* EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 11)), /* EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 12)), /* EINT12 */
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun5i_a13_pinctrl_data = {
|
||||
.pins = sun5i_a13_pins,
|
||||
.npins = ARRAY_SIZE(sun5i_a13_pins),
|
||||
.irq_banks = 1,
|
||||
};
|
||||
|
||||
static int sun5i_a13_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun5i_a13_pinctrl_data);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun5i_a13_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun5i-a13-pinctrl", },
|
||||
{}
|
||||
};
|
||||
|
||||
static struct platform_driver sun5i_a13_pinctrl_driver = {
|
||||
.probe = sun5i_a13_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "sun5i-a13-pinctrl",
|
||||
.of_match_table = sun5i_a13_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun5i_a13_pinctrl_driver);
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
/*
|
||||
* Allwinner A10s SoCs pinctrl driver.
|
||||
* Allwinner sun5i SoCs pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2014 Maxime Ripard
|
||||
*
|
||||
* Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
* Copyright (C) 2014-2016 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
* Copyright (C) 2016 Mylene Josserand <mylene.josserand@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
|
|
@ -18,115 +17,133 @@
|
|||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
|
||||
static const struct sunxi_desc_pin sun5i_pins[] = {
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 0),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXD3 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 1),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXD2 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* ERR */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 2),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXD1 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* SYNC */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 3),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXD0 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* DLVD */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 4),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXD3 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 5),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXD2 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 6),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXD1 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 7),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXD0 */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* IN7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 8),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXCK */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 9),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXERR */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 10),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ERXDV */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 11),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* EMDC */
|
||||
SUNXI_FUNCTION(0x3, "ts0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RING */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 12),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* EMDIO */
|
||||
SUNXI_FUNCTION(0x3, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 13),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXEN */
|
||||
SUNXI_FUNCTION(0x3, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 14),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXCK */
|
||||
SUNXI_FUNCTION(0x3, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION(0x4, "uart3"), /* TX */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 15),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ECRS */
|
||||
SUNXI_FUNCTION(0x3, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION(0x4, "uart3"), /* RX */
|
||||
SUNXI_FUNCTION(0x5, "keypad")), /* OUT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 16),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ECOL */
|
||||
SUNXI_FUNCTION(0x3, "uart2")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(A, 17),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "emac"), /* ETXERR */
|
||||
|
|
@ -145,6 +162,9 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm"), /* PWM0 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3,
|
||||
"spdif", /* DO */
|
||||
PINCTRL_SUN5I_GR8),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 16)), /* EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
|
|
@ -156,55 +176,70 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "ir0"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 18)), /* EINT18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 5),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s"), /* MCLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 19)), /* EINT19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 6),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s"), /* BCLK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 20)), /* EINT20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 7),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s"), /* LRCK */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 21)), /* EINT21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 8),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s"), /* DO */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 22)), /* EINT22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 9),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s"), /* DI */
|
||||
SUNXI_FUNCTION_VARIANT(0x3,
|
||||
"spdif", /* DI */
|
||||
PINCTRL_SUN5I_GR8),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 23)), /* EINT23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS1 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3,
|
||||
"spdif", /* DO */
|
||||
PINCTRL_SUN5I_GR8),
|
||||
SUNXI_FUNCTION_IRQ(0x6, 24)), /* EINT24 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 11),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 11),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* MS0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 25)), /* EINT25 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 12),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 12),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* CK0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 26)), /* EINT26 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 13),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DO0 */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 27)), /* EINT27 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 14),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
|
||||
|
|
@ -226,12 +261,14 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 19),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 19),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 29)), /* EINT29 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 20),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(B, 20),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0"), /* RX */
|
||||
|
|
@ -251,7 +288,7 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCLE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
|
|
@ -315,17 +352,20 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NDQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 16),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NWP */
|
||||
SUNXI_FUNCTION(0x4, "uart3")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 17),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCE2 */
|
||||
SUNXI_FUNCTION(0x4, "uart3")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 18),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* NCE3 */
|
||||
|
|
@ -338,11 +378,13 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x3, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION(0x4, "uart3")), /* RTS */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 0),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 1),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D1 */
|
||||
|
|
@ -376,11 +418,13 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ECOL */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 8),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 9),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D9 */
|
||||
|
|
@ -414,11 +458,13 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
|
||||
SUNXI_FUNCTION(0x3, "emac")), /* ERXERR */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 16),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(D, 17),
|
||||
PINCTRL_SUN5I_A10S,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D17 */
|
||||
|
|
@ -600,26 +646,30 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 4)), /* EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 5),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* DO */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 5)), /* EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 6),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 6)), /* EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 7),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
|
||||
SUNXI_FUNCTION(0x5, "uart2"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 7)), /* EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 8),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
|
||||
|
|
@ -649,7 +699,8 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ(0x6, 12)), /* EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(G, 13),
|
||||
PINCTRL_SUN5I_A10S | PINCTRL_SUN5I_GR8,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
|
||||
|
|
@ -658,28 +709,41 @@ static const struct sunxi_desc_pin sun5i_a10s_pins[] = {
|
|||
SUNXI_FUNCTION_IRQ(0x6, 13)), /* EINT13 */
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun5i_a10s_pinctrl_data = {
|
||||
.pins = sun5i_a10s_pins,
|
||||
.npins = ARRAY_SIZE(sun5i_a10s_pins),
|
||||
static const struct sunxi_pinctrl_desc sun5i_pinctrl_data = {
|
||||
.pins = sun5i_pins,
|
||||
.npins = ARRAY_SIZE(sun5i_pins),
|
||||
.irq_banks = 1,
|
||||
};
|
||||
|
||||
static int sun5i_a10s_pinctrl_probe(struct platform_device *pdev)
|
||||
static int sun5i_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun5i_a10s_pinctrl_data);
|
||||
unsigned long variant = (unsigned long)of_device_get_match_data(&pdev->dev);
|
||||
|
||||
return sunxi_pinctrl_init_with_variant(pdev, &sun5i_pinctrl_data,
|
||||
variant);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun5i_a10s_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun5i-a10s-pinctrl", },
|
||||
{}
|
||||
static const struct of_device_id sun5i_pinctrl_match[] = {
|
||||
{
|
||||
.compatible = "allwinner,sun5i-a10s-pinctrl",
|
||||
.data = (void *)PINCTRL_SUN5I_A10S
|
||||
},
|
||||
{
|
||||
.compatible = "allwinner,sun5i-a13-pinctrl",
|
||||
.data = (void *)PINCTRL_SUN5I_A13
|
||||
},
|
||||
{
|
||||
.compatible = "nextthing,gr8-pinctrl",
|
||||
.data = (void *)PINCTRL_SUN5I_GR8
|
||||
},
|
||||
{ },
|
||||
};
|
||||
|
||||
static struct platform_driver sun5i_a10s_pinctrl_driver = {
|
||||
.probe = sun5i_a10s_pinctrl_probe,
|
||||
static struct platform_driver sun5i_pinctrl_driver = {
|
||||
.probe = sun5i_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "sun5i-a10s-pinctrl",
|
||||
.of_match_table = sun5i_a10s_pinctrl_match,
|
||||
.name = "sun5i-pinctrl",
|
||||
.of_match_table = sun5i_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun5i_a10s_pinctrl_driver);
|
||||
builtin_platform_driver(sun5i_pinctrl_driver);
|
||||
|
|
@ -23,69 +23,79 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD0 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D0 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD1 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D1 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD2 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D2 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD3 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D3 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RING */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD4 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D4 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD5 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D5 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD6 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D6 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD7 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D7 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXCLK */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D8 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D8 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXEN */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D9 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D9 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* CMD */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* CMD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */
|
||||
|
|
@ -93,7 +103,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* GTXCLK */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D10 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D10 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* CLK */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */
|
||||
|
|
@ -101,7 +112,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD0 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D11 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D11 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D0 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */
|
||||
|
|
@ -109,7 +121,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD1 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D12 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D12 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D1 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */
|
||||
|
|
@ -117,7 +130,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD2 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D13 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D13 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D2 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */
|
||||
|
|
@ -125,7 +139,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD3 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D14 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D14 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D3 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */
|
||||
|
|
@ -133,91 +148,104 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD4 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D15 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D15 */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_a"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD5 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D16 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D16 */
|
||||
SUNXI_FUNCTION(0x4, "dmic"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD6 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D17 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D17 */
|
||||
SUNXI_FUNCTION(0x4, "dmic"), /* DIN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD7 */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D18 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D18 */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_b"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXDV */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D19 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D19 */
|
||||
SUNXI_FUNCTION(0x4, "pwm3"), /* Positive */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXCLK */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D20 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D20 */
|
||||
SUNXI_FUNCTION(0x4, "pwm3"), /* Negative */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXERR */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D21 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D21 */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CS0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXERR */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D22 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D22 */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 22)), /* PA_EINT22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* COL */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* D23 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* D23 */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* MOSI */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 23)), /* PA_EINT23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* CRS */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* CLK */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* MISO */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 24)), /* PA_EINT24 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* CLKIN */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* DE */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* DE */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CS1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 25)), /* PA_EINT25 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* MDC */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* HSYNC */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_c"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 26)), /* PA_EINT26 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* MDIO */
|
||||
SUNXI_FUNCTION(0x3, "lcd1"), /* VSYNC */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lcd1",
|
||||
PINCTRL_SUN6I_A31), /* VSYNC */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 27)), /* PA_EINT27 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
|
||||
|
|
@ -225,7 +253,8 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
|
||||
SUNXI_FUNCTION(0x4, "csi"), /* MCLK1 */
|
||||
SUNXI_FUNCTION_VARIANT(0x4, "csi",
|
||||
PINCTRL_SUN6I_A31), /* MCLK1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PB_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
|
|
@ -355,42 +384,43 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
|
||||
/* Hole in pin numbering for A31s */
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 16), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ8 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 17),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 17), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ9 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 18),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 18), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ10 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 19),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 19), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ11 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 20),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 20), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ12 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 21),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 21), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ13 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 22),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 22), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ14 */
|
||||
SUNXI_FUNCTION(0x3, "nand1")), /* DQ6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 23),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(C, 23), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ15 */
|
||||
|
|
@ -468,52 +498,62 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D10 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VP0 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VP0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D11 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VN0 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VN0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D12 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VP1 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VP1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D13 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VN1 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VN1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D14 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VP2 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VP2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D15 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VN2 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VN2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D16 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VPC */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VPC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D17 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VNC */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D18 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VP3 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VP3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D19 */
|
||||
SUNXI_FUNCTION(0x3, "lvds1")), /* VN3 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "lvds1",
|
||||
PINCTRL_SUN6I_A31)), /* VN3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
|
|
@ -643,7 +683,7 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x2, "csi"), /* D11 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D7 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)), /* PE_EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(E, 16), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* MIPI CSI MCLK */
|
||||
|
|
@ -734,13 +774,15 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c3"), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "usb"), /* DP3 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "usb",
|
||||
PINCTRL_SUN6I_A31), /* DP3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)), /* PG_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c3"), /* SDA */
|
||||
SUNXI_FUNCTION(0x3, "usb"), /* DM3 */
|
||||
SUNXI_FUNCTION_VARIANT(0x3, "usb",
|
||||
PINCTRL_SUN6I_A31), /* DM3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)), /* PG_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
|
|
@ -782,40 +824,40 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart4"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 18)), /* PG_EINT18 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
|
||||
/* Hole; H starts at pin 9 for A31s */
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 0), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* WE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 1), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* ALE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 2), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* CLE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 3), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* CE1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 4), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* CE0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 5), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* RE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 6), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* RB0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 7), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* RB1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 8), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* DQS */
|
||||
|
|
@ -908,11 +950,12 @@ static const struct sunxi_desc_pin sun6i_a31_pins[] = {
|
|||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
/* Undocumented mux function - see above */
|
||||
SUNXI_FUNCTION(0x3, "spdif")), /* SPDIF OUT */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 29),
|
||||
/* 2 extra pins for A31 */
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 29), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* CE2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 30),
|
||||
SUNXI_PIN_VARIANT(SUNXI_PINCTRL_PIN(H, 30), PINCTRL_SUN6I_A31,
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand1")), /* CE3 */
|
||||
|
|
@ -926,12 +969,23 @@ static const struct sunxi_pinctrl_desc sun6i_a31_pinctrl_data = {
|
|||
|
||||
static int sun6i_a31_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun6i_a31_pinctrl_data);
|
||||
unsigned long variant =
|
||||
(unsigned long)of_device_get_match_data(&pdev->dev);
|
||||
|
||||
return sunxi_pinctrl_init_with_variant(pdev,
|
||||
&sun6i_a31_pinctrl_data,
|
||||
variant);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun6i_a31_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun6i-a31-pinctrl", },
|
||||
{
|
||||
.compatible = "allwinner,sun6i-a31-pinctrl",
|
||||
.data = (void *)PINCTRL_SUN6I_A31
|
||||
},
|
||||
{
|
||||
.compatible = "allwinner,sun6i-a31s-pinctrl",
|
||||
.data = (void *)PINCTRL_SUN6I_A31S
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,809 +0,0 @@
|
|||
/*
|
||||
* Allwinner A31s SoCs pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2014 Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* Based on pinctrl-sun6i-a31.c, which is:
|
||||
* Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun6i_a31s_pins[] = {
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD0 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DTR */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD1 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DSR */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD2 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* DCD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD3 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RING */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD4 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD5 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD6 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXD7 */
|
||||
SUNXI_FUNCTION(0x4, "uart1"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXCLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXEN */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* CMD */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* CMD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* GTXCLK */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* CLK */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD0 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D0 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD1 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D1 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD2 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D2 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD3 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3"), /* D3 */
|
||||
SUNXI_FUNCTION(0x5, "mmc2"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD4 */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_a"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD5 */
|
||||
SUNXI_FUNCTION(0x4, "dmic"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD6 */
|
||||
SUNXI_FUNCTION(0x4, "dmic"), /* DIN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXD7 */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_b"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXDV */
|
||||
SUNXI_FUNCTION(0x4, "pwm3"), /* Positive */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXCLK */
|
||||
SUNXI_FUNCTION(0x4, "pwm3"), /* Negative */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* TXERR */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CS0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* RXERR */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 22)), /* PA_EINT22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* COL */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* MOSI */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 23)), /* PA_EINT23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* CRS */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* MISO */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 24)), /* PA_EINT24 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* CLKIN */
|
||||
SUNXI_FUNCTION(0x4, "spi3"), /* CS1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 25)), /* PA_EINT25 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* MDC */
|
||||
SUNXI_FUNCTION(0x4, "clk_out_c"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 26)), /* PA_EINT26 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "gmac"), /* MDIO */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 27)), /* PA_EINT27 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PB_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* BCLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PB_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* LRCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PB_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DO0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PB_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DO1 */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PB_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DO2 */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* TX */
|
||||
SUNXI_FUNCTION(0x4, "i2c3"), /* SCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PB_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2s0"), /* DO3 */
|
||||
SUNXI_FUNCTION(0x3, "uart3"), /* RX */
|
||||
SUNXI_FUNCTION(0x4, "i2c3"), /* SDA */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PB_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "i2s0"), /* DI */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 7)), /* PB_EINT7 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* WE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* ALE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* CLE */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* CE1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* RE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* CMD */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* CMD */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* RB1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D4 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D5 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D6 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* D7 */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* D7 */
|
||||
/* Hole in pin numbering ! */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0"), /* DQS */
|
||||
SUNXI_FUNCTION(0x3, "mmc2"), /* RST */
|
||||
SUNXI_FUNCTION(0x4, "mmc3")), /* RST */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* CE2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "nand0")), /* CE3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CS0 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VP0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VN0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VP1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VN1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VP2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VN2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VPC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D8 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VP3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0"), /* D9 */
|
||||
SUNXI_FUNCTION(0x3, "lvds0")), /* VN3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D22 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* D23 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* DE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* HSYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "lcd0")), /* VSYNC */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PE_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* ERR */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PE_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* SYNC */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PE_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* DVLD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PE_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "uart5"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PE_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "uart5"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PE_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "uart5"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PE_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "uart5"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PE_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PE_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PE_EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PE_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PE_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D8 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D4 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), /* PE_EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D9 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D5 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PE_EINT13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D10 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D6 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 14)), /* PE_EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D11 */
|
||||
SUNXI_FUNCTION(0x3, "ts"), /* D7 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)), /* PE_EINT15 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* MS1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* DI1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x4, "uart0")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* DO1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x4, "uart0")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x4, "jtag")), /* CK1 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)), /* PG_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)), /* PG_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)), /* PG_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 3)), /* PG_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)), /* PG_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)), /* PG_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)), /* PG_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)), /* PG_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)), /* PG_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* CTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)), /* PG_EINT9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c3"), /* SCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)), /* PG_EINT10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c3"), /* SDA */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 11)), /* PG_EINT11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS1 */
|
||||
SUNXI_FUNCTION(0x3, "i2s1"), /* MCLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 12)), /* PG_EINT12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "i2s1"), /* BCLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 13)), /* PG_EINT13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "i2s1"), /* LRCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 14)), /* PG_EINT14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "i2s1"), /* DIN */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 15)), /* PG_EINT15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi1"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "i2s1"), /* DOUT */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 16)), /* PG_EINT16 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart4"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 17)), /* PG_EINT17 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart4"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 18)), /* PG_EINT18 */
|
||||
/* Hole, note H starts at pin 9 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CS0 */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* MS0 */
|
||||
SUNXI_FUNCTION(0x4, "pwm1")), /* Positive */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* CK0 */
|
||||
SUNXI_FUNCTION(0x4, "pwm1")), /* Negative */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MOSI */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DO0 */
|
||||
SUNXI_FUNCTION(0x4, "pwm2")), /* Positive */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "spi2"), /* MISO */
|
||||
SUNXI_FUNCTION(0x3, "jtag"), /* DI0 */
|
||||
SUNXI_FUNCTION(0x4, "pwm2")), /* Negative */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm0")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SCK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c2")), /* SDA */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart0")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 25),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 26),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 27),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 28),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun6i_a31s_pinctrl_data = {
|
||||
.pins = sun6i_a31s_pins,
|
||||
.npins = ARRAY_SIZE(sun6i_a31s_pins),
|
||||
.irq_banks = 4,
|
||||
};
|
||||
|
||||
static int sun6i_a31s_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun6i_a31s_pinctrl_data);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun6i_a31s_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun6i-a31s-pinctrl", },
|
||||
{}
|
||||
};
|
||||
|
||||
static struct platform_driver sun6i_a31s_pinctrl_driver = {
|
||||
.probe = sun6i_a31s_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "sun6i-a31s-pinctrl",
|
||||
.of_match_table = sun6i_a31s_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun6i_a31s_pinctrl_driver);
|
||||
321
drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
Normal file
321
drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c
Normal file
|
|
@ -0,0 +1,321 @@
|
|||
/*
|
||||
* Allwinner V3s SoCs pinctrl driver.
|
||||
*
|
||||
* Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
|
||||
*
|
||||
* Based on pinctrl-sun8i-h3.c, which is:
|
||||
* Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
|
||||
*
|
||||
* Based on pinctrl-sun8i-a23.c, which is:
|
||||
* Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org>
|
||||
* Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
|
||||
#include "pinctrl-sunxi.h"
|
||||
|
||||
static const struct sunxi_desc_pin sun8i_v3s_pins[] = {
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PB_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PB_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* RTS */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PB_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "uart2"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PB_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm0"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PB_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "pwm1"),
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PB_EINT5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PB_EINT6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PB_EINT7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1"), /* SDA */
|
||||
SUNXI_FUNCTION(0x3, "uart0"), /* TX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PB_EINT8 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "i2c1"), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "uart0"), /* RX */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PB_EINT9 */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc2"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MISO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc2"), /* CMD */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc2"), /* RST */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* CS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc2"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* PCLK */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* CLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* MCLK */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* DE */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* HSYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* VSYNC */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D5 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D4 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D6 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D5 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D7 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D6 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D10 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D7 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D11 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D8 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D12 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D9 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D13 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D10 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D14 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D11 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D15 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 16),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D12 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D18 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 17),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D13 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D19 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D14 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D20 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* D15 */
|
||||
SUNXI_FUNCTION(0x3, "lcd")), /* D21 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 20),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* FIELD */
|
||||
SUNXI_FUNCTION(0x3, "csi_mipi")), /* MCLK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 21),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* SCK */
|
||||
SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 22),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "csi"), /* SDA */
|
||||
SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 23),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "lcd"), /* D22 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* RTS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 24),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x3, "lcd"), /* D23 */
|
||||
SUNXI_FUNCTION(0x4, "uart1")), /* CTS */
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */
|
||||
SUNXI_FUNCTION(0x3, "jtag")), /* MS */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */
|
||||
SUNXI_FUNCTION(0x3, "jtag")), /* DI */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */
|
||||
SUNXI_FUNCTION(0x3, "uart0")), /* TX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */
|
||||
SUNXI_FUNCTION(0x3, "jtag")), /* DO */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */
|
||||
SUNXI_FUNCTION(0x3, "uart0")), /* RX */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */
|
||||
SUNXI_FUNCTION(0x3, "jtag")), /* CK */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out")),
|
||||
/* Hole */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PG_EINT0 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PG_EINT1 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PG_EINT2 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PG_EINT3 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PG_EINT4 */
|
||||
SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
|
||||
SUNXI_FUNCTION(0x0, "gpio_in"),
|
||||
SUNXI_FUNCTION(0x1, "gpio_out"),
|
||||
SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */
|
||||
SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PG_EINT5 */
|
||||
};
|
||||
|
||||
static const struct sunxi_pinctrl_desc sun8i_v3s_pinctrl_data = {
|
||||
.pins = sun8i_v3s_pins,
|
||||
.npins = ARRAY_SIZE(sun8i_v3s_pins),
|
||||
.irq_banks = 2,
|
||||
.irq_read_needs_mux = true
|
||||
};
|
||||
|
||||
static int sun8i_v3s_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return sunxi_pinctrl_init(pdev,
|
||||
&sun8i_v3s_pinctrl_data);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun8i_v3s_pinctrl_match[] = {
|
||||
{ .compatible = "allwinner,sun8i-v3s-pinctrl", },
|
||||
{}
|
||||
};
|
||||
|
||||
static struct platform_driver sun8i_v3s_pinctrl_driver = {
|
||||
.probe = sun8i_v3s_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "sun8i-v3s-pinctrl",
|
||||
.of_match_table = sun8i_v3s_pinctrl_match,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(sun8i_v3s_pinctrl_driver);
|
||||
|
|
@ -540,7 +540,7 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
|
|||
enum pin_config_param param;
|
||||
unsigned long flags;
|
||||
u32 offset, shift, mask, reg;
|
||||
u16 arg, val;
|
||||
u32 arg, val;
|
||||
int ret;
|
||||
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
|
|
@ -1040,21 +1040,35 @@ static int sunxi_pinctrl_build_state(struct platform_device *pdev)
|
|||
struct sunxi_pinctrl *pctl = platform_get_drvdata(pdev);
|
||||
int i;
|
||||
|
||||
pctl->ngroups = pctl->desc->npins;
|
||||
/*
|
||||
* Allocate groups
|
||||
*
|
||||
* We assume that the number of groups is the number of pins
|
||||
* given in the data array.
|
||||
|
||||
/* Allocate groups */
|
||||
* This will not always be true, since some pins might not be
|
||||
* available in the current variant, but fortunately for us,
|
||||
* this means that the number of pins is the maximum group
|
||||
* number we will ever see.
|
||||
*/
|
||||
pctl->groups = devm_kzalloc(&pdev->dev,
|
||||
pctl->ngroups * sizeof(*pctl->groups),
|
||||
pctl->desc->npins * sizeof(*pctl->groups),
|
||||
GFP_KERNEL);
|
||||
if (!pctl->groups)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < pctl->desc->npins; i++) {
|
||||
const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
|
||||
struct sunxi_pinctrl_group *group = pctl->groups + i;
|
||||
struct sunxi_pinctrl_group *group = pctl->groups + pctl->ngroups;
|
||||
|
||||
if (pin->variant && !(pctl->variant & pin->variant))
|
||||
continue;
|
||||
|
||||
group->name = pin->pin.name;
|
||||
group->pin = pin->pin.number;
|
||||
|
||||
/* And now we count the actual number of pins / groups */
|
||||
pctl->ngroups++;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1062,17 +1076,23 @@ static int sunxi_pinctrl_build_state(struct platform_device *pdev)
|
|||
* we'll reallocate that later anyway
|
||||
*/
|
||||
pctl->functions = devm_kzalloc(&pdev->dev,
|
||||
pctl->desc->npins * sizeof(*pctl->functions),
|
||||
GFP_KERNEL);
|
||||
pctl->ngroups * sizeof(*pctl->functions),
|
||||
GFP_KERNEL);
|
||||
if (!pctl->functions)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Count functions and their associated groups */
|
||||
for (i = 0; i < pctl->desc->npins; i++) {
|
||||
const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
|
||||
struct sunxi_desc_function *func = pin->functions;
|
||||
struct sunxi_desc_function *func;
|
||||
|
||||
if (pin->variant && !(pctl->variant & pin->variant))
|
||||
continue;
|
||||
|
||||
for (func = pin->functions; func->name; func++) {
|
||||
if (func->variant && !(pctl->variant & func->variant))
|
||||
continue;
|
||||
|
||||
while (func->name) {
|
||||
/* Create interrupt mapping while we're at it */
|
||||
if (!strcmp(func->name, "irq")) {
|
||||
int irqnum = func->irqnum + func->irqbank * IRQ_PER_BANK;
|
||||
|
|
@ -1080,22 +1100,32 @@ static int sunxi_pinctrl_build_state(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
sunxi_pinctrl_add_function(pctl, func->name);
|
||||
func++;
|
||||
}
|
||||
}
|
||||
|
||||
/* And now allocated and fill the array for real */
|
||||
pctl->functions = krealloc(pctl->functions,
|
||||
pctl->nfunctions * sizeof(*pctl->functions),
|
||||
GFP_KERNEL);
|
||||
pctl->nfunctions * sizeof(*pctl->functions),
|
||||
GFP_KERNEL);
|
||||
if (!pctl->functions) {
|
||||
kfree(pctl->functions);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for (i = 0; i < pctl->desc->npins; i++) {
|
||||
const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
|
||||
struct sunxi_desc_function *func = pin->functions;
|
||||
struct sunxi_desc_function *func;
|
||||
|
||||
while (func->name) {
|
||||
if (pin->variant && !(pctl->variant & pin->variant))
|
||||
continue;
|
||||
|
||||
for (func = pin->functions; func->name; func++) {
|
||||
struct sunxi_pinctrl_function *func_item;
|
||||
const char **func_grp;
|
||||
|
||||
if (func->variant && !(pctl->variant & func->variant))
|
||||
continue;
|
||||
|
||||
func_item = sunxi_pinctrl_find_function_by_name(pctl,
|
||||
func->name);
|
||||
if (!func_item)
|
||||
|
|
@ -1115,7 +1145,6 @@ static int sunxi_pinctrl_build_state(struct platform_device *pdev)
|
|||
func_grp++;
|
||||
|
||||
*func_grp = pin->pin.name;
|
||||
func++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1207,15 +1236,16 @@ static int sunxi_pinctrl_setup_debounce(struct sunxi_pinctrl *pctl,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sunxi_pinctrl_init(struct platform_device *pdev,
|
||||
const struct sunxi_pinctrl_desc *desc)
|
||||
int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
|
||||
const struct sunxi_pinctrl_desc *desc,
|
||||
unsigned long variant)
|
||||
{
|
||||
struct device_node *node = pdev->dev.of_node;
|
||||
struct pinctrl_desc *pctrl_desc;
|
||||
struct pinctrl_pin_desc *pins;
|
||||
struct sunxi_pinctrl *pctl;
|
||||
struct resource *res;
|
||||
int i, ret, last_pin;
|
||||
int i, ret, last_pin, pin_idx;
|
||||
struct clk *clk;
|
||||
|
||||
pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
|
||||
|
|
@ -1232,6 +1262,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
|
|||
|
||||
pctl->dev = &pdev->dev;
|
||||
pctl->desc = desc;
|
||||
pctl->variant = variant;
|
||||
|
||||
pctl->irq_array = devm_kcalloc(&pdev->dev,
|
||||
IRQ_PER_BANK * pctl->desc->irq_banks,
|
||||
|
|
@ -1252,8 +1283,14 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
|
|||
if (!pins)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < pctl->desc->npins; i++)
|
||||
pins[i] = pctl->desc->pins[i].pin;
|
||||
for (i = 0, pin_idx = 0; i < pctl->desc->npins; i++) {
|
||||
const struct sunxi_desc_pin *pin = pctl->desc->pins + i;
|
||||
|
||||
if (pin->variant && !(pctl->variant & pin->variant))
|
||||
continue;
|
||||
|
||||
pins[pin_idx++] = pin->pin;
|
||||
}
|
||||
|
||||
pctrl_desc = devm_kzalloc(&pdev->dev,
|
||||
sizeof(*pctrl_desc),
|
||||
|
|
@ -1264,7 +1301,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
|
|||
pctrl_desc->name = dev_name(&pdev->dev);
|
||||
pctrl_desc->owner = THIS_MODULE;
|
||||
pctrl_desc->pins = pins;
|
||||
pctrl_desc->npins = pctl->desc->npins;
|
||||
pctrl_desc->npins = pctl->ngroups;
|
||||
pctrl_desc->confops = &sunxi_pconf_ops;
|
||||
pctrl_desc->pctlops = &sunxi_pctrl_ops;
|
||||
pctrl_desc->pmxops = &sunxi_pmx_ops;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,14 @@
|
|||
#define SUN4I_FUNC_INPUT 0
|
||||
#define SUN4I_FUNC_IRQ 6
|
||||
|
||||
#define PINCTRL_SUN5I_A10S BIT(1)
|
||||
#define PINCTRL_SUN5I_A13 BIT(2)
|
||||
#define PINCTRL_SUN5I_GR8 BIT(3)
|
||||
#define PINCTRL_SUN6I_A31 BIT(4)
|
||||
#define PINCTRL_SUN6I_A31S BIT(5)
|
||||
|
||||
struct sunxi_desc_function {
|
||||
unsigned long variant;
|
||||
const char *name;
|
||||
u8 muxval;
|
||||
u8 irqbank;
|
||||
|
|
@ -91,6 +98,7 @@ struct sunxi_desc_function {
|
|||
|
||||
struct sunxi_desc_pin {
|
||||
struct pinctrl_pin_desc pin;
|
||||
unsigned long variant;
|
||||
struct sunxi_desc_function *functions;
|
||||
};
|
||||
|
||||
|
|
@ -128,6 +136,7 @@ struct sunxi_pinctrl {
|
|||
unsigned *irq_array;
|
||||
spinlock_t lock;
|
||||
struct pinctrl_dev *pctl_dev;
|
||||
unsigned long variant;
|
||||
};
|
||||
|
||||
#define SUNXI_PIN(_pin, ...) \
|
||||
|
|
@ -137,12 +146,27 @@ struct sunxi_pinctrl {
|
|||
__VA_ARGS__, { } }, \
|
||||
}
|
||||
|
||||
#define SUNXI_PIN_VARIANT(_pin, _variant, ...) \
|
||||
{ \
|
||||
.pin = _pin, \
|
||||
.variant = _variant, \
|
||||
.functions = (struct sunxi_desc_function[]){ \
|
||||
__VA_ARGS__, { } }, \
|
||||
}
|
||||
|
||||
#define SUNXI_FUNCTION(_val, _name) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.muxval = _val, \
|
||||
}
|
||||
|
||||
#define SUNXI_FUNCTION_VARIANT(_val, _name, _variant) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.muxval = _val, \
|
||||
.variant = _variant, \
|
||||
}
|
||||
|
||||
#define SUNXI_FUNCTION_IRQ(_val, _irq) \
|
||||
{ \
|
||||
.name = "irq", \
|
||||
|
|
@ -290,7 +314,11 @@ static inline u32 sunxi_irq_status_offset(u16 irq)
|
|||
return irq_num * IRQ_STATUS_IRQ_BITS;
|
||||
}
|
||||
|
||||
int sunxi_pinctrl_init(struct platform_device *pdev,
|
||||
const struct sunxi_pinctrl_desc *desc);
|
||||
int sunxi_pinctrl_init_with_variant(struct platform_device *pdev,
|
||||
const struct sunxi_pinctrl_desc *desc,
|
||||
unsigned long variant);
|
||||
|
||||
#define sunxi_pinctrl_init(_dev, _desc) \
|
||||
sunxi_pinctrl_init_with_variant(_dev, _desc, 0)
|
||||
|
||||
#endif /* __PINCTRL_SUNXI_H */
|
||||
|
|
|
|||
10
drivers/pinctrl/ti/Kconfig
Normal file
10
drivers/pinctrl/ti/Kconfig
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
config PINCTRL_TI_IODELAY
|
||||
tristate "TI IODelay Module pinconf driver"
|
||||
depends on OF
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select GENERIC_PINCONF
|
||||
select REGMAP_MMIO
|
||||
help
|
||||
Say Y here to support Texas Instruments' IO delay pinconf driver.
|
||||
IO delay module is used for the DRA7 SoC family.
|
||||
1
drivers/pinctrl/ti/Makefile
Normal file
1
drivers/pinctrl/ti/Makefile
Normal file
|
|
@ -0,0 +1 @@
|
|||
obj-$(CONFIG_PINCTRL_TI_IODELAY) += pinctrl-ti-iodelay.o
|
||||
937
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
Normal file
937
drivers/pinctrl/ti/pinctrl-ti-iodelay.c
Normal file
|
|
@ -0,0 +1,937 @@
|
|||
/*
|
||||
* Support for configuration of IO Delay module found on Texas Instruments SoCs
|
||||
* such as DRA7
|
||||
*
|
||||
* Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/pinconf.h>
|
||||
#include <linux/pinctrl/pinconf-generic.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "../core.h"
|
||||
#include "../devicetree.h"
|
||||
|
||||
#define DRIVER_NAME "ti-iodelay"
|
||||
|
||||
/**
|
||||
* struct ti_iodelay_reg_data - Describes the registers for the iodelay instance
|
||||
* @signature_mask: CONFIG_REG mask for the signature bits (see TRM)
|
||||
* @signature_value: CONFIG_REG signature value to be written (see TRM)
|
||||
* @lock_mask: CONFIG_REG mask for the lock bits (see TRM)
|
||||
* @lock_val: CONFIG_REG lock value for the lock bits (see TRM)
|
||||
* @unlock_val:CONFIG_REG unlock value for the lock bits (see TRM)
|
||||
* @binary_data_coarse_mask: CONFIG_REG coarse mask (see TRM)
|
||||
* @binary_data_fine_mask: CONFIG_REG fine mask (see TRM)
|
||||
* @reg_refclk_offset: Refclk register offset
|
||||
* @refclk_period_mask: Refclk mask
|
||||
* @reg_coarse_offset: Coarse register configuration offset
|
||||
* @coarse_delay_count_mask: Coarse delay count mask
|
||||
* @coarse_ref_count_mask: Coarse ref count mask
|
||||
* @reg_fine_offset: Fine register configuration offset
|
||||
* @fine_delay_count_mask: Fine delay count mask
|
||||
* @fine_ref_count_mask: Fine ref count mask
|
||||
* @reg_global_lock_offset: Global iodelay module lock register offset
|
||||
* @global_lock_mask: Lock mask
|
||||
* @global_unlock_val: Unlock value
|
||||
* @global_lock_val: Lock value
|
||||
* @reg_start_offset: Offset to iodelay registers after the CONFIG_REG_0 to 8
|
||||
* @reg_nr_per_pin: Number of iodelay registers for each pin
|
||||
* @regmap_config: Regmap configuration for the IODelay region
|
||||
*/
|
||||
struct ti_iodelay_reg_data {
|
||||
u32 signature_mask;
|
||||
u32 signature_value;
|
||||
u32 lock_mask;
|
||||
u32 lock_val;
|
||||
u32 unlock_val;
|
||||
u32 binary_data_coarse_mask;
|
||||
u32 binary_data_fine_mask;
|
||||
|
||||
u32 reg_refclk_offset;
|
||||
u32 refclk_period_mask;
|
||||
|
||||
u32 reg_coarse_offset;
|
||||
u32 coarse_delay_count_mask;
|
||||
u32 coarse_ref_count_mask;
|
||||
|
||||
u32 reg_fine_offset;
|
||||
u32 fine_delay_count_mask;
|
||||
u32 fine_ref_count_mask;
|
||||
|
||||
u32 reg_global_lock_offset;
|
||||
u32 global_lock_mask;
|
||||
u32 global_unlock_val;
|
||||
u32 global_lock_val;
|
||||
|
||||
u32 reg_start_offset;
|
||||
u32 reg_nr_per_pin;
|
||||
|
||||
struct regmap_config *regmap_config;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ti_iodelay_reg_values - Computed io_reg configuration values (see TRM)
|
||||
* @coarse_ref_count: Coarse reference count
|
||||
* @coarse_delay_count: Coarse delay count
|
||||
* @fine_ref_count: Fine reference count
|
||||
* @fine_delay_count: Fine Delay count
|
||||
* @ref_clk_period: Reference Clock period
|
||||
* @cdpe: Coarse delay parameter
|
||||
* @fdpe: Fine delay parameter
|
||||
*/
|
||||
struct ti_iodelay_reg_values {
|
||||
u16 coarse_ref_count;
|
||||
u16 coarse_delay_count;
|
||||
|
||||
u16 fine_ref_count;
|
||||
u16 fine_delay_count;
|
||||
|
||||
u16 ref_clk_period;
|
||||
|
||||
u32 cdpe;
|
||||
u32 fdpe;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ti_iodelay_cfg - Description of each configuration parameters
|
||||
* @offset: Configuration register offset
|
||||
* @a_delay: Agnostic Delay (in ps)
|
||||
* @g_delay: Gnostic Delay (in ps)
|
||||
*/
|
||||
struct ti_iodelay_cfg {
|
||||
u16 offset;
|
||||
u16 a_delay;
|
||||
u16 g_delay;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ti_iodelay_pingroup - Structure that describes one group
|
||||
* @cfg: configuration array for the pin (from dt)
|
||||
* @ncfg: number of configuration values allocated
|
||||
* @config: pinconf "Config" - currently a dummy value
|
||||
*/
|
||||
struct ti_iodelay_pingroup {
|
||||
struct ti_iodelay_cfg *cfg;
|
||||
int ncfg;
|
||||
unsigned long config;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ti_iodelay_device - Represents information for a iodelay instance
|
||||
* @dev: Device pointer
|
||||
* @phys_base: Physical address base of the iodelay device
|
||||
* @reg_base: Virtual address base of the iodelay device
|
||||
* @regmap: Regmap for this iodelay instance
|
||||
* @pctl: Pinctrl device
|
||||
* @desc: pinctrl descriptor for pctl
|
||||
* @pa: pinctrl pin wise description
|
||||
* @reg_data: Register definition data for the IODelay instance
|
||||
* @reg_init_conf_values: Initial configuration values.
|
||||
*/
|
||||
struct ti_iodelay_device {
|
||||
struct device *dev;
|
||||
unsigned long phys_base;
|
||||
void __iomem *reg_base;
|
||||
struct regmap *regmap;
|
||||
|
||||
struct pinctrl_dev *pctl;
|
||||
struct pinctrl_desc desc;
|
||||
struct pinctrl_pin_desc *pa;
|
||||
|
||||
const struct ti_iodelay_reg_data *reg_data;
|
||||
struct ti_iodelay_reg_values reg_init_conf_values;
|
||||
};
|
||||
|
||||
/**
|
||||
* ti_iodelay_extract() - extract bits for a field
|
||||
* @val: Register value
|
||||
* @mask: Mask
|
||||
*
|
||||
* Return: extracted value which is appropriately shifted
|
||||
*/
|
||||
static inline u32 ti_iodelay_extract(u32 val, u32 mask)
|
||||
{
|
||||
return (val & mask) >> __ffs(mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_compute_dpe() - Compute equation for delay parameter
|
||||
* @period: Period to use
|
||||
* @ref: Reference Count
|
||||
* @delay: Delay count
|
||||
* @delay_m: Delay multiplier
|
||||
*
|
||||
* Return: Computed delay parameter
|
||||
*/
|
||||
static inline u32 ti_iodelay_compute_dpe(u16 period, u16 ref, u16 delay,
|
||||
u16 delay_m)
|
||||
{
|
||||
u64 m, d;
|
||||
|
||||
/* Handle overflow conditions */
|
||||
m = 10 * (u64)period * (u64)ref;
|
||||
d = 2 * (u64)delay * (u64)delay_m;
|
||||
|
||||
/* Truncate result back to 32 bits */
|
||||
return div64_u64(m, d);
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_set() - Configure the pin configuration
|
||||
* @iod: iodelay device
|
||||
* @cfg: Configuration
|
||||
*
|
||||
* Update the configuration register as per TRM and lockup once done.
|
||||
* *IMPORTANT NOTE* SoC TRM does recommend doing iodelay programmation only
|
||||
* while in Isolation. But, then, isolation also implies that every pin
|
||||
* on the SoC (including DDR) will be isolated out. The only benefit being
|
||||
* a glitchless configuration, However, the intent of this driver is purely
|
||||
* to support a "glitchy" configuration where applicable.
|
||||
*
|
||||
* Return: 0 in case of success, else appropriate error value
|
||||
*/
|
||||
static int ti_iodelay_pinconf_set(struct ti_iodelay_device *iod,
|
||||
struct ti_iodelay_cfg *cfg)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *reg = iod->reg_data;
|
||||
struct ti_iodelay_reg_values *ival = &iod->reg_init_conf_values;
|
||||
struct device *dev = iod->dev;
|
||||
u32 g_delay_coarse, g_delay_fine;
|
||||
u32 a_delay_coarse, a_delay_fine;
|
||||
u32 c_elements, f_elements;
|
||||
u32 total_delay;
|
||||
u32 reg_mask, reg_val, tmp_val;
|
||||
int r;
|
||||
|
||||
/* NOTE: Truncation is expected in all division below */
|
||||
g_delay_coarse = cfg->g_delay / 920;
|
||||
g_delay_fine = ((cfg->g_delay % 920) * 10) / 60;
|
||||
|
||||
a_delay_coarse = cfg->a_delay / ival->cdpe;
|
||||
a_delay_fine = ((cfg->a_delay % ival->cdpe) * 10) / ival->fdpe;
|
||||
|
||||
c_elements = g_delay_coarse + a_delay_coarse;
|
||||
f_elements = (g_delay_fine + a_delay_fine) / 10;
|
||||
|
||||
if (f_elements > 22) {
|
||||
total_delay = c_elements * ival->cdpe + f_elements * ival->fdpe;
|
||||
c_elements = total_delay / ival->cdpe;
|
||||
f_elements = (total_delay % ival->cdpe) / ival->fdpe;
|
||||
}
|
||||
|
||||
reg_mask = reg->signature_mask;
|
||||
reg_val = reg->signature_value << __ffs(reg->signature_mask);
|
||||
|
||||
reg_mask |= reg->binary_data_coarse_mask;
|
||||
tmp_val = c_elements << __ffs(reg->binary_data_coarse_mask);
|
||||
if (tmp_val & ~reg->binary_data_coarse_mask) {
|
||||
dev_err(dev, "Masking overflow of coarse elements %08x\n",
|
||||
tmp_val);
|
||||
tmp_val &= reg->binary_data_coarse_mask;
|
||||
}
|
||||
reg_val |= tmp_val;
|
||||
|
||||
reg_mask |= reg->binary_data_fine_mask;
|
||||
tmp_val = f_elements << __ffs(reg->binary_data_fine_mask);
|
||||
if (tmp_val & ~reg->binary_data_fine_mask) {
|
||||
dev_err(dev, "Masking overflow of fine elements %08x\n",
|
||||
tmp_val);
|
||||
tmp_val &= reg->binary_data_fine_mask;
|
||||
}
|
||||
reg_val |= tmp_val;
|
||||
|
||||
/*
|
||||
* NOTE: we leave the iodelay values unlocked - this is to work around
|
||||
* situations such as those found with mmc mode change.
|
||||
* However, this leaves open any unwarranted changes to padconf register
|
||||
* impacting iodelay configuration. Use with care!
|
||||
*/
|
||||
reg_mask |= reg->lock_mask;
|
||||
reg_val |= reg->unlock_val << __ffs(reg->lock_mask);
|
||||
r = regmap_update_bits(iod->regmap, cfg->offset, reg_mask, reg_val);
|
||||
|
||||
dev_info(dev, "Set reg 0x%x Delay(a: %d g: %d), Elements(C=%d F=%d)0x%x\n",
|
||||
cfg->offset, cfg->a_delay, cfg->g_delay, c_elements,
|
||||
f_elements, reg_val);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_init_dev() - Initialize IODelay device
|
||||
* @iod: iodelay device
|
||||
*
|
||||
* Unlocks the iodelay region, computes the common parameters
|
||||
*
|
||||
* Return: 0 in case of success, else appropriate error value
|
||||
*/
|
||||
static int ti_iodelay_pinconf_init_dev(struct ti_iodelay_device *iod)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *reg = iod->reg_data;
|
||||
struct device *dev = iod->dev;
|
||||
struct ti_iodelay_reg_values *ival = &iod->reg_init_conf_values;
|
||||
u32 val;
|
||||
int r;
|
||||
|
||||
/* unlock the iodelay region */
|
||||
r = regmap_update_bits(iod->regmap, reg->reg_global_lock_offset,
|
||||
reg->global_lock_mask, reg->global_unlock_val);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/* Read up Recalibration sequence done by bootloader */
|
||||
r = regmap_read(iod->regmap, reg->reg_refclk_offset, &val);
|
||||
if (r)
|
||||
return r;
|
||||
ival->ref_clk_period = ti_iodelay_extract(val, reg->refclk_period_mask);
|
||||
dev_dbg(dev, "refclk_period=0x%04x\n", ival->ref_clk_period);
|
||||
|
||||
r = regmap_read(iod->regmap, reg->reg_coarse_offset, &val);
|
||||
if (r)
|
||||
return r;
|
||||
ival->coarse_ref_count =
|
||||
ti_iodelay_extract(val, reg->coarse_ref_count_mask);
|
||||
ival->coarse_delay_count =
|
||||
ti_iodelay_extract(val, reg->coarse_delay_count_mask);
|
||||
if (!ival->coarse_delay_count) {
|
||||
dev_err(dev, "Invalid Coarse delay count (0) (reg=0x%08x)\n",
|
||||
val);
|
||||
return -EINVAL;
|
||||
}
|
||||
ival->cdpe = ti_iodelay_compute_dpe(ival->ref_clk_period,
|
||||
ival->coarse_ref_count,
|
||||
ival->coarse_delay_count, 88);
|
||||
if (!ival->cdpe) {
|
||||
dev_err(dev, "Invalid cdpe computed params = %d %d %d\n",
|
||||
ival->ref_clk_period, ival->coarse_ref_count,
|
||||
ival->coarse_delay_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
dev_dbg(iod->dev, "coarse: ref=0x%04x delay=0x%04x cdpe=0x%08x\n",
|
||||
ival->coarse_ref_count, ival->coarse_delay_count, ival->cdpe);
|
||||
|
||||
r = regmap_read(iod->regmap, reg->reg_fine_offset, &val);
|
||||
if (r)
|
||||
return r;
|
||||
ival->fine_ref_count =
|
||||
ti_iodelay_extract(val, reg->fine_ref_count_mask);
|
||||
ival->fine_delay_count =
|
||||
ti_iodelay_extract(val, reg->fine_delay_count_mask);
|
||||
if (!ival->fine_delay_count) {
|
||||
dev_err(dev, "Invalid Fine delay count (0) (reg=0x%08x)\n",
|
||||
val);
|
||||
return -EINVAL;
|
||||
}
|
||||
ival->fdpe = ti_iodelay_compute_dpe(ival->ref_clk_period,
|
||||
ival->fine_ref_count,
|
||||
ival->fine_delay_count, 264);
|
||||
if (!ival->fdpe) {
|
||||
dev_err(dev, "Invalid fdpe(0) computed params = %d %d %d\n",
|
||||
ival->ref_clk_period, ival->fine_ref_count,
|
||||
ival->fine_delay_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
dev_dbg(iod->dev, "fine: ref=0x%04x delay=0x%04x fdpe=0x%08x\n",
|
||||
ival->fine_ref_count, ival->fine_delay_count, ival->fdpe);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_deinit_dev() - deinit the iodelay device
|
||||
* @iod: IODelay device
|
||||
*
|
||||
* Deinitialize the IODelay device (basically just lock the region back up.
|
||||
*/
|
||||
static void ti_iodelay_pinconf_deinit_dev(struct ti_iodelay_device *iod)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *reg = iod->reg_data;
|
||||
|
||||
/* lock the iodelay region back again */
|
||||
regmap_update_bits(iod->regmap, reg->reg_global_lock_offset,
|
||||
reg->global_lock_mask, reg->global_lock_val);
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_get_pingroup() - Find the group mapped by a group selector
|
||||
* @iod: iodelay device
|
||||
* @selector: Group Selector
|
||||
*
|
||||
* Return: Corresponding group representing group selector
|
||||
*/
|
||||
static struct ti_iodelay_pingroup *
|
||||
ti_iodelay_get_pingroup(struct ti_iodelay_device *iod, unsigned int selector)
|
||||
{
|
||||
struct group_desc *g;
|
||||
|
||||
g = pinctrl_generic_get_group(iod->pctl, selector);
|
||||
if (!g) {
|
||||
dev_err(iod->dev, "%s could not find pingroup %i\n", __func__,
|
||||
selector);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return g->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_offset_to_pin() - get a pin index based on the register offset
|
||||
* @iod: iodelay driver instance
|
||||
* @offset: register offset from the base
|
||||
*/
|
||||
static int ti_iodelay_offset_to_pin(struct ti_iodelay_device *iod,
|
||||
unsigned int offset)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *r = iod->reg_data;
|
||||
unsigned int index;
|
||||
|
||||
if (offset > r->regmap_config->max_register) {
|
||||
dev_err(iod->dev, "mux offset out of range: 0x%x (0x%x)\n",
|
||||
offset, r->regmap_config->max_register);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
index = (offset - r->reg_start_offset) / r->regmap_config->reg_stride;
|
||||
index /= r->reg_nr_per_pin;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_node_iterator() - Iterate iodelay node
|
||||
* @pctldev: Pin controller driver
|
||||
* @np: Device node
|
||||
* @pinctrl_spec: Parsed arguments from device tree
|
||||
* @pins: Array of pins in the pin group
|
||||
* @pin_index: Pin index in the pin array
|
||||
* @data: Pin controller driver specific data
|
||||
*
|
||||
*/
|
||||
static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
|
||||
struct device_node *np,
|
||||
const struct of_phandle_args *pinctrl_spec,
|
||||
int *pins, int pin_index, void *data)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct ti_iodelay_cfg *cfg = data;
|
||||
const struct ti_iodelay_reg_data *r;
|
||||
struct pinctrl_pin_desc *pd;
|
||||
int pin;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
if (!iod)
|
||||
return -EINVAL;
|
||||
|
||||
r = iod->reg_data;
|
||||
|
||||
if (pinctrl_spec->args_count < r->reg_nr_per_pin) {
|
||||
dev_err(iod->dev, "invalid args_count for spec: %i\n",
|
||||
pinctrl_spec->args_count);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Index plus two value cells */
|
||||
cfg[pin_index].offset = pinctrl_spec->args[0];
|
||||
cfg[pin_index].a_delay = pinctrl_spec->args[1] & 0xffff;
|
||||
cfg[pin_index].g_delay = pinctrl_spec->args[2] & 0xffff;
|
||||
|
||||
pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset);
|
||||
if (pin < 0) {
|
||||
dev_err(iod->dev, "could not add functions for %s %ux\n",
|
||||
np->name, cfg[pin_index].offset);
|
||||
return -ENODEV;
|
||||
}
|
||||
pins[pin_index] = pin;
|
||||
|
||||
pd = &iod->pa[pin];
|
||||
pd->drv_data = &cfg[pin_index];
|
||||
|
||||
dev_dbg(iod->dev, "%s offset=%x a_delay = %d g_delay = %d\n",
|
||||
np->name, cfg[pin_index].offset, cfg[pin_index].a_delay,
|
||||
cfg[pin_index].g_delay);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_dt_node_to_map() - Map a device tree node to appropriate group
|
||||
* @pctldev: pinctrl device representing IODelay device
|
||||
* @np: Node Pointer (device tree)
|
||||
* @map: Pinctrl Map returned back to pinctrl framework
|
||||
* @num_maps: Number of maps (1)
|
||||
*
|
||||
* Maps the device tree description into a group of configuration parameters
|
||||
* for iodelay block entry.
|
||||
*
|
||||
* Return: 0 in case of success, else appropriate error value
|
||||
*/
|
||||
static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
|
||||
struct device_node *np,
|
||||
struct pinctrl_map **map,
|
||||
unsigned int *num_maps)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct ti_iodelay_cfg *cfg;
|
||||
struct ti_iodelay_pingroup *g;
|
||||
const char *name = "pinctrl-pin-array";
|
||||
int rows, *pins, error = -EINVAL, i;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
if (!iod)
|
||||
return -EINVAL;
|
||||
|
||||
rows = pinctrl_count_index_with_args(np, name);
|
||||
if (rows == -EINVAL)
|
||||
return rows;
|
||||
|
||||
*map = devm_kzalloc(iod->dev, sizeof(**map), GFP_KERNEL);
|
||||
if (!*map)
|
||||
return -ENOMEM;
|
||||
*num_maps = 0;
|
||||
|
||||
g = devm_kzalloc(iod->dev, sizeof(*g), GFP_KERNEL);
|
||||
if (!g) {
|
||||
error = -ENOMEM;
|
||||
goto free_map;
|
||||
}
|
||||
|
||||
pins = devm_kzalloc(iod->dev, sizeof(*pins) * rows, GFP_KERNEL);
|
||||
if (!pins)
|
||||
goto free_group;
|
||||
|
||||
cfg = devm_kzalloc(iod->dev, sizeof(*cfg) * rows, GFP_KERNEL);
|
||||
if (!cfg) {
|
||||
error = -ENOMEM;
|
||||
goto free_pins;
|
||||
}
|
||||
|
||||
for (i = 0; i < rows; i++) {
|
||||
struct of_phandle_args pinctrl_spec;
|
||||
|
||||
error = pinctrl_parse_index_with_args(np, name, i,
|
||||
&pinctrl_spec);
|
||||
if (error)
|
||||
goto free_data;
|
||||
|
||||
error = ti_iodelay_node_iterator(pctldev, np, &pinctrl_spec,
|
||||
pins, i, cfg);
|
||||
if (error)
|
||||
goto free_data;
|
||||
}
|
||||
|
||||
g->cfg = cfg;
|
||||
g->ncfg = i;
|
||||
g->config = PIN_CONFIG_END;
|
||||
|
||||
error = pinctrl_generic_add_group(iod->pctl, np->name, pins, i, g);
|
||||
if (error < 0)
|
||||
goto free_data;
|
||||
|
||||
(*map)->type = PIN_MAP_TYPE_CONFIGS_GROUP;
|
||||
(*map)->data.configs.group_or_pin = np->name;
|
||||
(*map)->data.configs.configs = &g->config;
|
||||
(*map)->data.configs.num_configs = 1;
|
||||
*num_maps = 1;
|
||||
|
||||
return 0;
|
||||
|
||||
free_data:
|
||||
devm_kfree(iod->dev, cfg);
|
||||
free_pins:
|
||||
devm_kfree(iod->dev, pins);
|
||||
free_group:
|
||||
devm_kfree(iod->dev, g);
|
||||
free_map:
|
||||
devm_kfree(iod->dev, *map);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_group_get() - Get the group configuration
|
||||
* @pctldev: pinctrl device representing IODelay device
|
||||
* @selector: Group selector
|
||||
* @config: Configuration returned
|
||||
*
|
||||
* Return: The configuration if the group is valid, else returns -EINVAL
|
||||
*/
|
||||
static int ti_iodelay_pinconf_group_get(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
unsigned long *config)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct device *dev;
|
||||
struct ti_iodelay_pingroup *group;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
dev = iod->dev;
|
||||
group = ti_iodelay_get_pingroup(iod, selector);
|
||||
|
||||
if (!group)
|
||||
return -EINVAL;
|
||||
|
||||
*config = group->config;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_group_set() - Configure the groups of pins
|
||||
* @pctldev: pinctrl device representing IODelay device
|
||||
* @selector: Group selector
|
||||
* @configs: Configurations
|
||||
* @num_configs: Number of configurations
|
||||
*
|
||||
* Return: 0 if all went fine, else appropriate error value.
|
||||
*/
|
||||
static int ti_iodelay_pinconf_group_set(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
unsigned long *configs,
|
||||
unsigned int num_configs)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct device *dev;
|
||||
struct ti_iodelay_pingroup *group;
|
||||
int i;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
dev = iod->dev;
|
||||
group = ti_iodelay_get_pingroup(iod, selector);
|
||||
|
||||
if (num_configs != 1) {
|
||||
dev_err(dev, "Unsupported number of configurations %d\n",
|
||||
num_configs);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (*configs != PIN_CONFIG_END) {
|
||||
dev_err(dev, "Unsupported configuration\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < group->ncfg; i++) {
|
||||
if (ti_iodelay_pinconf_set(iod, &group->cfg[i]))
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
/**
|
||||
* ti_iodelay_pin_to_offset() - get pin register offset based on the pin index
|
||||
* @iod: iodelay driver instance
|
||||
* @selector: Pin index
|
||||
*/
|
||||
static unsigned int ti_iodelay_pin_to_offset(struct ti_iodelay_device *iod,
|
||||
unsigned int selector)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *r = iod->reg_data;
|
||||
unsigned int offset;
|
||||
|
||||
offset = selector * r->regmap_config->reg_stride;
|
||||
offset *= r->reg_nr_per_pin;
|
||||
offset += r->reg_start_offset;
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void ti_iodelay_pin_dbg_show(struct pinctrl_dev *pctldev,
|
||||
struct seq_file *s,
|
||||
unsigned int pin)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct pinctrl_pin_desc *pd;
|
||||
struct ti_iodelay_cfg *cfg;
|
||||
const struct ti_iodelay_reg_data *r;
|
||||
unsigned long offset;
|
||||
u32 in, oen, out;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
r = iod->reg_data;
|
||||
|
||||
offset = ti_iodelay_pin_to_offset(iod, pin);
|
||||
pd = &iod->pa[pin];
|
||||
cfg = pd->drv_data;
|
||||
|
||||
regmap_read(iod->regmap, offset, &in);
|
||||
regmap_read(iod->regmap, offset + r->regmap_config->reg_stride, &oen);
|
||||
regmap_read(iod->regmap, offset + r->regmap_config->reg_stride * 2,
|
||||
&out);
|
||||
|
||||
seq_printf(s, "%lx a: %i g: %i (%08x %08x %08x) %s ",
|
||||
iod->phys_base + offset,
|
||||
cfg ? cfg->a_delay : -1,
|
||||
cfg ? cfg->g_delay : -1,
|
||||
in, oen, out, DRIVER_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_pinconf_group_dbg_show() - show the group information
|
||||
* @pctldev: Show the group information
|
||||
* @s: Sequence file
|
||||
* @selector: Group selector
|
||||
*
|
||||
* Provide the configuration information of the selected group
|
||||
*/
|
||||
static void ti_iodelay_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
||||
struct seq_file *s,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct ti_iodelay_device *iod;
|
||||
struct device *dev;
|
||||
struct ti_iodelay_pingroup *group;
|
||||
int i;
|
||||
|
||||
iod = pinctrl_dev_get_drvdata(pctldev);
|
||||
dev = iod->dev;
|
||||
group = ti_iodelay_get_pingroup(iod, selector);
|
||||
if (!group)
|
||||
return;
|
||||
|
||||
for (i = 0; i < group->ncfg; i++) {
|
||||
struct ti_iodelay_cfg *cfg;
|
||||
u32 reg = 0;
|
||||
|
||||
cfg = &group->cfg[i];
|
||||
regmap_read(iod->regmap, cfg->offset, ®),
|
||||
seq_printf(s, "\n\t0x%08x = 0x%08x (%3d, %3d)",
|
||||
cfg->offset, reg, cfg->a_delay,
|
||||
cfg->g_delay);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct pinctrl_ops ti_iodelay_pinctrl_ops = {
|
||||
.get_groups_count = pinctrl_generic_get_group_count,
|
||||
.get_group_name = pinctrl_generic_get_group_name,
|
||||
.get_group_pins = pinctrl_generic_get_group_pins,
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
.pin_dbg_show = ti_iodelay_pin_dbg_show,
|
||||
#endif
|
||||
.dt_node_to_map = ti_iodelay_dt_node_to_map,
|
||||
};
|
||||
|
||||
static struct pinconf_ops ti_iodelay_pinctrl_pinconf_ops = {
|
||||
.pin_config_group_get = ti_iodelay_pinconf_group_get,
|
||||
.pin_config_group_set = ti_iodelay_pinconf_group_set,
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
.pin_config_group_dbg_show = ti_iodelay_pinconf_group_dbg_show,
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* ti_iodelay_alloc_pins() - Allocate structures needed for pins for iodelay
|
||||
* @dev: Device pointer
|
||||
* @iod: iodelay device
|
||||
* @base_phy: Base Physical Address
|
||||
*
|
||||
* Return: 0 if all went fine, else appropriate error value.
|
||||
*/
|
||||
static int ti_iodelay_alloc_pins(struct device *dev,
|
||||
struct ti_iodelay_device *iod, u32 base_phy)
|
||||
{
|
||||
const struct ti_iodelay_reg_data *r = iod->reg_data;
|
||||
struct pinctrl_pin_desc *pin;
|
||||
u32 phy_reg;
|
||||
int nr_pins, i;
|
||||
|
||||
nr_pins = ti_iodelay_offset_to_pin(iod, r->regmap_config->max_register);
|
||||
dev_dbg(dev, "Allocating %i pins\n", nr_pins);
|
||||
|
||||
iod->pa = devm_kzalloc(dev, sizeof(*iod->pa) * nr_pins, GFP_KERNEL);
|
||||
if (!iod->pa)
|
||||
return -ENOMEM;
|
||||
|
||||
iod->desc.pins = iod->pa;
|
||||
iod->desc.npins = nr_pins;
|
||||
|
||||
phy_reg = r->reg_start_offset + base_phy;
|
||||
|
||||
for (i = 0; i < nr_pins; i++, phy_reg += 4) {
|
||||
pin = &iod->pa[i];
|
||||
pin->number = i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct regmap_config dra7_iodelay_regmap_config = {
|
||||
.reg_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.val_bits = 32,
|
||||
.max_register = 0xd1c,
|
||||
};
|
||||
|
||||
static struct ti_iodelay_reg_data dra7_iodelay_data = {
|
||||
.signature_mask = 0x0003f000,
|
||||
.signature_value = 0x29,
|
||||
.lock_mask = 0x00000400,
|
||||
.lock_val = 1,
|
||||
.unlock_val = 0,
|
||||
.binary_data_coarse_mask = 0x000003e0,
|
||||
.binary_data_fine_mask = 0x0000001f,
|
||||
|
||||
.reg_refclk_offset = 0x14,
|
||||
.refclk_period_mask = 0xffff,
|
||||
|
||||
.reg_coarse_offset = 0x18,
|
||||
.coarse_delay_count_mask = 0xffff0000,
|
||||
.coarse_ref_count_mask = 0x0000ffff,
|
||||
|
||||
.reg_fine_offset = 0x1C,
|
||||
.fine_delay_count_mask = 0xffff0000,
|
||||
.fine_ref_count_mask = 0x0000ffff,
|
||||
|
||||
.reg_global_lock_offset = 0x2c,
|
||||
.global_lock_mask = 0x0000ffff,
|
||||
.global_unlock_val = 0x0000aaaa,
|
||||
.global_lock_val = 0x0000aaab,
|
||||
|
||||
.reg_start_offset = 0x30,
|
||||
.reg_nr_per_pin = 3,
|
||||
.regmap_config = &dra7_iodelay_regmap_config,
|
||||
};
|
||||
|
||||
static const struct of_device_id ti_iodelay_of_match[] = {
|
||||
{.compatible = "ti,dra7-iodelay", .data = &dra7_iodelay_data},
|
||||
{ /* Hopefully no more.. */ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, ti_iodelay_of_match);
|
||||
|
||||
/**
|
||||
* ti_iodelay_probe() - Standard probe
|
||||
* @pdev: platform device
|
||||
*
|
||||
* Return: 0 if all went fine, else appropriate error value.
|
||||
*/
|
||||
static int ti_iodelay_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = of_node_get(dev->of_node);
|
||||
const struct of_device_id *match;
|
||||
struct resource *res;
|
||||
struct ti_iodelay_device *iod;
|
||||
int ret = 0;
|
||||
|
||||
if (!np) {
|
||||
ret = -EINVAL;
|
||||
dev_err(dev, "No OF node\n");
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
match = of_match_device(ti_iodelay_of_match, dev);
|
||||
if (!match) {
|
||||
ret = -EINVAL;
|
||||
dev_err(dev, "No DATA match\n");
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
iod = devm_kzalloc(dev, sizeof(*iod), GFP_KERNEL);
|
||||
if (!iod) {
|
||||
ret = -ENOMEM;
|
||||
goto exit_out;
|
||||
}
|
||||
iod->dev = dev;
|
||||
iod->reg_data = match->data;
|
||||
|
||||
/* So far We can assume there is only 1 bank of registers */
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(dev, "Missing MEM resource\n");
|
||||
ret = -ENODEV;
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
iod->phys_base = res->start;
|
||||
iod->reg_base = devm_ioremap_resource(dev, res);
|
||||
if (IS_ERR(iod->reg_base)) {
|
||||
ret = PTR_ERR(iod->reg_base);
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
iod->regmap = devm_regmap_init_mmio(dev, iod->reg_base,
|
||||
iod->reg_data->regmap_config);
|
||||
if (IS_ERR(iod->regmap)) {
|
||||
dev_err(dev, "Regmap MMIO init failed.\n");
|
||||
ret = PTR_ERR(iod->regmap);
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
if (ti_iodelay_pinconf_init_dev(iod))
|
||||
goto exit_out;
|
||||
|
||||
ret = ti_iodelay_alloc_pins(dev, iod, res->start);
|
||||
if (ret)
|
||||
goto exit_out;
|
||||
|
||||
iod->desc.pctlops = &ti_iodelay_pinctrl_ops;
|
||||
/* no pinmux ops - we are pinconf */
|
||||
iod->desc.confops = &ti_iodelay_pinctrl_pinconf_ops;
|
||||
iod->desc.name = dev_name(dev);
|
||||
iod->desc.owner = THIS_MODULE;
|
||||
|
||||
ret = pinctrl_register_and_init(&iod->desc, dev, iod, &iod->pctl);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to register pinctrl\n");
|
||||
goto exit_out;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, iod);
|
||||
|
||||
exit_out:
|
||||
of_node_put(np);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ti_iodelay_remove() - standard remove
|
||||
* @pdev: platform device
|
||||
*
|
||||
* Return: 0 if all went fine, else appropriate error value.
|
||||
*/
|
||||
static int ti_iodelay_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ti_iodelay_device *iod = platform_get_drvdata(pdev);
|
||||
|
||||
if (!iod)
|
||||
return 0;
|
||||
|
||||
if (iod->pctl)
|
||||
pinctrl_unregister(iod->pctl);
|
||||
|
||||
ti_iodelay_pinconf_deinit_dev(iod);
|
||||
|
||||
/* Expect other allocations to be freed by devm */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver ti_iodelay_driver = {
|
||||
.probe = ti_iodelay_probe,
|
||||
.remove = ti_iodelay_remove,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRIVER_NAME,
|
||||
.of_match_table = ti_iodelay_of_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(ti_iodelay_driver);
|
||||
|
||||
MODULE_AUTHOR("Texas Instruments, Inc.");
|
||||
MODULE_DESCRIPTION("Pinconf driver for TI's IO Delay module");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
@ -297,7 +297,7 @@ static int uniphier_conf_pin_config_get(struct pinctrl_dev *pctldev,
|
|||
|
||||
static int uniphier_conf_pin_bias_set(struct pinctrl_dev *pctldev,
|
||||
const struct pin_desc *desc,
|
||||
enum pin_config_param param, u16 arg)
|
||||
enum pin_config_param param, u32 arg)
|
||||
{
|
||||
struct uniphier_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum uniphier_pin_pull_dir pull_dir =
|
||||
|
|
@ -468,7 +468,7 @@ static int uniphier_conf_pin_config_set(struct pinctrl_dev *pctldev,
|
|||
for (i = 0; i < num_configs; i++) {
|
||||
enum pin_config_param param =
|
||||
pinconf_to_config_param(configs[i]);
|
||||
u16 arg = pinconf_to_config_argument(configs[i]);
|
||||
u32 arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue