lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 7 Aug 2020 10:16:08 +0800
From:   Gene Chen <gene.chen.richtek@...il.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Lee Jones <lee.jones@...aro.org>,
        Matthias Brugger <matthias.bgg@...il.com>, rafael@...nel.org,
        gregkh@...uxfoundation.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Gene Chen <gene_chen@...htek.com>, benjamin.chao@...iatek.com,
        shufan_lee@...htek.com, cy_huang@...htek.com
Subject: Re: [PATCH 9/9] mfd: mt6360: Merge different sub-devices I2C read/write

Mark Brown <broonie@...nel.org> 於 2020年8月6日 週四 下午8:13寫道:
>
> On Thu, Aug 06, 2020 at 11:30:56AM +0800, Gene Chen wrote:
> > Mark Brown <broonie@...nel.org> 於 2020年8月6日 週四 上午12:10寫道:
>
> > > 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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ