0001 /*
0002 * Device Tree common file for gpio-{keys,leds} on Buffalo Linkstation
0003 *
0004 * Copyright (C) 2015, 2016
0005 * Roger Shimizu <rogershimizu@gmail.com>
0006 *
0007 * This file is dual-licensed: you can use it either under the terms
0008 * of the GPL or the X11 license, at your option. Note that this dual
0009 * licensing only applies to this file, and not this project as a
0010 * whole.
0011 *
0012 * a) This file is free software; you can redistribute it and/or
0013 * modify it under the terms of the GNU General Public License as
0014 * published by the Free Software Foundation; either version 2 of the
0015 * License, or (at your option) any later version.
0016 *
0017 * This file is distributed in the hope that it will be useful,
0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020 * GNU General Public License for more details.
0021 *
0022 * Or, alternatively,
0023 *
0024 * b) Permission is hereby granted, free of charge, to any person
0025 * obtaining a copy of this software and associated documentation
0026 * files (the "Software"), to deal in the Software without
0027 * restriction, including without limitation the rights to use,
0028 * copy, modify, merge, publish, distribute, sublicense, and/or
0029 * sell copies of the Software, and to permit persons to whom the
0030 * Software is furnished to do so, subject to the following
0031 * conditions:
0032 *
0033 * The above copyright notice and this permission notice shall be
0034 * included in all copies or substantial portions of the Software.
0035 *
0036 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0037 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0038 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0039 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0040 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0041 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0042 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0043 * OTHER DEALINGS IN THE SOFTWARE.
0044 */
0045
0046 #include <dt-bindings/input/input.h>
0047
0048 / {
0049 gpio_keys {
0050 compatible = "gpio-keys";
0051 #address-cells = <1>;
0052 #size-cells = <0>;
0053 pinctrl-0 = <&pmx_power_switch>;
0054 pinctrl-names = "default";
0055
0056 power-on-switch {
0057 label = "Power-on Switch";
0058 linux,code = <KEY_RESERVED>;
0059 linux,input-type = <5>;
0060 };
0061
0062 power-auto-switch {
0063 label = "Power-auto Switch";
0064 linux,code = <KEY_ESC>;
0065 linux,input-type = <5>;
0066 };
0067 };
0068
0069 gpio_leds {
0070 compatible = "gpio-leds";
0071 pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info>;
0072 pinctrl-names = "default";
0073
0074 blue-power-led {
0075 label = "linkstation:blue:power";
0076 default-state = "keep";
0077 };
0078
0079 red-alarm-led {
0080 label = "linkstation:red:alarm";
0081 };
0082
0083 amber-info-led {
0084 label = "linkstation:amber:info";
0085 };
0086 };
0087 };
0088
0089 &pinctrl {
0090 pmx_power_switch: pmx-power-switch {
0091 marvell,function = "gpio";
0092 };
0093
0094 pmx_led_power: pmx-leds {
0095 marvell,function = "gpio";
0096 };
0097
0098 pmx_led_alarm: pmx-leds {
0099 marvell,function = "gpio";
0100 };
0101
0102 pmx_led_info: pmx-leds {
0103 marvell,function = "gpio";
0104 };
0105 };