Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a6c3b33f
Commit
a6c3b33f
authored
Mar 06, 2012
by
Linus Walleij
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pinctrl-tegra-for-next-diet' into for-next
parents
0acfb076
f1f1ffa0
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7393 additions
and
0 deletions
+7393
-0
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/Kconfig
+4
-0
arch/arm/mach-tegra/include/mach/pinconf-tegra.h
arch/arm/mach-tegra/include/mach/pinconf-tegra.h
+63
-0
drivers/pinctrl/Kconfig
drivers/pinctrl/Kconfig
+15
-0
drivers/pinctrl/Makefile
drivers/pinctrl/Makefile
+3
-0
drivers/pinctrl/pinctrl-tegra.c
drivers/pinctrl/pinctrl-tegra.c
+559
-0
drivers/pinctrl/pinctrl-tegra.h
drivers/pinctrl/pinctrl-tegra.h
+163
-0
drivers/pinctrl/pinctrl-tegra20.c
drivers/pinctrl/pinctrl-tegra20.c
+2860
-0
drivers/pinctrl/pinctrl-tegra30.c
drivers/pinctrl/pinctrl-tegra30.c
+3726
-0
No files found.
arch/arm/mach-tegra/Kconfig
View file @
a6c3b33f
...
...
@@ -7,6 +7,8 @@ config ARCH_TEGRA_2x_SOC
select CPU_V7
select ARM_GIC
select ARCH_REQUIRE_GPIOLIB
select PINCTRL
select PINCTRL_TEGRA20
select USB_ARCH_HAS_EHCI if USB_SUPPORT
select USB_ULPI if USB_SUPPORT
select USB_ULPI_VIEWPORT if USB_SUPPORT
...
...
@@ -19,6 +21,8 @@ config ARCH_TEGRA_3x_SOC
select CPU_V7
select ARM_GIC
select ARCH_REQUIRE_GPIOLIB
select PINCTRL
select PINCTRL_TEGRA30
select USB_ARCH_HAS_EHCI if USB_SUPPORT
select USB_ULPI if USB_SUPPORT
select USB_ULPI_VIEWPORT if USB_SUPPORT
...
...
arch/arm/mach-tegra/include/mach/pinconf-tegra.h
0 → 100644
View file @
a6c3b33f
/*
* pinctrl configuration definitions for the NVIDIA Tegra pinmux
*
* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __PINCONF_TEGRA_H__
#define __PINCONF_TEGRA_H__
enum
tegra_pinconf_param
{
/* argument: tegra_pinconf_pull */
TEGRA_PINCONF_PARAM_PULL
,
/* argument: tegra_pinconf_tristate */
TEGRA_PINCONF_PARAM_TRISTATE
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_ENABLE_INPUT
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_OPEN_DRAIN
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_LOCK
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_IORESET
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_HIGH_SPEED_MODE
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_SCHMITT
,
/* argument: Boolean */
TEGRA_PINCONF_PARAM_LOW_POWER_MODE
,
/* argument: Integer, range is HW-dependant */
TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH
,
/* argument: Integer, range is HW-dependant */
TEGRA_PINCONF_PARAM_DRIVE_UP_STRENGTH
,
/* argument: Integer, range is HW-dependant */
TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING
,
/* argument: Integer, range is HW-dependant */
TEGRA_PINCONF_PARAM_SLEW_RATE_RISING
,
};
enum
tegra_pinconf_pull
{
TEGRA_PINCONFIG_PULL_NONE
,
TEGRA_PINCONFIG_PULL_DOWN
,
TEGRA_PINCONFIG_PULL_UP
,
};
enum
tegra_pinconf_tristate
{
TEGRA_PINCONFIG_DRIVEN
,
TEGRA_PINCONFIG_TRISTATE
,
};
#define TEGRA_PINCONF_PACK(_param_, _arg_) ((_param_) << 16 | (_arg_))
#define TEGRA_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16)
#define TEGRA_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff)
#endif
drivers/pinctrl/Kconfig
View file @
a6c3b33f
...
...
@@ -50,6 +50,21 @@ config PINCTRL_SIRF
depends on ARCH_PRIMA2
select PINMUX
config PINCTRL_TEGRA
bool
config PINCTRL_TEGRA20
bool
select PINMUX
select PINCONF
select PINCTRL_TEGRA
config PINCTRL_TEGRA30
bool
select PINMUX
select PINCONF
select PINCTRL_TEGRA
config PINCTRL_U300
bool "U300 pin controller driver"
depends on ARCH_U300
...
...
drivers/pinctrl/Makefile
View file @
a6c3b33f
...
...
@@ -10,5 +10,8 @@ obj-$(CONFIG_PINCTRL_MMP2) += pinctrl-mmp2.o
obj-$(CONFIG_PINCTRL_PXA168)
+=
pinctrl-pxa168.o
obj-$(CONFIG_PINCTRL_PXA910)
+=
pinctrl-pxa910.o
obj-$(CONFIG_PINCTRL_SIRF)
+=
pinctrl-sirf.o
obj-$(CONFIG_PINCTRL_TEGRA)
+=
pinctrl-tegra.o
obj-$(CONFIG_PINCTRL_TEGRA20)
+=
pinctrl-tegra20.o
obj-$(CONFIG_PINCTRL_TEGRA30)
+=
pinctrl-tegra30.o
obj-$(CONFIG_PINCTRL_U300)
+=
pinctrl-u300.o
obj-$(CONFIG_PINCTRL_COH901)
+=
pinctrl-coh901.o
drivers/pinctrl/pinctrl-tegra.c
0 → 100644
View file @
a6c3b33f
This diff is collapsed.
Click to expand it.
drivers/pinctrl/pinctrl-tegra.h
0 → 100644
View file @
a6c3b33f
/*
* Driver for the NVIDIA Tegra pinmux
*
* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef __PINMUX_TEGRA_H__
#define __PINMUX_TEGRA_H__
/**
* struct tegra_function - Tegra pinctrl mux function
* @name: The name of the function, exported to pinctrl core.
* @groups: An array of pin groups that may select this function.
* @ngroups: The number of entries in @groups.
*/
struct
tegra_function
{
const
char
*
name
;
const
char
*
const
*
groups
;
unsigned
ngroups
;
};
/**
* struct tegra_pingroup - Tegra pin group
* @mux_reg: Mux register offset. -1 if unsupported.
* @mux_bank: Mux register bank. 0 if unsupported.
* @mux_bit: Mux register bit. 0 if unsupported.
* @pupd_reg: Pull-up/down register offset. -1 if unsupported.
* @pupd_bank: Pull-up/down register bank. 0 if unsupported.
* @pupd_bit: Pull-up/down register bit. 0 if unsupported.
* @tri_reg: Tri-state register offset. -1 if unsupported.
* @tri_bank: Tri-state register bank. 0 if unsupported.
* @tri_bit: Tri-state register bit. 0 if unsupported.
* @einput_reg: Enable-input register offset. -1 if unsupported.
* @einput_bank: Enable-input register bank. 0 if unsupported.
* @einput_bit: Enable-input register bit. 0 if unsupported.
* @odrain_reg: Open-drain register offset. -1 if unsupported.
* @odrain_bank: Open-drain register bank. 0 if unsupported.
* @odrain_bit: Open-drain register bit. 0 if unsupported.
* @lock_reg: Lock register offset. -1 if unsupported.
* @lock_bank: Lock register bank. 0 if unsupported.
* @lock_bit: Lock register bit. 0 if unsupported.
* @ioreset_reg: IO reset register offset. -1 if unsupported.
* @ioreset_bank: IO reset register bank. 0 if unsupported.
* @ioreset_bit: IO reset register bit. 0 if unsupported.
* @drv_reg: Drive fields register offset. -1 if unsupported.
* This register contains the hsm, schmitt, lpmd, drvdn,
* drvup, slwr, and slwf parameters.
* @drv_bank: Drive fields register bank. 0 if unsupported.
* @hsm_bit: High Speed Mode register bit. 0 if unsupported.
* @schmitt_bit: Scmitt register bit. 0 if unsupported.
* @lpmd_bit: Low Power Mode register bit. 0 if unsupported.
* @drvdn_bit: Drive Down register bit. 0 if unsupported.
* @drvdn_width: Drive Down field width. 0 if unsupported.
* @drvup_bit: Drive Up register bit. 0 if unsupported.
* @drvup_width: Drive Up field width. 0 if unsupported.
* @slwr_bit: Slew Rising register bit. 0 if unsupported.
* @slwr_width: Slew Rising field width. 0 if unsupported.
* @slwf_bit: Slew Falling register bit. 0 if unsupported.
* @slwf_width: Slew Falling field width. 0 if unsupported.
*
* A representation of a group of pins (possibly just one pin) in the Tegra
* pin controller. Each group allows some parameter or parameters to be
* configured. The most common is mux function selection. Many others exist
* such as pull-up/down, tri-state, etc. Tegra's pin controller is complex;
* certain groups may only support configuring certain parameters, hence
* each parameter is optional, represented by a -1 "reg" value.
*/
struct
tegra_pingroup
{
const
char
*
name
;
const
unsigned
*
pins
;
unsigned
npins
;
unsigned
funcs
[
4
];
unsigned
func_safe
;
s16
mux_reg
;
s16
pupd_reg
;
s16
tri_reg
;
s16
einput_reg
;
s16
odrain_reg
;
s16
lock_reg
;
s16
ioreset_reg
;
s16
drv_reg
;
u32
mux_bank
:
2
;
u32
pupd_bank
:
2
;
u32
tri_bank
:
2
;
u32
einput_bank
:
2
;
u32
odrain_bank
:
2
;
u32
ioreset_bank
:
2
;
u32
lock_bank
:
2
;
u32
drv_bank
:
2
;
u32
mux_bit
:
5
;
u32
pupd_bit
:
5
;
u32
tri_bit
:
5
;
u32
einput_bit
:
5
;
u32
odrain_bit
:
5
;
u32
lock_bit
:
5
;
u32
ioreset_bit
:
5
;
u32
hsm_bit
:
5
;
u32
schmitt_bit
:
5
;
u32
lpmd_bit
:
5
;
u32
drvdn_bit
:
5
;
u32
drvup_bit
:
5
;
u32
slwr_bit
:
5
;
u32
slwf_bit
:
5
;
u32
drvdn_width
:
6
;
u32
drvup_width
:
6
;
u32
slwr_width
:
6
;
u32
slwf_width
:
6
;
};
/**
* struct tegra_pinctrl_soc_data - Tegra pin controller driver configuration
* @ngpios: The number of GPIO pins the pin controller HW affects.
* @pins: An array describing all pins the pin controller affects.
* All pins which are also GPIOs must be listed first within the
* array, and be numbered identically to the GPIO controller's
* numbering.
* @npins: The numbmer of entries in @pins.
* @functions: An array describing all mux functions the SoC supports.
* @nfunctions: The numbmer of entries in @functions.
* @groups: An array describing all pin groups the pin SoC supports.
* @ngroups: The numbmer of entries in @groups.
*/
struct
tegra_pinctrl_soc_data
{
unsigned
ngpios
;
const
struct
pinctrl_pin_desc
*
pins
;
unsigned
npins
;
const
struct
tegra_function
*
functions
;
unsigned
nfunctions
;
const
struct
tegra_pingroup
*
groups
;
unsigned
ngroups
;
};
/**
* tegra_pinctrl_soc_initf() - Retrieve pin controller details for a SoC.
* @soc_data: This pointer must be updated to point at a struct containing
* details of the SoC.
*/
typedef
void
(
*
tegra_pinctrl_soc_initf
)(
const
struct
tegra_pinctrl_soc_data
**
soc_data
);
/**
* tegra20_pinctrl_init() - Retrieve pin controller details for Tegra20
* @soc_data: This pointer will be updated to point at a struct containing
* details of Tegra20's pin controller.
*/
void
tegra20_pinctrl_init
(
const
struct
tegra_pinctrl_soc_data
**
soc_data
);
/**
* tegra30_pinctrl_init() - Retrieve pin controller details for Tegra20
* @soc_data: This pointer will be updated to point at a struct containing
* details of Tegra30's pin controller.
*/
void
tegra30_pinctrl_init
(
const
struct
tegra_pinctrl_soc_data
**
soc_data
);
#endif
drivers/pinctrl/pinctrl-tegra20.c
0 → 100644
View file @
a6c3b33f
This diff is collapsed.
Click to expand it.
drivers/pinctrl/pinctrl-tegra30.c
0 → 100644
View file @
a6c3b33f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment