All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Bostic <cbostic@linux.vnet.ibm.com>
To: joel@jms.id.au
Cc: Eddie James <eajames@us.ibm.com>,
	openbmc@lists.ozlabs.org,
	Christopher Bostic <cbostic@linux.vnet.ibm.com>
Subject: [PATCH linux dev-4.10 2/7] drivers/fsi: Add Client IRQ Enable / Disable
Date: Tue,  9 May 2017 16:38:57 -0500	[thread overview]
Message-ID: <20170509213902.37939-3-cbostic@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170509213902.37939-1-cbostic@linux.vnet.ibm.com>

From: Eddie James <eajames@us.ibm.com>

Allow FSI client drivers to enable and disable their engine
IRQ's via the exported interfaces fsi_enable_irq and
fsi_disable_irq.

Signed-off-by: Eddie James <eajames@us.ibm.com>
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
---
 drivers/fsi/fsi-core.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 73fdb69..ca3021f 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -973,12 +973,57 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv)
 
 int fsi_enable_irq(struct fsi_device *dev)
 {
+	int rc;
+	uint32_t si1m;
+	uint32_t bit = 0x80000000 >> dev->si1s_bit;
+	struct fsi_master *master = dev->slave->master;
+
+	if (!dev->irq_handler)
+		return -EINVAL;
+
+	rc = master->read(master, 0, 0, FSI_SLAVE_BASE + FSI_SI1M, &si1m,
+			sizeof(uint32_t));
+	if (rc) {
+		dev_err(&master->dev, "Coudn't read si1m:%d\n", rc);
+		return rc;
+	}
+
+	si1m |= bit;
+	rc = master->write(master, 0, 0, FSI_SLAVE_BASE + FSI_SI1M, &si1m,
+			sizeof(uint32_t));
+	if (rc) {
+		dev_err(&master->dev, "Coudn't write si1m:%d\n", rc);
+		return rc;
+	}
+
+	master->ipoll |= bit;
 	return 0;
 }
 EXPORT_SYMBOL(fsi_enable_irq);
 
 void fsi_disable_irq(struct fsi_device *dev)
 {
+	int rc;
+	uint32_t si1m;
+	uint32_t bits = ~(0x80000000 >> dev->si1s_bit);
+	struct fsi_master *master = dev->slave->master;
+
+	master->ipoll &= bits;
+
+	rc = master->read(master, 0, 0, FSI_SLAVE_BASE + FSI_SI1M, &si1m,
+			sizeof(uint32_t));
+	if (rc) {
+		dev_err(&master->dev, "Couldn't read si1m:%d\n", rc);
+		return;
+	}
+
+	si1m &= bits;
+	rc = master->write(master, 0, 0, FSI_SLAVE_BASE + FSI_SI1M, &si1m,
+		sizeof(uint32_t));
+	if (rc) {
+		dev_err(&master->dev, "Coudn't write si1m:%d\n", rc);
+		return;
+	}
 }
 EXPORT_SYMBOL(fsi_disable_irq);
 
-- 
1.8.2.2

  parent reply	other threads:[~2017-05-09 21:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 21:38 [PATCH linux dev-4.10 0/7] OpenFSI Updates for dev-4.10 kernel Christopher Bostic
2017-05-09 21:38 ` [PATCH linux dev-4.10 1/7] drivers/fsi: Add slave interrupt polling Christopher Bostic
2017-05-10 22:26   ` Eddie James
2017-05-09 21:38 ` Christopher Bostic [this message]
2017-05-09 21:38 ` [PATCH linux dev-4.10 3/7] drivers/fsi: Scan for hub sourced IRQ's Christopher Bostic
2017-05-09 21:38 ` [PATCH linux dev-4.10 4/7] drivers/fsi: Set IRQ masks along hub path Christopher Bostic
2017-05-09 21:39 ` [PATCH linux dev-4.10 5/7] drivers/fsi: Unscan on master unregister Christopher Bostic
2017-05-11 12:06   ` Joel Stanley
2017-05-09 21:39 ` [PATCH linux dev-4.10 6/7] drivers/fsi: GPIO stability changes for Cronus/Hostboot Christopher Bostic
2017-05-11 12:07   ` Joel Stanley
2017-05-09 21:39 ` [PATCH linux dev-4.10 7/7] drivers/fsi: Fix one and two byte bus reads/writes Christopher Bostic
2017-05-11 12:06   ` Joel Stanley
2017-05-10  2:25 ` [PATCH linux dev-4.10 0/7] OpenFSI Updates for dev-4.10 kernel Jeremy Kerr
2017-05-10 15:46   ` Christopher Bostic
2017-05-11 12:09 ` Joel Stanley

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=20170509213902.37939-3-cbostic@linux.vnet.ibm.com \
    --to=cbostic@linux.vnet.ibm.com \
    --cc=eajames@us.ibm.com \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.