summaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2018-01-24 16:58:18 -0700
committerAaron Durbin <adurbin@chromium.org>2018-01-25 22:36:30 +0000
commitb94a27506ebd027214124985301b553c710292af (patch)
tree9ee1a732065e0042a23a0be5447203f23b293a89 /src/soc/intel/skylake
parentd861d4e7c38a1db59d5cc9765b91f5d6048f6e17 (diff)
drivers/i2c/designware: reduce API complication for bus config
Right now dw_i2c_get_soc_cfg() is expecting the SoC to implement that callback for obtaining the bus config. However, we're currently forcing another parameter of struct device so one can do the lookup. This works for Intel-based systems since the struct device was needed to program the BAR, etc. However, from an API standpoint, it just complicates matters by needing to obtain the struct device. The SoC already has knowlege of its own devices so it can get the config itself by bus number. Therefore, remove that contraint from the API. BUG=b:70232394 Change-Id: Id8558f5deedda0963a46a532a7bf984e168fb270 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/23420 Reviewed-by: Subrata Banik <subrata.banik@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/skylake')
-rw-r--r--src/soc/intel/skylake/i2c.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/soc/intel/skylake/i2c.c b/src/soc/intel/skylake/i2c.c
index 56260d702f..baf6335ced 100644
--- a/src/soc/intel/skylake/i2c.c
+++ b/src/soc/intel/skylake/i2c.c
@@ -20,10 +20,11 @@
#include <soc/pci_devs.h>
#include "chip.h"
-const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus,
- const struct device *dev)
+const struct dw_i2c_bus_config *dw_i2c_get_soc_cfg(unsigned int bus)
{
const struct soc_intel_skylake_config *config;
+ const struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT);
+
if (!dev || !dev->chip_info) {
printk(BIOS_ERR, "%s: Could not find SoC devicetree config!\n",
__func__);