Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2105201pxa; Fri, 7 Aug 2020 03:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKQ/AqHOKj76Fr55SMb2inUK/aCebPvkvxF8sXk056OSRh37SxtWTLvvjaP/6x0X4sfkna X-Received: by 2002:aa7:d607:: with SMTP id c7mr8095301edr.184.1596795561481; Fri, 07 Aug 2020 03:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596795561; cv=none; d=google.com; s=arc-20160816; b=Uv7TIfh894val/M5D/pJvqjZYAfLQfT1b+zisSh1KnwRF27PXPaRRLPUJc0fmjDv5m rQ/uybBvaxUu5RojRsxCEjnJzkU0x/DfJyUV4N5WARQ5YatGPqwUgVm17Qjo1yTnEbmK 7vnr0Wub1dADNl2dIZoOWsyRRgEWuoMMTTtWOmK+VZQo5RhJV95hs1YpPbjmnanvuN96 AO8THRVqHZk246jFitK8h+lu0XX5LQVXBqF5+1+sDqz3nWvLUFEIw/X8/4UYUVtfdtBS GCNccwqetv6JBe6rAgy0yp+JErwrXDHi3I5p1lPYnxkiiBVqOPuvB2d35yHyV82LJQN4 S3Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4f8OQgzuz+LDRnj85cC5d/U7jDFEqbHAdZ2qh7RY1sE=; b=st3JoMHZ/gVAVQsTayunBhEN8so/EWzinp56SdOtvVBwNcF9e/w5soBAaELSNkKW+0 PDG8VY7uii1Wy2oEw2CA9O25ZaauZZZTjgaocSyfhc1pD0aZwPYCopVSZ3vOAWjRK2PS UYArvMNLAjSLpPPFhFta4fTNyiUUNU9pLhNESUsuY2kg348lA55BDrtFYzqFY1LDH52d ouUwgTjgRrwiYwDYWFYnjgD64kqnugd/bzCJzsExzF9IsfJh/PBMGonzx1Pfig39EC2G 7OcstuRbNka6TgzryuoL5HIxQ4jf5wyOcN+mbp4ZSLwMWj/FP7WwqsVeMfD3YVhd3jRN SK1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z1dacVuD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si4626292edn.510.2020.08.07.03.18.58; Fri, 07 Aug 2020 03:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z1dacVuD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbgHGKQV (ORCPT + 99 others); Fri, 7 Aug 2020 06:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726511AbgHGKQU (ORCPT ); Fri, 7 Aug 2020 06:16:20 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D3AFC061574 for ; Fri, 7 Aug 2020 03:16:20 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id j8so1351239ioe.9 for ; Fri, 07 Aug 2020 03:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4f8OQgzuz+LDRnj85cC5d/U7jDFEqbHAdZ2qh7RY1sE=; b=Z1dacVuDCDo1gA3yUPlpW/LbuFZJcYNg+aJDk2w4/De7ZXN7/G5RDsXBsZF7PBD63g FOdXb6jZFwbKD9NzFDRXUGHI5OtBii6Yc5csOQzqJFWgTIZfho4A3mBkhRTXmquSsGqX do1nFqWajSwCs2xrA7dLDZrqb8Pfx0s+rP/c5zi4NOG5OffLBV9V+8ukkVbgSpToQTnP fIUNXF/YqOx3/fQXxlxp6QQSnVu2fQoC+0oTDAqOP7PqnhzZRtBfXL9kEQeU+GlFgkxG vdEgwbpg8vMx54H4ICkHGh/mx4/yrc75EPs7MWRCJhkADRivNQGeKlTwUqeXvZYXC4Mj hENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4f8OQgzuz+LDRnj85cC5d/U7jDFEqbHAdZ2qh7RY1sE=; b=Z0F6pVrpe5E5rvkj5vVgNTy0tz/c2ueVobMLK21x38BulBHyG8mlf+vCJp3czLdJFT tpBVQxXd9dFqlmwX0r+hbqTOPy2I1m/H1O7DxayVYpKwMllG/V7krJbulVuhcpAnl1/t ZEsk38qvJGOIGDFRWFunubG3mY/vArK/pXAI/MMcx3tWh3Rsn1oskpZ/gQMzN6+I6J5m ux+IVvfhyhNJ2dqmEI7rF+1BM5yqrei/RQEsP7P6g5n0r5CD6Mx0/Y04FyqrAWgDOs+8 7JdvVlU1HG4D6MJAjvauSXrLspBFFVnc+3lFOAzYhgKeNp4p+BUSDTWLAZqgzVe55Qre Y6ZA== X-Gm-Message-State: AOAM533u2XiXSh4Mhs5lJrIfTha5s+ibsKAqpChlgn6p3VpID5e7a4Da G4mtkvXzA4pIKIyXqL7FqE0G0WcDLMMHqIkFeuU= X-Received: by 2002:a05:6638:1489:: with SMTP id j9mr4177977jak.22.1596795380033; Fri, 07 Aug 2020 03:16:20 -0700 (PDT) MIME-Version: 1.0 References: <1596558782-3415-1-git-send-email-gene.chen.richtek@gmail.com> <1596558782-3415-11-git-send-email-gene.chen.richtek@gmail.com> <20200805161021.GK5556@sirena.org.uk> <20200806121332.GB6442@sirena.org.uk> In-Reply-To: <20200806121332.GB6442@sirena.org.uk> From: Gene Chen Date: Fri, 7 Aug 2020 10:16:08 +0800 Message-ID: Subject: Re: [PATCH 9/9] mfd: mt6360: Merge different sub-devices I2C read/write To: Mark Brown Cc: Lee Jones , Matthias Brugger , rafael@kernel.org, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Gene Chen , benjamin.chao@mediatek.com, shufan_lee@richtek.com, cy_huang@richtek.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Brown =E6=96=BC 2020=E5=B9=B48=E6=9C=886=E6=97=A5= =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D=888:13=E5=AF=AB=E9=81=93=EF=BC=9A > > On Thu, Aug 06, 2020 at 11:30:56AM +0800, Gene Chen wrote: > > Mark Brown =E6=96=BC 2020=E5=B9=B48=E6=9C=886=E6= =97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=8812:10=E5=AF=AB=E9=81=93=EF=BC= =9A > > > > It's not clear why this isn't just done in the device regmap, there's > > > exactly one user? > > > because I use one regmap to access 4 I2C devices, > > There appears to be only one device here? > > > I need change the regmap_bus struct to fit I2C read/write with CRC bit > > Therefore, MFD reviewer suggests I can move the regmap api to regmap > > folder such as regmap-ac97.c > > AC'97 is an industry standard bus used by a range of devices in > different subsystems. You can already have custom operations for a > device just in a regular regmap using the reg_read() and reg_write() > operations which are there so devices that individual device support > doesn't need to be added to the regmap core. > I need use regmap_raw_read to access MT6360 TYPEC part, so we need implement bus read control > You really also need to write a much clearer changelog, I would be hard > pressed to tell from the changelog that this was moving things to the > regmap core rather than shuffling regmaps within the device. MT6360 has 4 I2C worker devices First, I increase reg_bits from 8 to 16 bits. Higher 8 bits, bank, indicated which worker device I want access Then, if worker devices is PMIC or LDO part, I need calculate or check CRC8 bits when we write or read data. CRC8 bits is calculated by 3 parts. 1'st part include 1 byte is worker address and R/W in LSB. 2'nd part include 1 byte is register address 3'nd part include written data or read data from MT6360 I also need 1 dummy byte when write data @Lee Jones, I found out drivers/iio/chemical/bme680_spi.c implement their own regmap_bus too. Can I move regmap control back to mt6360-core.c?