aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/octopus/variants/phaser/variant.c
diff options
context:
space:
mode:
authorPeichao Wang <peichao.wang@bitland.corp-partner.google.com>2018-09-19 10:55:12 +0800
committerFurquan Shaikh <furquan@google.com>2018-09-26 01:00:03 +0000
commitcfab6f69b6c47154df97a8d81cb4ef31e6953945 (patch)
treeb68e4cbda199009158e8143bcacddc1a8d46ace8 /src/mainboard/google/octopus/variants/phaser/variant.c
parent1f42a38e0fb9b4f080000cb7401a5939e68ca584 (diff)
mb/google/octopus: Close unused I2C bus 7 include SCL and SDA for Phaser
Since I2C bus 7 attached the touchscreen device however Phaser units that haven't it. So for avoiding side effects, we need close I2C bus 7 SCL and SDA respectively. BUG=none TEST=according to sku_id (Phaser: 0x1, Phaser360: 0x2, Phaser360s: 0x3) distinguish whether close these gpios. Change-Id: I8ad17761f2a053dc329bbec0a0a3284d47289666 Signed-off-by: Peichao.Wang <peichao.wang@bitland.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/28669 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Jett Rink <jettrink@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/octopus/variants/phaser/variant.c')
-rw-r--r--src/mainboard/google/octopus/variants/phaser/variant.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mainboard/google/octopus/variants/phaser/variant.c b/src/mainboard/google/octopus/variants/phaser/variant.c
index 1ead5e230c..f04d8585cc 100644
--- a/src/mainboard/google/octopus/variants/phaser/variant.c
+++ b/src/mainboard/google/octopus/variants/phaser/variant.c
@@ -22,6 +22,9 @@
#include <soc/gpio.h>
#include <soc/pci_devs.h>
#include <string.h>
+#include <ec/google/chromeec/ec.h>
+
+#define SKU_UNKNOWN 0xFFFFFFFF
extern struct chip_operations drivers_i2c_generic_ops;
extern struct chip_operations drivers_i2c_hid_ops;
@@ -29,6 +32,7 @@ extern struct chip_operations drivers_i2c_hid_ops;
void variant_update_devtree(struct device *dev)
{
uint32_t bid;
+ uint32_t sku_id = SKU_UNKNOWN;
struct device *touchscreen_i2c_host;
struct device *child;
const struct bus *children_bus;
@@ -46,6 +50,16 @@ void variant_update_devtree(struct device *dev)
if (touchscreen_i2c_host == NULL)
return;
+ /* According to the sku id decide whether update touch
+ * screen device information:
+ * 1. sku id is 1 then dev->enabled = 0.
+ */
+ google_chromeec_cbi_get_sku_id(&sku_id);
+ if (sku_id == 1) {
+ touchscreen_i2c_host->enabled = 0;
+ return;
+ }
+
children_bus = touchscreen_i2c_host->link_list;
child = NULL;