Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1072789rda; Mon, 23 Oct 2023 01:13:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFeMInugd9NlzNKAIRfo2KuKpAu820VEzRDYb0aCoz9VvGwcSetX9uaPwQG6jEkJSbXNuc X-Received: by 2002:a05:6358:429f:b0:166:d4e5:5039 with SMTP id s31-20020a056358429f00b00166d4e55039mr11556842rwc.22.1698048828084; Mon, 23 Oct 2023 01:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698048828; cv=none; d=google.com; s=arc-20160816; b=BWzS2L8WKPjtiLT4x/DIxm08v9HnxN42CpIJzqpjTpm31bZ4wezybqhQDxV8g7LoCB uok5aCDORjBQcfu/Tq90s/z0ad9zsljxh0Q3+HaWEyzei79i7r5GPmTDD4suNzuwCIHz 3Uf+uoVxktT4sRZSKEDjaZP2ktYIPKzcnNcwBkyWiCd9xzDGRAckkdwKpFA4QBm68qIf D9B+A/D293IHS0xFvrTXorWk/JYuv6UWXuqDluvaVpOOFgya+68sTbxOr0LNq1vTTGoT rYKo+mFSUrVkfEbk/xcH45hCQqRh7GdC3UXtP7K8gy2O1TD+ZQ3RZbDA1m3EnSUg3LE4 OeHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Ay7FozbEJfLQ5EcQgUmDHbRaQ/fgcjWcAzrltfzFFIE=; fh=ZqJ3xrq0DGyvWtPBQo5VWOM7gaftcxyjM72UWd4YoC8=; b=q85uPTZyqh/S8sW0G+DPvDA3TFtpMd5ddtz7xyzk1g2LW6ibHlbR8oiKegUz2C+NW7 PTRhvwGLqS+5Tn9u7JOi6k6m/jYYEFF7JgZgGKyCUnOoIdK9HBYacvPFHDL87vvkHafE IVfxsC50Y6UADFwVgZlKM6e1g+f3yrtSqw9pIgdtMNhH8s7pmGMTU5pX5PxkozYt77IG gLmM0QR5bQaxWspbBC8yeOfccVosKi5on45uPqp3TTSn4tVEpnSNxtYQmuFOwdZpl+D+ UgIcm91Io1NzMDonOVIsFohqoCHYU3a+K00P01kA83zAJ+KRNsTqZGZitX6DlTGF6Hpi LACQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id i189-20020a639dc6000000b005b86117eb7esi5830068pgd.85.2023.10.23.01.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 69C8580440D9; Mon, 23 Oct 2023 01:13:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232316AbjJWINj (ORCPT + 99 others); Mon, 23 Oct 2023 04:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbjJWINM (ORCPT ); Mon, 23 Oct 2023 04:13:12 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7A0910C8; Mon, 23 Oct 2023 01:13:08 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 39N8CYVU060250; Mon, 23 Oct 2023 16:12:34 +0800 (+08) (envelope-from Huangzheng.Lai@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx04.spreadtrum.com [10.0.1.214]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4SDSVh0GKCz2LHnPx; Mon, 23 Oct 2023 16:08:12 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx04.spreadtrum.com (10.0.1.214) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 23 Oct 2023 16:12:32 +0800 From: Huangzheng Lai To: Andi Shyti CC: Orson Zhai , Baolin Wang , Chunyan Zhang , , , huangzheng lai , Huangzheng Lai , Xiongpeng Wu Subject: [PATCH V2 7/7] i2c: sprd: Add I2C_NACK_EN and I2C_TRANS_EN control bits Date: Mon, 23 Oct 2023 16:11:58 +0800 Message-ID: <20231023081158.10654-8-Huangzheng.Lai@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231023081158.10654-1-Huangzheng.Lai@unisoc.com> References: <20231023081158.10654-1-Huangzheng.Lai@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To shmbx04.spreadtrum.com (10.0.1.214) X-MAIL: SHSQR01.spreadtrum.com 39N8CYVU060250 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 01:13:45 -0700 (PDT) The new I2C IP version on the UNISOC platform has added I2C_NACK_EN and I2C_TRANS_EN control bits. To ensure that the I2C controller can initiate transmission smoothly, these two bits need to be configured. Signed-off-by: Huangzheng Lai --- drivers/i2c/busses/i2c-sprd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c index dbdac89ad482..431c0db84d22 100644 --- a/drivers/i2c/busses/i2c-sprd.c +++ b/drivers/i2c/busses/i2c-sprd.c @@ -33,6 +33,8 @@ #define ADDR_RST 0x2c /* I2C_CTL */ +#define I2C_NACK_EN BIT(22) +#define I2C_TRANS_EN BIT(21) #define STP_EN BIT(20) #define FIFO_AF_LVL_MASK GENMASK(19, 16) #define FIFO_AF_LVL 16 @@ -366,7 +368,7 @@ static void sprd_i2c_enable(struct sprd_i2c *i2c_dev) sprd_i2c_clear_irq(i2c_dev); tmp = readl(i2c_dev->base + I2C_CTL); - writel(tmp | I2C_EN | I2C_INT_EN, i2c_dev->base + I2C_CTL); + writel(tmp | I2C_EN | I2C_INT_EN | I2C_NACK_EN | I2C_TRANS_EN, i2c_dev->base + I2C_CTL); } static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap, -- 2.17.1