From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- arch/arm/mach-kirkwood/board-dnskw.c | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-dnskw.c (limited to 'arch/arm/mach-kirkwood/board-dnskw.c') diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c new file mode 100644 index 00000000..a1aa87f0 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-dnskw.c @@ -0,0 +1,43 @@ +/* + * Copyright 2012 (C), Jamie Lentin + * + * arch/arm/mach-kirkwood/board-dnskw.c + * + * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to + * flattened device tree yet. + * + * 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 +#include +#include +#include +#include +#include "common.h" + +static struct mv643xx_eth_platform_data dnskw_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(8), +}; + +/* Register any GPIO for output and set the value */ +static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) +{ + if (gpio_request(gpio, name) == 0 && + gpio_direction_output(gpio, 0) == 0) { + gpio_set_value(gpio, def); + if (gpio_export(gpio, 0) != 0) + pr_err("dnskw: Failed to export GPIO %s\n", name); + } else + pr_err("dnskw: Failed to register %s\n", name); +} + +void __init dnskw_init(void) +{ + kirkwood_ge00_init(&dnskw_ge00_data); + + /* Set NAS to turn back on after a power failure */ + dnskw_gpio_register(37, "dnskw:power:recover", 1); +} -- cgit v1.3.1