-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tegra/boards' into next/boards
* tegra/boards: arm/tegra: remove __initdata annotation from pinmux tables arm/tegra: Use bus notifiers to trigger pinmux setup arm/tegra: Refactor board-*-pinmux.c to share code arm/tegra: Fix mistake in Trimslice's pinmux arm/tegra: Rework Seaboard-vs-Ventana pinmux table arm/tegra: Remove useless entries from ventana_pinmux[] arm/tegra: PCIe: Remove include of mach/pinmux.h arm/tegra: Harmony PCIe: Don't touch pinmux arm/tegra: Add AUXDATA for tegra-pinmux and tegra-gpio arm/tegra: Split Seaboard GPIO table to allow for Ventana ARM: tegra: paz00: Fix board pinmux table. ARM: tegra: paz00: add support for wakeup gpio key
- Loading branch information
Showing
12 changed files
with
269 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
obj-y += board-pinmux.o | ||
obj-y += common.o | ||
obj-y += devices.o | ||
obj-y += io.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that 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. | ||
* | ||
*/ | ||
|
||
#include <linux/device.h> | ||
#include <linux/kernel.h> | ||
#include <linux/notifier.h> | ||
#include <linux/of.h> | ||
#include <linux/string.h> | ||
|
||
#include <mach/gpio-tegra.h> | ||
#include <mach/pinmux.h> | ||
|
||
#include "board-pinmux.h" | ||
#include "devices.h" | ||
|
||
struct tegra_board_pinmux_conf *confs[2]; | ||
|
||
static void tegra_board_pinmux_setup_gpios(void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(confs); i++) { | ||
if (!confs[i]) | ||
continue; | ||
|
||
tegra_gpio_config(confs[i]->gpios, confs[i]->gpio_count); | ||
} | ||
} | ||
|
||
static void tegra_board_pinmux_setup_pinmux(void) | ||
{ | ||
int i; | ||
|
||
for (i = 0; i < ARRAY_SIZE(confs); i++) { | ||
if (!confs[i]) | ||
continue; | ||
|
||
tegra_pinmux_config_table(confs[i]->pgs, confs[i]->pg_count); | ||
|
||
if (confs[i]->drives) | ||
tegra_drive_pinmux_config_table(confs[i]->drives, | ||
confs[i]->drive_count); | ||
} | ||
} | ||
|
||
static int tegra_board_pinmux_bus_notify(struct notifier_block *nb, | ||
unsigned long event, void *vdev) | ||
{ | ||
static bool had_gpio; | ||
static bool had_pinmux; | ||
|
||
struct device *dev = vdev; | ||
const char *devname; | ||
|
||
if (event != BUS_NOTIFY_BOUND_DRIVER) | ||
return NOTIFY_DONE; | ||
|
||
devname = dev_name(dev); | ||
|
||
if (!had_gpio && !strcmp(devname, GPIO_DEV)) { | ||
tegra_board_pinmux_setup_gpios(); | ||
had_gpio = true; | ||
} else if (!had_pinmux && !strcmp(devname, PINMUX_DEV)) { | ||
tegra_board_pinmux_setup_pinmux(); | ||
had_pinmux = true; | ||
} | ||
|
||
if (had_gpio && had_pinmux) | ||
return NOTIFY_STOP_MASK; | ||
else | ||
return NOTIFY_DONE; | ||
} | ||
|
||
static struct notifier_block nb = { | ||
.notifier_call = tegra_board_pinmux_bus_notify, | ||
}; | ||
|
||
static struct platform_device *devices[] = { | ||
&tegra_gpio_device, | ||
&tegra_pinmux_device, | ||
}; | ||
|
||
void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a, | ||
struct tegra_board_pinmux_conf *conf_b) | ||
{ | ||
confs[0] = conf_a; | ||
confs[1] = conf_b; | ||
|
||
bus_register_notifier(&platform_bus_type, &nb); | ||
|
||
if (!of_machine_is_compatible("nvidia,tegra20")) | ||
platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* This program is distributed in the hope that 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 __MACH_TEGRA_BOARD_PINMUX_H | ||
#define __MACH_TEGRA_BOARD_PINMUX_H | ||
|
||
#define GPIO_DEV "tegra-gpio" | ||
#define PINMUX_DEV "tegra-pinmux" | ||
|
||
struct tegra_pingroup_config; | ||
struct tegra_gpio_table; | ||
|
||
struct tegra_board_pinmux_conf { | ||
struct tegra_pingroup_config *pgs; | ||
int pg_count; | ||
|
||
struct tegra_drive_pingroup_config *drives; | ||
int drive_count; | ||
|
||
struct tegra_gpio_table *gpios; | ||
int gpio_count; | ||
}; | ||
|
||
void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a, | ||
struct tegra_board_pinmux_conf *conf_b); | ||
|
||
#endif |
Oops, something went wrong.