2016-03-16 04:29:54 +00:00
|
|
|
diff -ruN a/arch/arm/boot/dts/kirkwood-pogo_e02.dts b/arch/arm/boot/dts/kirkwood-pogo_e02.dts
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/arch/arm/boot/dts/kirkwood-pogo_e02.dts 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/arch/arm/boot/dts/kirkwood-pogo_e02.dts 2016-10-02 23:41:08.542632805 -0600
|
2016-03-16 04:29:54 +00:00
|
|
|
@@ -38,7 +38,7 @@
|
|
|
|
health {
|
|
|
|
label = "pogo_e02:green:health";
|
|
|
|
gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
|
|
|
|
- default-state = "keep";
|
|
|
|
+ default-state = "default-on";
|
|
|
|
};
|
|
|
|
fault {
|
|
|
|
label = "pogo_e02:orange:fault";
|
2014-01-21 18:51:50 +00:00
|
|
|
diff -ruN a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/drivers/ata/sata_mv.c 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/ata/sata_mv.c 2016-10-03 00:07:50.934801409 -0600
|
2015-04-15 10:28:36 +00:00
|
|
|
@@ -72,6 +72,7 @@
|
2014-01-21 18:51:50 +00:00
|
|
|
#include <scsi/scsi_cmnd.h>
|
|
|
|
#include <scsi/scsi_device.h>
|
|
|
|
#include <linux/libata.h>
|
|
|
|
+#include <linux/leds.h>
|
|
|
|
|
|
|
|
#define DRV_NAME "sata_mv"
|
|
|
|
#define DRV_VERSION "1.28"
|
2016-03-16 04:29:54 +00:00
|
|
|
@@ -1175,6 +1176,8 @@
|
2014-01-21 18:51:50 +00:00
|
|
|
{
|
|
|
|
int want_ncq = (protocol == ATA_PROT_NCQ);
|
|
|
|
|
2016-10-10 07:00:26 +00:00
|
|
|
+ ledtrig_sata_activity(ap->port_no);
|
2014-01-21 18:51:50 +00:00
|
|
|
+
|
|
|
|
if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) {
|
|
|
|
int using_ncq = ((pp->pp_flags & MV_PP_FLAG_NCQ_EN) != 0);
|
|
|
|
if (want_ncq != using_ncq)
|
2015-04-15 10:28:36 +00:00
|
|
|
diff -ruN a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/drivers/leds/trigger/Kconfig 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/leds/trigger/Kconfig 2016-10-02 23:54:28.033717682 -0600
|
|
|
|
@@ -41,6 +41,12 @@
|
|
|
|
This allows LEDs to be controlled by disk activity.
|
|
|
|
If unsure, say Y.
|
|
|
|
|
|
|
|
+config LEDS_TRIGGER_SATA
|
|
|
|
+ bool "LED SATA Disk Trigger fir Kirkwood SOC"
|
|
|
|
+ depends on LEDS_TRIGGERS
|
|
|
|
+ help
|
|
|
|
+ This allows LEDs to be controlled by IDE disk activity.
|
|
|
|
+
|
|
|
|
config LEDS_TRIGGER_MTD
|
|
|
|
bool "LED MTD (NAND/NOR) Trigger"
|
|
|
|
depends on MTD
|
|
|
|
diff -ruN a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
|
|
|
|
--- a/drivers/leds/trigger/Makefile 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/leds/trigger/Makefile 2016-10-02 23:52:47.634208429 -0600
|
|
|
|
@@ -1,6 +1,7 @@
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_DISK) += ledtrig-disk.o
|
|
|
|
+obj-$(CONFIG_LEDS_TRIGGER_SATA) += ledtrig-sata.o
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o
|
|
|
|
obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o
|
|
|
|
diff -ruN a/drivers/leds/trigger/ledtrig-sata.c b/drivers/leds/trigger/ledtrig-sata.c
|
|
|
|
--- a/drivers/leds/trigger/ledtrig-sata.c 1969-12-31 17:00:00.000000000 -0700
|
|
|
|
+++ b/drivers/leds/trigger/ledtrig-sata.c 2016-10-03 00:09:26.434336496 -0600
|
|
|
|
@@ -0,0 +1,43 @@
|
|
|
|
+/*
|
|
|
|
+ * LED SATA-Disk Activity Trigger
|
|
|
|
+ *
|
|
|
|
+ * 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 <linux/kernel.h>
|
|
|
|
+#include <linux/init.h>
|
|
|
|
+#include <linux/leds.h>
|
|
|
|
+
|
|
|
|
+#define BLINK_DELAY 30
|
|
|
|
+
|
|
|
|
+DEFINE_LED_TRIGGER(ledtrig_sata1);
|
|
|
|
+DEFINE_LED_TRIGGER(ledtrig_sata2);
|
|
|
|
+
|
|
|
|
+void ledtrig_sata_activity(int port_number)
|
|
|
|
+{
|
|
|
|
+ unsigned long sata_blink_delay = BLINK_DELAY;
|
|
|
|
+
|
|
|
|
+ switch (port_number) {
|
|
|
|
+ case 0:
|
|
|
|
+ led_trigger_blink_oneshot(ledtrig_sata1, &sata_blink_delay, &sata_blink_delay, 0);
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ led_trigger_blink_oneshot(ledtrig_sata2, &sata_blink_delay, &sata_blink_delay, 0);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
2016-07-28 01:23:37 +00:00
|
|
|
+ }
|
2016-10-10 07:00:26 +00:00
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(ledtrig_sata_activity);
|
2016-07-28 01:23:37 +00:00
|
|
|
+
|
2016-10-10 07:00:26 +00:00
|
|
|
+static int __init ledtrig_sata_init(void)
|
|
|
|
+{
|
|
|
|
+ led_trigger_register_simple("sata-disk1", &ledtrig_sata1);
|
|
|
|
+ led_trigger_register_simple("sata-disk2", &ledtrig_sata2);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+device_initcall(ledtrig_sata_init);
|
2015-04-15 10:28:36 +00:00
|
|
|
diff -ruN a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/drivers/mmc/core/core.c 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/mmc/core/core.c 2016-10-02 23:41:08.547632780 -0600
|
2016-07-28 01:23:37 +00:00
|
|
|
@@ -857,7 +857,7 @@
|
2015-04-15 10:28:36 +00:00
|
|
|
*/
|
|
|
|
limit_us = 3000000;
|
|
|
|
else
|
|
|
|
- limit_us = 100000;
|
|
|
|
+ limit_us = 200000;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SDHC cards always use these fixed values.
|
|
|
|
diff -ruN a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/drivers/mmc/core/sd.c 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/mmc/core/sd.c 2016-10-02 23:41:08.552632755 -0600
|
2016-07-28 01:23:37 +00:00
|
|
|
@@ -363,6 +363,15 @@
|
2015-04-15 10:28:36 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Some SDHC cards, notably those with a Sandisk SD controller
|
|
|
|
+ * (also found in Kingston products) need a bit of slack
|
|
|
|
+ * before successfully handling the SWITCH command. So far,
|
|
|
|
+ * cards identifying themselves as "SD04G" and "SD08G" are
|
|
|
|
+ * affected
|
|
|
|
+ */
|
|
|
|
+ udelay(100);
|
|
|
|
+
|
|
|
|
err = mmc_sd_switch(card, 1, 0, 1, status);
|
|
|
|
if (err)
|
|
|
|
goto out;
|
|
|
|
diff -ruN a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/drivers/mmc/host/mvsdio.c 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/drivers/mmc/host/mvsdio.c 2016-10-02 23:41:08.552632755 -0600
|
2016-03-16 04:29:54 +00:00
|
|
|
@@ -23,6 +23,7 @@
|
2015-04-15 10:28:36 +00:00
|
|
|
#include <linux/of_irq.h>
|
|
|
|
#include <linux/mmc/host.h>
|
|
|
|
#include <linux/mmc/slot-gpio.h>
|
|
|
|
+#include <linux/mmc/sd.h>
|
|
|
|
|
|
|
|
#include <asm/sizes.h>
|
|
|
|
#include <asm/unaligned.h>
|
2016-03-16 04:29:54 +00:00
|
|
|
@@ -149,6 +150,7 @@
|
2015-04-15 10:28:36 +00:00
|
|
|
|
|
|
|
dev_dbg(host->dev, "cmd %d (hw state 0x%04x)\n",
|
|
|
|
cmd->opcode, mvsd_read(MVSD_HW_STATE));
|
|
|
|
+ if (cmd->opcode == SD_SWITCH) mdelay(1); /* Voodoo */
|
|
|
|
|
|
|
|
cmdreg = MVSD_CMD_INDEX(cmd->opcode);
|
|
|
|
|
|
|
|
diff -ruN a/include/linux/leds.h b/include/linux/leds.h
|
2016-10-10 07:00:26 +00:00
|
|
|
--- a/include/linux/leds.h 2016-10-02 17:24:33.000000000 -0600
|
|
|
|
+++ b/include/linux/leds.h 2016-10-03 00:15:52.467581672 -0600
|
|
|
|
@@ -331,6 +331,12 @@
|
|
|
|
static inline void ledtrig_disk_activity(void) {}
|
2015-04-15 10:28:36 +00:00
|
|
|
#endif
|
|
|
|
|
2016-10-10 07:00:26 +00:00
|
|
|
+#ifdef CONFIG_LEDS_TRIGGER_SATA
|
|
|
|
+extern void ledtrig_sata_activity(int port_number);
|
|
|
|
+#else
|
|
|
|
+static inline void ledtrig_sata_activity(int port_number) {}
|
|
|
|
+#endif
|
|
|
|
+
|
2016-07-28 01:23:37 +00:00
|
|
|
#ifdef CONFIG_LEDS_TRIGGER_MTD
|
2016-10-10 07:00:26 +00:00
|
|
|
extern void ledtrig_mtd_activity(void);
|
|
|
|
#else
|