From 208ab54e3e9516dd9fcf1ce197950044e0bebd90 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 17 Jul 2015 12:48:39 +0000 Subject: brcm2708: add linux 4.1 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas SVN-Revision: 46399 --- ...Add-pwr_led-and-the-required-input-trigge.patch | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 target/linux/brcm2708/patches-4.1/0053-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch (limited to 'target/linux/brcm2708/patches-4.1/0053-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch') diff --git a/target/linux/brcm2708/patches-4.1/0053-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch b/target/linux/brcm2708/patches-4.1/0053-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch new file mode 100644 index 0000000000..7ff90ede15 --- /dev/null +++ b/target/linux/brcm2708/patches-4.1/0053-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch @@ -0,0 +1,106 @@ +From 1578dbee8e10fed1be0f64820fe511dc4b7a720e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 6 Feb 2015 13:50:57 +0000 +Subject: [PATCH 053/121] BCM270x_DT: Add pwr_led, and the required "input" + trigger + +The "input" trigger makes the associated GPIO an input. This is to support +the Raspberry Pi PWR LED, which is driven by external hardware in normal use. + +N.B. pwr_led is not available on Model A or B boards. +--- + drivers/leds/trigger/Kconfig | 7 ++++ + drivers/leds/trigger/Makefile | 1 + + drivers/leds/trigger/ledtrig-input.c | 65 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 73 insertions(+) + create mode 100644 drivers/leds/trigger/ledtrig-input.c + +--- a/drivers/leds/trigger/Kconfig ++++ b/drivers/leds/trigger/Kconfig +@@ -126,4 +126,11 @@ config LEDS_TRIGGER_USBDEV + This allows LEDs to be controlled by the presence/activity of + an USB device. If unsure, say N. + ++config LEDS_TRIGGER_INPUT ++ tristate "LED Input Trigger" ++ depends on LEDS_TRIGGERS ++ help ++ This allows the GPIOs assigned to be LEDs to be initialised to inputs. ++ If unsure, say Y. ++ + endif # LEDS_TRIGGERS +--- a/drivers/leds/trigger/Makefile ++++ b/drivers/leds/trigger/Makefile +@@ -8,3 +8,4 @@ obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtr + obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o + obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o + obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o ++obj-$(CONFIG_LEDS_TRIGGER_INPUT) += ledtrig-input.o +--- /dev/null ++++ b/drivers/leds/trigger/ledtrig-input.c +@@ -0,0 +1,65 @@ ++/* ++ * Set LED GPIO to Input "Trigger" ++ * ++ * Copyright 2015 Phil Elwell ++ * ++ * Based on Nick Forbes's ledtrig-default-on.c. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include "../leds.h" ++ ++/* This is a hack to get at the private 'gpio' member */ ++ ++struct gpio_led_data { ++ struct led_classdev cdev; ++ unsigned gpio; ++}; ++ ++static void input_trig_activate(struct led_classdev *led_cdev) ++{ ++ struct gpio_led_data *led_dat = ++ container_of(led_cdev, struct gpio_led_data, cdev); ++ if (gpio_is_valid(led_dat->gpio)) ++ gpio_direction_input(led_dat->gpio); ++} ++ ++static void input_trig_deactivate(struct led_classdev *led_cdev) ++{ ++ struct gpio_led_data *led_dat = ++ container_of(led_cdev, struct gpio_led_data, cdev); ++ if (gpio_is_valid(led_dat->gpio)) ++ gpio_direction_output(led_dat->gpio, 0); ++} ++ ++static struct led_trigger input_led_trigger = { ++ .name = "input", ++ .activate = input_trig_activate, ++ .deactivate = input_trig_deactivate, ++}; ++ ++static int __init input_trig_init(void) ++{ ++ return led_trigger_register(&input_led_trigger); ++} ++ ++static void __exit input_trig_exit(void) ++{ ++ led_trigger_unregister(&input_led_trigger); ++} ++ ++module_init(input_trig_init); ++module_exit(input_trig_exit); ++ ++MODULE_AUTHOR("Phil Elwell "); ++MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); ++MODULE_LICENSE("GPL"); -- cgit v1.2.3