LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Tony Vroon <chainsaw@gentoo.org> To: Jeff Garzik <jgarzik@pobox.com> Cc: <htejun@gmail.com>, <alan@lxorguk.ukuu.org.uk>, <linux-ide@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH 2.6.22 RESEND] Optional LED trigger for libata Date: Tue, 20 Mar 2007 09:26:12 +0000 (GMT) [thread overview] Message-ID: <20070320092612.82EF65B80F1@ganymede.vroon.org> (raw) This adds an optional wrapper around ata_ac_issue_prot that triggers the LED layer. This is used for the PMU LED on G5 towers (IDE trigger). My test platform is a PowerMac 7,3 (Dual G5 2.0GHz, June 2004) with a K2 (sata_svw) controller. Now respun as a single patch, and the function name shortened as requested. Signed-off-by: Tony Vroon <chainsaw@gentoo.org> diff -uNr linux-2.6.ORIG/drivers/ata/libata-core.c linux-2.6/drivers/ata/libata-core.c --- linux-2.6.ORIG/drivers/ata/libata-core.c 2007-03-20 09:10:44.000000000 +0000 +++ linux-2.6/drivers/ata/libata-core.c 2007-03-20 09:17:53.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_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_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_ledtrigger); EXPORT_SYMBOL_GPL(ata_tf_load); EXPORT_SYMBOL_GPL(ata_tf_read); EXPORT_SYMBOL_GPL(ata_noop_dev_select); diff -uNr linux-2.6.ORIG/drivers/ata/sata_svw.c linux-2.6/drivers/ata/sata_svw.c --- linux-2.6.ORIG/drivers/ata/sata_svw.c 2007-03-20 09:10:44.000000000 +0000 +++ linux-2.6/drivers/ata/sata_svw.c 2007-03-20 09:17:17.000000000 +0000 @@ -348,7 +348,7 @@ .bmdma_stop = ata_bmdma_stop, .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, - .qc_issue = ata_qc_issue_prot, + .qc_issue = ata_qc_issue_prot_ledtrigger, .data_xfer = ata_data_xfer, .freeze = ata_bmdma_freeze, .thaw = ata_bmdma_thaw, diff -uNr linux-2.6.ORIG/include/linux/libata.h linux-2.6/include/linux/libata.h --- linux-2.6.ORIG/include/linux/libata.h 2007-03-20 09:11:46.000000000 +0000 +++ linux-2.6/include/linux/libata.h 2007-03-20 09:17:32.000000000 +0000 @@ -786,6 +786,7 @@ extern void ata_qc_prep(struct ata_queued_cmd *qc); extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); +extern unsigned int ata_qc_issue_prot_ledtrigger(struct ata_queued_cmd *qc); extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen); extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
next reply other threads:[~2007-03-20 9:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-03-20 9:26 Tony Vroon [this message] 2007-03-20 9:30 ` [PATCH 2.6.22 RESEND] Optional LED trigger for libata Tejun Heo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20070320092612.82EF65B80F1@ganymede.vroon.org \ --to=chainsaw@gentoo.org \ --cc=alan@lxorguk.ukuu.org.uk \ --cc=htejun@gmail.com \ --cc=jgarzik@pobox.com \ --cc=linux-ide@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).