From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6D03C43460 for ; Wed, 19 May 2021 08:09:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A67B5613AA for ; Wed, 19 May 2021 08:09:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A67B5613AA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lNP/D6eJTaWWqXRTMS9YBP08h1hH85LbCz8N1pEBJ/g=; b=ia7R7rkfJIVyNVuUs5adSy2Kv KoDttspyys8c6LM3qdKP1xcSRVlIpX/T1kX0Q47rz00pvn2gM6w+iU7WFPO24fV79GK41jAR66qew URpYjA81hdv6gnbpsctvgdwFixNlyPj1JJSAozhgLYv3ZHhOU8y20b/3zIj51bzY472jOTSG8DfGj E1Ha8n5pmKKRx9cA8/ioiicfcXhoHWEDKDQUp0xHQvVg2RuNvLOgqidwW2ldzn+R62qqbv68D+xe2 h3UMXKDETYXqyT6ze7Dz98UUiHLUXwB1UIDjYEm+I7tPA6VtKQMfngZKtuZ5tsgrNKGo/9L7VaM5O /W2/1Cj8A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljHEp-003HhW-9M; Wed, 19 May 2021 08:07:31 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljHEn-003HhG-44 for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 08:07:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ByjkMY/Dlk46nmmuejES43mmTW4ai+n/YIVUNzYJBbY=; b=uJJDqkC/p9XT64iUJQUc5hqhOd 2bEsQYav5S3qQ1kYSi4RhUsCFhHQw23wC/PsOZBqEFNx7wucYJQ6/RyQPrnKBMNi+l8hY4DCxibrY 5i+8vCBKrEdFemW0JHnonVrsi/5rh+7vD7CR0u401cDw+jNyTmyCi0zScO88ngwweQzS5LcCpiceB CIXoWQ0F6huFnDdu9nrTwNIC+pfh1Ygl5XE8iBX3Ehljy6z9cs975a6+GhbS8j1gMjH8nsyx7WDw3 MSSnGuvZ4lSxA2yRHOAKk5+fUvX3HgxVK6mgM6I/yfUx0Nhdi6IdV3Ya8BJFQp392w/GgeRpqBxmX 2syBavKA==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljHD9-00Ekhk-R1 for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 08:06:19 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 14J7q99e033711; Wed, 19 May 2021 15:52:09 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from localhost.localdomain (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 19 May 2021 16:04:46 +0800 From: Jamin Lin To: Rob Herring , Joel Stanley , "Andrew Jeffery" , Brendan Higgins , Benjamin Herrenschmidt , Rayn Chen , "open list:I2C SUBSYSTEM HOST DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , "moderated list:ARM/ASPEED I2C DRIVER" CC: , , , , Subject: [PATCH 1/3] i2c: aspeed: avoid new registers definition of AST2600 Date: Wed, 19 May 2021 16:04:27 +0800 Message-ID: <20210519080436.18975-2-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210519080436.18975-1-jamin_lin@aspeedtech.com> References: <20210519080436.18975-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 14J7q99e033711 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210519_090609_667134_FC397E99 X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The register definition between AST2600 A2 and A3 is different. This patch avoid new registers definition of AST2600 to use this driver. We will submit the path for the new registers definition of AST2600. Signed-off-by: Jamin Lin --- drivers/i2c/busses/i2c-aspeed.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 724bf30600d6..007309077d9f 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -19,14 +19,20 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include +/* I2C Global Registers */ +/* 0x0c : I2CG Global Control Register (AST2500) */ +#define ASPEED_I2CG_GLOBAL_CTRL_REG 0x0c + /* I2C Register */ #define ASPEED_I2C_FUN_CTRL_REG 0x00 #define ASPEED_I2C_AC_TIMING_REG1 0x04 @@ -973,6 +979,22 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev) struct resource *res; int irq, ret; + if (of_device_is_compatible(pdev->dev.of_node, + "aspeed,ast2600-i2c-bus")) { + u32 global_ctrl; + struct regmap *gr_regmap; + + gr_regmap = syscon_regmap_lookup_by_compatible("aspeed,ast2600-i2c-global"); + + if (IS_ERR(gr_regmap)) { + ret = PTR_ERR(gr_regmap); + } else { + regmap_read(gr_regmap, ASPEED_I2CG_GLOBAL_CTRL_REG, &global_ctrl); + if (global_ctrl & BIT(2)) + return -EIO; + } + } + bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL); if (!bus) return -ENOMEM; -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel