From patchwork Sun Oct 25 20:00:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1387257 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=SKNNTVr4; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CK83N1vRfz9sSs for ; Mon, 26 Oct 2020 07:00:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C9C48244B; Sun, 25 Oct 2020 21:00:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SKNNTVr4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BEF28246A; Sun, 25 Oct 2020 21:00:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D591C8244A for ; Sun, 25 Oct 2020 21:00:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x741.google.com with SMTP id t128so1481413qke.0 for ; Sun, 25 Oct 2020 13:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Nb50HA2MnisDebMy4cuI+MwsWP5EsojKg9XUwdM+P/8=; b=SKNNTVr4TrLjyxwVkc05fHMAYBPfnlWTlGgyVtKgO71IM4/D9zAncWVE6MGBhZfPrj dpY0O1tup46FTCWgOLoaHWlFqnSYeXwzz+dnuGNxPYD+aEaFA56vx7LTE5YkBGXniA/B orNyXwCAOkj0jBF9vzUAsZ5SiRf2yrI7qOJPnq2VdOcR7Ps4Lae2OYO8Ih+OERgrlw2H L7mrjck0PToiRbp1rsgH1/XZ3lIhygH7u6K+HNHIJ225ubxLgULP+JS0LEDd2nRaV9OE bVYtaAiI7Dtit1P5bR/rItP3zFNEarjnVnWcWftHkupnS1liqZcpiT7rZa02tbpU4HWD 3jpA== 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:mime-version :content-transfer-encoding; bh=Nb50HA2MnisDebMy4cuI+MwsWP5EsojKg9XUwdM+P/8=; b=ANm/9eXJGLHASuUgpoWd/Az4LqJmt8YV7tX2icuMBqPaocC9MfpR0dhEU/WvyEKhSm 3XmNLhNC8ccKLLaIURWLxG+79LpH8KjvsxOS1cxAbQo9VKA/YiaZPJjHZf7aHr4q3qMo 4kvZ3m109q8wCnrfSnEHvviLzK78QqUrK3XQbK3GX4h0MgNOBot0ctk8o+G75Nza3YCZ i7Gzmpgohx39NfjiP4UVRRPI39VX7Wy86xmLg5hqOzJsGUEmNSvJmSYDi3Xjv8d02qFm 9yCGs1nStm1fw3yrNH22i8fHEvB99LKbnsCkALRfdwgmKXrV0438zqUboA+3ZAjXybCR CZ0Q== X-Gm-Message-State: AOAM530RC2E3goJ67F9voNuOMCQqmHjicWe0E7m7JcG1MvG+FKJuSalx LOMCl9frB66P9nG+HagyxfIG6LC3VAVywg== X-Google-Smtp-Source: ABdhPJzLIxhJQz3n0hg4cd4OS9aVr5mMi7kfbjKmTyse00OJqbwLz1f+AqYbr/FKVejK0qWfPaaknQ== X-Received: by 2002:a37:7183:: with SMTP id m125mr13823618qkc.237.1603656021340; Sun, 25 Oct 2020 13:00:21 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id x6sm3397149qto.48.2020.10.25.13.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 13:00:20 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Rick Chen , Simon Glass , Damien Le Moal , Sean Anderson Subject: [PATCH 1/2] pinctrl: k210: Fix inverted IE and OE for I2C Date: Sun, 25 Oct 2020 16:00:09 -0400 Message-Id: <20201025200010.550920-1-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and IE_INV set, but I2C cannot have those bits set. This adds a separate default for SCCB. Signed-off-by: Sean Anderson Reported-by: Damien Le Moal Reviewed-by: Rick Chen --- drivers/pinctrl/pinctrl-kendryte.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-kendryte.c b/drivers/pinctrl/pinctrl-kendryte.c index 5ad049d955..259a0b507b 100644 --- a/drivers/pinctrl/pinctrl-kendryte.c +++ b/drivers/pinctrl/pinctrl-kendryte.c @@ -55,8 +55,9 @@ #define K210_PC_MODE_IN (K210_PC_IE | K210_PC_ST) #define K210_PC_MODE_OUT (K210_PC_DRIVE_7 | K210_PC_OE) -#define K210_PC_MODE_I2C (K210_PC_MODE_IN | K210_PC_IE_INV | K210_PC_SL | \ - K210_PC_OE | K210_PC_OE_INV | K210_PC_PU) +#define K210_PC_MODE_I2C (K210_PC_MODE_IN | K210_PC_SL | K210_PC_OE | \ + K210_PC_PU) +#define K210_PC_MODE_SCCB (K210_PC_MODE_I2C | K210_PC_OE_INV | K210_PC_IE_INV) #define K210_PC_MODE_SPI (K210_PC_MODE_IN | K210_PC_IE_INV | \ K210_PC_MODE_OUT | K210_PC_OE_INV) #define K210_PC_MODE_GPIO (K210_PC_MODE_IN | K210_PC_MODE_OUT) @@ -189,6 +190,7 @@ static const u32 k210_pc_mode_id_to_mode[] = { [K210_PC_DEFAULT_IN_TIE] = K210_PC_MODE_IN, DEFAULT(OUT), DEFAULT(I2C), + DEFAULT(SCCB), DEFAULT(SPI), DEFAULT(GPIO), [K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU, @@ -362,8 +364,8 @@ static const struct k210_pcf_info k210_pcf_infos[] = { FUNC(DVP_D5, IN), FUNC(DVP_D6, IN), FUNC(DVP_D7, IN), - FUNC(SCCB_SCLK, I2C), - FUNC(SCCB_SDA, I2C), + FUNC(SCCB_SCLK, SCCB), + FUNC(SCCB_SDA, SCCB), FUNC(UART1_CTS, IN), FUNC(UART1_DSR, IN), FUNC(UART1_DCD, IN),