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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1D58EB64D7 for ; Fri, 30 Jun 2023 08:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232213AbjF3ICI (ORCPT ); Fri, 30 Jun 2023 04:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbjF3ICF (ORCPT ); Fri, 30 Jun 2023 04:02:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49BD8297B for ; Fri, 30 Jun 2023 01:02:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DC42D616D6; Fri, 30 Jun 2023 08:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 723B1C433C0; Fri, 30 Jun 2023 08:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688112123; bh=jn79D4qvuULmsRPzEV+TN+Mak4KIj3BN/Rf0XDYSz6c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cPRBAGNkpyDopF4uNHu9PcP3mOARvWS4mNLQlxp1IqUDeCIVyn7Xa/wot0jW7RNtv ZgJUiOVSiwMTSN935NmhWvybiOSc5HdGCcMABYhKaF1QTV2E3RBtbboqeQBFj2NnAl eSw0GqCFHn0szg/oVGRPQL+kG1YpbfBJ9pbmj6bMsqxJliNOgQTtAtk+eteN+5p+x7 H3k39aOipxO6Zi3aq0gKA8Zo828uHxJCUsSxc68w8k9Dg3HFjJUdXASBS4aByEgGC8 zUgceyns5Sxyvzd4JEFpc7qjevf+Bk1jwVmuQmIpBmwMgR8hNXIXiXwB/i0mLxsU35 /AxjdF0GVfUTA== Date: Fri, 30 Jun 2023 10:01:59 +0200 From: Andi Shyti To: ZJVcNIDWEbB6Jq7a@shikoro Cc: Wolfram Sang , krzk@kernel.org, TonyWWang@zhaoxin.com, cobechen@zhaoxin.com, linux-i2c@vger.kernel.org Subject: Re: [PATCH v6] i2c: add support for Zhaoxin I2C controller Message-ID: <20230630080159.wvt5loiq66tuo24z@intel.intel> References: <20230614073433.280501-1-hanshu-oc@zhaoxin.com> <20230614094858.317652-1-hanshu-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Hi Hans, > > > + * registers > > > + */ > > > +/* I2C MMIO Address Constants */ > > > +#define ZXI2C_CR_L 0x00 > > > +#define ZXI2C_CPU_RDY BIT(3) > > > +#define ZXI2C_TX_END BIT(2) > > > +#define ZXI2C_RX_ACK BIT(1) > > The register layout looks similar to the i2c-wmt driver. Could this > > driver maybe be reused for your hardware? I'll stop reviewing here > > because we need to have that clear first. > > > > Thank you and happy hacking, > > > > Wolfram > > > > I just learned that they are indeed derived from the same VIA I2C IP. > The relationship between WonderMedia/VIA/Zhaoxin looks like this: > * The i2c-wmt.c driver is used on the WonderMedia/VT8500 platform, >   an ARM-based SOC from VIA. This SOC hasn't been updated in years. >   Its MAINTAINERS are also Orphan. > * Lots of VIA IP is now owned by Zhaoxin, including I2C, SMBus, etc. >   Zhaoxin adds some new features on the basis of the original I2C IP, >   such as FIFO mode. And there are plans to continue adding new >   features. > > Based on this information, we thought it might be more maintainable > to create a new driver file. I think I commented about this some times ago but then forgot. The two drivers are, indeed, very similar. We could eventually create a *-common.{c,h} file. Andi