public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	Alexander Usyskin <alexander.usyskin@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 3/3] mei: add WPT second mei interface
Date: Tue, 13 May 2014 11:22:01 +0300	[thread overview]
Message-ID: <1399969321-6512-4-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1399969321-6512-1-git-send-email-tomas.winkler@intel.com>

From: Alexander Usyskin <alexander.usyskin@intel.com>

Add WPT second mei interface.
In order for correct device numbering we add mei device interface id
to to mei_cfg structure

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/hw-me-regs.h | 1 +
 drivers/misc/mei/hw-me.c      | 5 +++++
 drivers/misc/mei/hw-me.h      | 1 +
 drivers/misc/mei/main.c       | 2 +-
 drivers/misc/mei/mei_dev.h    | 2 ++
 drivers/misc/mei/pci-me.c     | 1 +
 6 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
index a7856c0..c5feafd 100644
--- a/drivers/misc/mei/hw-me-regs.h
+++ b/drivers/misc/mei/hw-me-regs.h
@@ -115,6 +115,7 @@
 #define MEI_DEV_ID_LPT_HR     0x8CBA  /* Lynx Point H Refresh */
 
 #define MEI_DEV_ID_WPT_LP     0x9CBA  /* Wildcat Point LP */
+#define MEI_DEV_ID_WPT_LP_2   0x9CBB  /* Wildcat Point LP 2 */
 
 /* Host Firmware Status Registers in PCI Config Space */
 #define PCI_CFG_HFS_1         0x40
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 6a2d272..9066bb1 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -844,6 +844,11 @@ const struct mei_cfg mei_me_pch_cfg = {
 	MEI_CFG_PCH_HFS,
 };
 
+/* PCH devices MEI 2 interface */
+const struct mei_cfg mei_me_pch_2_cfg = {
+	MEI_CFG_PCH_HFS,
+	.mei_id = 1
+};
 
 /* PCH Cougar Point and Patsburg with quirk for Node Manager exclusion */
 const struct mei_cfg mei_me_pch_cpt_pbg_cfg = {
diff --git a/drivers/misc/mei/hw-me.h b/drivers/misc/mei/hw-me.h
index 12b0f4b..6fb841f 100644
--- a/drivers/misc/mei/hw-me.h
+++ b/drivers/misc/mei/hw-me.h
@@ -41,6 +41,7 @@ struct mei_me_hw {
 extern const struct mei_cfg mei_me_legacy_cfg;
 extern const struct mei_cfg mei_me_ich_cfg;
 extern const struct mei_cfg mei_me_pch_cfg;
+extern const struct mei_cfg mei_me_pch_2_cfg;
 extern const struct mei_cfg mei_me_pch_cpt_pbg_cfg;
 extern const struct mei_cfg mei_me_lpt_cfg;
 
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index c58e059..cf4ed5a 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -667,7 +667,7 @@ int mei_register(struct mei_device *dev)
 {
 
 	int ret, devno;
-	int id = 0; /* FIXME: retrieve interface version*/
+	int id = dev->cfg->mei_id;
 
 	/* Fill in the data structures */
 	devno = MKDEV(MAJOR(mei_devt), id);
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index a418565..a521783 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -384,10 +384,12 @@ enum mei_pg_state {
  *
  * @fw_status - FW status
  * @quirk_probe - device exclusion quirk
+ * @mei_id - id of mei device
  */
 struct mei_cfg {
 	const struct mei_fw_status fw_status;
 	bool (*quirk_probe)(struct pci_dev *pdev);
+	int mei_id;
 };
 
 
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index cf4f654..bb1a8c9 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -81,6 +81,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
 	{MEI_PCI_DEVICE(MEI_DEV_ID_LPT_LP, mei_me_pch_cfg)},
 	{MEI_PCI_DEVICE(MEI_DEV_ID_LPT_HR, mei_me_lpt_cfg)},
 	{MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP, mei_me_pch_cfg)},
+	{MEI_PCI_DEVICE(MEI_DEV_ID_WPT_LP_2, mei_me_pch_2_cfg)},
 
 	/* required last entry */
 	{0, }
-- 
1.9.0


  parent reply	other threads:[~2014-05-13  8:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  8:21 [char-misc-next 0/3] mei support more devices Tomas Winkler
2014-05-13  8:21 ` [char-misc-next 1/3] mei: move from misc to char device Tomas Winkler
2014-05-27 21:20   ` Greg KH
2014-05-13  8:22 ` [char-misc-next 2/3] mei: sysfs: add Documentation mei class attributes Tomas Winkler
2014-05-13  8:22 ` Tomas Winkler [this message]
2014-05-27 21:22   ` [char-misc-next 3/3] mei: add WPT second mei interface Greg KH
2014-05-27 21:42     ` Winkler, Tomas
2014-05-27 22:06       ` Greg KH
2014-05-27 23:47         ` Winkler, Tomas
2014-05-28  0:35           ` Greg KH

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=1399969321-6512-4-git-send-email-tomas.winkler@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=alexander.usyskin@intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.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: link
Be 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