diff mbox series

[v1,29/43] p2sb: Add a method to hide the bus

Message ID 20200614215726.v1.29.I1f931671a92c0c6eaed9247d847329360accaa80@changeid
State Accepted
Commit 6d349e2e435340bf27c8f567f7607eaaba2ee77c
Headers show
Series x86: Programmatic generation of ACPI tables (Part C) | expand

Commit Message

Simon Glass June 15, 2020, 3:57 a.m. UTC
The P2SB bus needs to be hidden in some cases so that it does not get
auto-configured by Linux. Add a method for this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 drivers/misc/p2sb-uclass.c | 10 ++++++++++
 include/p2sb.h             | 25 ++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

Comments

Wolfgang Wallner June 23, 2020, 10:49 a.m. UTC | #1
Hi Simon,

-----"Simon Glass" <sjg at chromium.org> schrieb: -----

> Betreff: [PATCH v1 29/43] p2sb: Add a method to hide the bus
> 
> The P2SB bus needs to be hidden in some cases so that it does not get
> auto-configured by Linux. Add a method for this.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
>  drivers/misc/p2sb-uclass.c | 10 ++++++++++
>  include/p2sb.h             | 25 ++++++++++++++++++++++++-
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 

Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>

Tested-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
Tested on an Apollo Lake-based board.
Bin Meng June 30, 2020, 7:54 a.m. UTC | #2
On Mon, Jun 15, 2020 at 11:58 AM Simon Glass <sjg at chromium.org> wrote:
>
> The P2SB bus needs to be hidden in some cases so that it does not get
> auto-configured by Linux. Add a method for this.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  drivers/misc/p2sb-uclass.c | 10 ++++++++++
>  include/p2sb.h             | 25 ++++++++++++++++++++++++-
>  2 files changed, 34 insertions(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/drivers/misc/p2sb-uclass.c b/drivers/misc/p2sb-uclass.c
index d5fe12ebd8..b5219df46b 100644
--- a/drivers/misc/p2sb-uclass.c
+++ b/drivers/misc/p2sb-uclass.c
@@ -18,6 +18,16 @@ 
 
 #define PCR_COMMON_IOSF_1_0	1
 
+int p2sb_set_hide(struct udevice *dev, bool hide)
+{
+	struct p2sb_ops *ops = p2sb_get_ops(dev);
+
+	if (!ops->set_hide)
+		return -ENOSYS;
+
+	return ops->set_hide(dev, hide);
+}
+
 void *pcr_reg_address(struct udevice *dev, uint offset)
 {
 	struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
diff --git a/include/p2sb.h b/include/p2sb.h
index 74eb08b7ff..93e1155dca 100644
--- a/include/p2sb.h
+++ b/include/p2sb.h
@@ -31,13 +31,36 @@  struct p2sb_uc_priv {
 };
 
 /**
- * struct p2sb_ops - Operations for the P2SB (none at present)
+ * struct p2sb_ops - Operations for the P2SB
  */
 struct p2sb_ops {
+	/**
+	 * set_hide() - Set/clear the 'hide' bit on the p2sb
+	 *
+	 * This device can be hidden from the PCI bus if needed. This method
+	 * can be called before the p2sb is probed.
+	 *
+	 * @dev: P2SB device
+	 * @hide: true to hide the device, false to show it
+	 * @return 0 if OK, -ve on error
+	 */
+	int (*set_hide)(struct udevice *dev, bool hide);
 };
 
 #define p2sb_get_ops(dev)        ((struct p2sb_ops *)(dev)->driver->ops)
 
+/**
+ * p2sb_set_hide() - Set/clear the 'hide' bit on the p2sb
+ *
+ * This device can be hidden from the PCI bus if needed. This method
+ * can be called before the p2sb is probed.
+ *
+ * @dev: P2SB device
+ * @hide: true to hide the device, false to show it
+ * @return 0 if OK, -ve on error
+ */
+int p2sb_set_hide(struct udevice *dev, bool hide);
+
 /**
  * pcr_read32/16/8() - Read from a PCR device
  *