From patchwork Tue Jun 23 02:51:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 191403 Delivered-To: patches@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp1589277ile; Mon, 22 Jun 2020 19:51:47 -0700 (PDT) X-Received: by 2002:a17:90b:1a86:: with SMTP id ng6mr6269294pjb.88.1592880707613; Mon, 22 Jun 2020 19:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592880707; cv=none; d=google.com; s=arc-20160816; b=xnF2Kgy8tXxS2QLOKal/1FxmEtg4nveORLBmnA5TiMOBmuN7KwudvW6cvF3nz1KE/F pxhooo2+k0msUS7/0zhAA6e6mAOdoPWL8JwCEkE69pdujVOegO+Ip/TtdITo6bC8jgJT 5R2HbszbJJ8KLzKsDDWaqGQLq3T3oLN6j8T4LLnpMPTOh02PbqJ4v+2hpdp8dnjA4Wo4 rOfwQQwjKQWKdqE5ZHLlfwH/X4Crb/wr92tkrah2sDw9iZUA2b5DiMjesrR8Ia3gHhKi zgpmbCTeHzjK0boUxwgyQPHSM9YV4a4rO0jsPbspUggCureznDYQzqaGxOQIlLKA3LTO Nu5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=Bkqe8eP6qav0NO7h7H0YnVgLuAUP47V9yLKohTYScP4=; b=K6EkBMma5HaXJWUihtUf29H+HbYUGdd5BULaTRxy3bNkIBmJAw7bKWeS8rU4cSHERM YEFAwZssPVjxiclUd/Rup4tHnzNIM/fMepeOmk6Q5TH1g6+J+soUzjxLcNxIb3xvc09o JQvbQXPGTv6YgCaxZle8JR7RbtMBLErtEp5Y7JhP9kMF9jTkYLel/jIjZXZyzJ+Old+P XAYuR2aABKx8vrDTmdg5LL3Z64rkHhr8oiTM3KXTC8qIxVwwvwxOG0pRab5SFwwC9UPc w1xqEr4oIGWCxXM6KoUd76hik9+65NQh6ZxHy3OtU0oH+Q0sAutX5qdZC1aPJHBi/mFg 6oeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SacbG/sM"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h18sor5224273plr.14.2020.06.22.19.51.47 for (Google Transport Security); Mon, 22 Jun 2020 19:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SacbG/sM"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Bkqe8eP6qav0NO7h7H0YnVgLuAUP47V9yLKohTYScP4=; b=SacbG/sMALx094GrI3w7UgttPeQ0KM2G3AoODCvFQJGFJ5vln9En6Frb+o9dKibvSg Okny/UMLQJ0rhbLGQCyBu5QdK9UVQ6bkIbPfzInNDmXXD1VDvL4Fk5eQnAF6Sj3p2w2Y 2+FdERPjM6wES4ug+qUdx3gg4X7vQHpHE8DiQ0xiITzjC2e4JMKiuenvvQityR3Vg9D9 PxSZHeUFisHW6YGR24OuLF+Fkp6WcuDGEoDhwAhouEVR26WTM7LJ9rRq9VWGfpMusq71 kp0t2+FGL7LqQPW3OOCbVJWMZ6bbxHBot6lBBdjtBD79Tw29zxpM1olGSTmWEhdi2TsC cQsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Bkqe8eP6qav0NO7h7H0YnVgLuAUP47V9yLKohTYScP4=; b=tYkQz2QBZKjmVa5lhZvPc3pCjw9gUMIP2Zz+EkB9Hh2PaEnexKTwIhOUfTw8fqLeSh shROif6ORfIo07HlU4VAWs+E0OP1f8LnIBAhVCZJTl5N98LEIVsW3ChrNksKmWg+C3q7 3REwgmRPlSpoksyQU3kYFzPmoTPiLV0zRFpwEWV77AgPNNwVLNoVXL+OKI5QXuR+D2iT dcEiJ3cC3XZVarfh4pQbMa00caxPRDeMpNvLW24XshNyAuhwZKWuyp9Qw8OOLNtFfkxt 8vfdrZNy8FJZqY8mD5QPsEaCtUf/dDduwX9cFy5ZKxWenHBtqPHUPznFhGDqscNs40mc AR9w== X-Gm-Message-State: AOAM533fKTFpMvrEqcPmZqmewFzvx+rvaWXq6tjyvsFlWqtk5Mbo1ojN ong9mSWuGXRDzgn9mzFdnJ3AttFj X-Google-Smtp-Source: ABdhPJwQKgj2PeBSrZqxgChMqadOaXI5DuaCAkwJY1oO+kXbbPkv3BV7iGHMfNyJ7tZr2wPjeTAnMQ== X-Received: by 2002:a17:902:ba83:: with SMTP id k3mr22973488pls.261.1592880707148; Mon, 22 Jun 2020 19:51:47 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y7sm15807629pfq.43.2020.06.22.19.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 19:51:46 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Andy Shevchenko , Jarkko Nikula , Wolfram Sang , linux-i2c@vger.kernel.org Subject: [PATCH] i2c: designware: Fix functionality in !CONFIG_ACPI case Date: Tue, 23 Jun 2020 02:51:44 +0000 Message-Id: <20200623025144.34246-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 On the HiKey board, where CONFIG_ACPI is not set, we started to see a graphics regression where the adv7511 HDMI bridge driver wasn't probing. This was due to the i2c bus failing to start up. I bisected the problem down to commit f9288fcc5c615 ("i2c: designware: Move ACPI parts into common module") and after looking at it a bit, I realized that change moved some initialization into i2c_dw_acpi_adjust_bus_speed(). However, i2c_dw_acpi_adjust_bus_speed() is only functional if CONFIG_ACPI is set. This patch pulls i2c_dw_acpi_adjust_bus_speed() out of the ifdef CONFIG_ACPI conditional, and gets the board working again. Cc: Andy Shevchenko Cc: Jarkko Nikula Cc: Wolfram Sang Cc: linux-i2c@vger.kernel.org Fixes: f9288fcc5c615 ("i2c: designware: Move ACPI parts into common module") Signed-off-by: John Stultz --- drivers/i2c/busses/i2c-designware-common.c | 4 ++-- drivers/i2c/busses/i2c-designware-core.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c index e3a8640db7da..33de185e15f2 100644 --- a/drivers/i2c/busses/i2c-designware-common.c +++ b/drivers/i2c/busses/i2c-designware-common.c @@ -286,6 +286,8 @@ int i2c_dw_acpi_configure(struct device *device) } EXPORT_SYMBOL_GPL(i2c_dw_acpi_configure); +#endif /* CONFIG_ACPI */ + void i2c_dw_acpi_adjust_bus_speed(struct device *device) { struct dw_i2c_dev *dev = dev_get_drvdata(device); @@ -317,8 +319,6 @@ void i2c_dw_acpi_adjust_bus_speed(struct device *device) } EXPORT_SYMBOL_GPL(i2c_dw_acpi_adjust_bus_speed); -#endif /* CONFIG_ACPI */ - u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset) { /* diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h index 556673a1f61b..ea2485872cab 100644 --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h @@ -364,8 +364,7 @@ int i2c_dw_validate_speed(struct dw_i2c_dev *dev); #if IS_ENABLED(CONFIG_ACPI) int i2c_dw_acpi_configure(struct device *device); -void i2c_dw_acpi_adjust_bus_speed(struct device *device); #else static inline int i2c_dw_acpi_configure(struct device *device) { return -ENODEV; } -static inline void i2c_dw_acpi_adjust_bus_speed(struct device *device) {} #endif +void i2c_dw_acpi_adjust_bus_speed(struct device *device);