All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.22 1/3] Add LED trigger to libata core
@ 2007-03-19 21:48 ` Tony Vroon
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Vroon @ 2007-03-19 21:48 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: htejun, alan, linux-ide, linux-kernel

This adds an optional wrapper around ata_ac_issue_prot that triggers the LED layer.
I plan to use this by allowing PMU LED control on G5 towers. My test platform 
is a PowerMac 7,3 (Dual G5 2.0GHz, June 2004) with a K2 (sata_svw) controller.
Respin of an earlier patch, based on comments by Tejun Heo & Alan Cox.

Signed-off-by: Tony Vroon <chainsaw@gentoo.org>

--- linux-2.6/drivers/ata/libata-core.c.orig	2007-03-19 20:03:07.000000000 +0000
+++ linux-2.6/drivers/ata/libata-core.c	2007-03-19 21:05:50.000000000 +0000
@@ -49,6 +49,7 @@
 #include <linux/workqueue.h>
 #include <linux/jiffies.h>
 #include <linux/scatterlist.h>
+#include <linux/leds.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
@@ -5050,6 +5051,25 @@
 }
 
 /**
+ *	ata_qc_issue_prot_with_ledtrigger - trigger LED core
+ *	@qc: command to issue to device
+ *
+ *	This triggers the LED core and then calls the
+ *	regular ata_qc_issue_prot function.
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host lock)
+ *
+ *	RETURNS:
+ *	Zero on success, AC_ERR_* mask on failure
+ */
+unsigned int ata_qc_issue_prot_with_ledtrigger(struct ata_queued_cmd *qc)
+{
+	ledtrig_ide_activity();	
+	return ata_qc_issue_prot(qc);
+}
+
+/**
  *	ata_host_intr - Handle host interrupt for given (port, task)
  *	@ap: Port on which interrupt arrived (possibly...)
  *	@qc: Taskfile currently active in engine
@@ -6316,6 +6336,7 @@
 EXPORT_SYMBOL_GPL(ata_qc_complete);
 EXPORT_SYMBOL_GPL(ata_qc_complete_multiple);
 EXPORT_SYMBOL_GPL(ata_qc_issue_prot);
+EXPORT_SYMBOL_GPL(ata_qc_issue_prot_with_ledtrigger);
 EXPORT_SYMBOL_GPL(ata_tf_load);
 EXPORT_SYMBOL_GPL(ata_tf_read);
 EXPORT_SYMBOL_GPL(ata_noop_dev_select);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2.6.22 1/3] Add LED trigger to libata core
@ 2007-03-19 21:48 ` Tony Vroon
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Vroon @ 2007-03-19 21:48 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: htejun, alan, linux-ide, linux-kernel

This adds an optional wrapper around ata_ac_issue_prot that triggers the LED layer.
I plan to use this by allowing PMU LED control on G5 towers. My test platform 
is a PowerMac 7,3 (Dual G5 2.0GHz, June 2004) with a K2 (sata_svw) controller.
Respin of an earlier patch, based on comments by Tejun Heo & Alan Cox.

Signed-off-by: Tony Vroon <chainsaw@gentoo.org>

--- linux-2.6/drivers/ata/libata-core.c.orig	2007-03-19 20:03:07.000000000 +0000
+++ linux-2.6/drivers/ata/libata-core.c	2007-03-19 21:05:50.000000000 +0000
@@ -49,6 +49,7 @@
 #include <linux/workqueue.h>
 #include <linux/jiffies.h>
 #include <linux/scatterlist.h>
+#include <linux/leds.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
@@ -5050,6 +5051,25 @@
 }
 
 /**
+ *	ata_qc_issue_prot_with_ledtrigger - trigger LED core
+ *	@qc: command to issue to device
+ *
+ *	This triggers the LED core and then calls the
+ *	regular ata_qc_issue_prot function.
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host lock)
+ *
+ *	RETURNS:
+ *	Zero on success, AC_ERR_* mask on failure
+ */
+unsigned int ata_qc_issue_prot_with_ledtrigger(struct ata_queued_cmd *qc)
+{
+	ledtrig_ide_activity();	
+	return ata_qc_issue_prot(qc);
+}
+
+/**
  *	ata_host_intr - Handle host interrupt for given (port, task)
  *	@ap: Port on which interrupt arrived (possibly...)
  *	@qc: Taskfile currently active in engine
@@ -6316,6 +6336,7 @@
 EXPORT_SYMBOL_GPL(ata_qc_complete);
 EXPORT_SYMBOL_GPL(ata_qc_complete_multiple);
 EXPORT_SYMBOL_GPL(ata_qc_issue_prot);
+EXPORT_SYMBOL_GPL(ata_qc_issue_prot_with_ledtrigger);
 EXPORT_SYMBOL_GPL(ata_tf_load);
 EXPORT_SYMBOL_GPL(ata_tf_read);
 EXPORT_SYMBOL_GPL(ata_noop_dev_select);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-19 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 21:48 [PATCH 2.6.22 1/3] Add LED trigger to libata core Tony Vroon
2007-03-19 21:48 ` Tony Vroon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.