1*f126890aSEmmanuel Vadot/* 2*f126890aSEmmanuel Vadot * Device Tree common file for gpio-{keys,leds} on Buffalo Linkstation 3*f126890aSEmmanuel Vadot * 4*f126890aSEmmanuel Vadot * Copyright (C) 2015, 2016 5*f126890aSEmmanuel Vadot * Roger Shimizu <rogershimizu@gmail.com> 6*f126890aSEmmanuel Vadot * 7*f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms 8*f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual 9*f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a 10*f126890aSEmmanuel Vadot * whole. 11*f126890aSEmmanuel Vadot * 12*f126890aSEmmanuel Vadot * a) This file is free software; you can redistribute it and/or 13*f126890aSEmmanuel Vadot * modify it under the terms of the GNU General Public License as 14*f126890aSEmmanuel Vadot * published by the Free Software Foundation; either version 2 of the 15*f126890aSEmmanuel Vadot * License, or (at your option) any later version. 16*f126890aSEmmanuel Vadot * 17*f126890aSEmmanuel Vadot * This file is distributed in the hope that it will be useful, 18*f126890aSEmmanuel Vadot * but WITHOUT ANY WARRANTY; without even the implied warranty of 19*f126890aSEmmanuel Vadot * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20*f126890aSEmmanuel Vadot * GNU General Public License for more details. 21*f126890aSEmmanuel Vadot * 22*f126890aSEmmanuel Vadot * Or, alternatively, 23*f126890aSEmmanuel Vadot * 24*f126890aSEmmanuel Vadot * b) Permission is hereby granted, free of charge, to any person 25*f126890aSEmmanuel Vadot * obtaining a copy of this software and associated documentation 26*f126890aSEmmanuel Vadot * files (the "Software"), to deal in the Software without 27*f126890aSEmmanuel Vadot * restriction, including without limitation the rights to use, 28*f126890aSEmmanuel Vadot * copy, modify, merge, publish, distribute, sublicense, and/or 29*f126890aSEmmanuel Vadot * sell copies of the Software, and to permit persons to whom the 30*f126890aSEmmanuel Vadot * Software is furnished to do so, subject to the following 31*f126890aSEmmanuel Vadot * conditions: 32*f126890aSEmmanuel Vadot * 33*f126890aSEmmanuel Vadot * The above copyright notice and this permission notice shall be 34*f126890aSEmmanuel Vadot * included in all copies or substantial portions of the Software. 35*f126890aSEmmanuel Vadot * 36*f126890aSEmmanuel Vadot * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37*f126890aSEmmanuel Vadot * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38*f126890aSEmmanuel Vadot * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39*f126890aSEmmanuel Vadot * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40*f126890aSEmmanuel Vadot * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 41*f126890aSEmmanuel Vadot * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42*f126890aSEmmanuel Vadot * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43*f126890aSEmmanuel Vadot * OTHER DEALINGS IN THE SOFTWARE. 44*f126890aSEmmanuel Vadot */ 45*f126890aSEmmanuel Vadot 46*f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h> 47*f126890aSEmmanuel Vadot 48*f126890aSEmmanuel Vadot/ { 49*f126890aSEmmanuel Vadot gpio_keys { 50*f126890aSEmmanuel Vadot compatible = "gpio-keys"; 51*f126890aSEmmanuel Vadot #address-cells = <1>; 52*f126890aSEmmanuel Vadot #size-cells = <0>; 53*f126890aSEmmanuel Vadot pinctrl-0 = <&pmx_power_switch>; 54*f126890aSEmmanuel Vadot pinctrl-names = "default"; 55*f126890aSEmmanuel Vadot 56*f126890aSEmmanuel Vadot power-on-switch { 57*f126890aSEmmanuel Vadot label = "Power-on Switch"; 58*f126890aSEmmanuel Vadot linux,code = <KEY_RESERVED>; 59*f126890aSEmmanuel Vadot linux,input-type = <5>; 60*f126890aSEmmanuel Vadot }; 61*f126890aSEmmanuel Vadot 62*f126890aSEmmanuel Vadot power-auto-switch { 63*f126890aSEmmanuel Vadot label = "Power-auto Switch"; 64*f126890aSEmmanuel Vadot linux,code = <KEY_ESC>; 65*f126890aSEmmanuel Vadot linux,input-type = <5>; 66*f126890aSEmmanuel Vadot }; 67*f126890aSEmmanuel Vadot }; 68*f126890aSEmmanuel Vadot 69*f126890aSEmmanuel Vadot gpio_leds { 70*f126890aSEmmanuel Vadot compatible = "gpio-leds"; 71*f126890aSEmmanuel Vadot pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info>; 72*f126890aSEmmanuel Vadot pinctrl-names = "default"; 73*f126890aSEmmanuel Vadot 74*f126890aSEmmanuel Vadot blue-power-led { 75*f126890aSEmmanuel Vadot label = "linkstation:blue:power"; 76*f126890aSEmmanuel Vadot default-state = "keep"; 77*f126890aSEmmanuel Vadot }; 78*f126890aSEmmanuel Vadot 79*f126890aSEmmanuel Vadot red-alarm-led { 80*f126890aSEmmanuel Vadot label = "linkstation:red:alarm"; 81*f126890aSEmmanuel Vadot }; 82*f126890aSEmmanuel Vadot 83*f126890aSEmmanuel Vadot amber-info-led { 84*f126890aSEmmanuel Vadot label = "linkstation:amber:info"; 85*f126890aSEmmanuel Vadot }; 86*f126890aSEmmanuel Vadot }; 87*f126890aSEmmanuel Vadot}; 88*f126890aSEmmanuel Vadot 89*f126890aSEmmanuel Vadot&pinctrl { 90*f126890aSEmmanuel Vadot pmx_power_switch: pmx-power-switch { 91*f126890aSEmmanuel Vadot marvell,function = "gpio"; 92*f126890aSEmmanuel Vadot }; 93*f126890aSEmmanuel Vadot 94*f126890aSEmmanuel Vadot pmx_led_power: pmx-leds { 95*f126890aSEmmanuel Vadot marvell,function = "gpio"; 96*f126890aSEmmanuel Vadot }; 97*f126890aSEmmanuel Vadot 98*f126890aSEmmanuel Vadot pmx_led_alarm: pmx-leds { 99*f126890aSEmmanuel Vadot marvell,function = "gpio"; 100*f126890aSEmmanuel Vadot }; 101*f126890aSEmmanuel Vadot 102*f126890aSEmmanuel Vadot pmx_led_info: pmx-leds { 103*f126890aSEmmanuel Vadot marvell,function = "gpio"; 104*f126890aSEmmanuel Vadot }; 105*f126890aSEmmanuel Vadot}; 106