From: <Tharunkumar.Pasumarthi@microchip.com>
To: <andy.shevchenko@gmail.com>
Cc: <jsd@semihalf.com>, <wsa@kernel.org>, <krzk@kernel.org>,
<sven@svenpeter.dev>, <andriy.shevchenko@linux.intel.com>,
<linux-kernel@vger.kernel.org>, <semen.protsenko@linaro.org>,
<robh@kernel.org>, <olof@lixom.net>,
<UNGLinuxDriver@microchip.com>, <jarkko.nikula@linux.intel.com>,
<arnd@arndb.de>, <linux-i2c@vger.kernel.org>, <rafal@milecki.pl>
Subject: Re: [PATCH RFC i2c-master] i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch
Date: Thu, 25 Aug 2022 13:15:42 +0000 [thread overview]
Message-ID: <787644272b3b260980ff8b9efc317ce3194b0acc.camel@microchip.com> (raw)
In-Reply-To: <CAHp75VevAifCp_Bz5HN1MmGm7UEJWFR017kngzARfBh+Z8aAAA@mail.gmail.com>
On Wed, 2022-08-24 at 21:31 +0300, Andy Shevchenko wrote:
>
> On Wed, Aug 24, 2022 at 6:04 PM <Tharunkumar.Pasumarthi@microchip.com> wrote:
> > On Tue, 2022-08-23 at 18:05 +0300, Andy Shevchenko wrote:
> > > On Tue, Aug 23, 2022 at 08:26:03PM +0530, Tharun Kumar P wrote:
>
> ...
>
> > > > + * Author: Tharun Kumar P <tharunkumar.pasumarthi@microchip.com>
> > > > + * Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>
> > >
> > > Single or many?
> >
> > There are 2 authors for this file
>
> Do you see the issue now?
Yes, I will change 'Author' to 'Authors'
> ...
>
> > > > +#define SMB_CORE_CTRL_ESO 0x40
> > > > +#define SMB_CORE_CTRL_FW_ACK 0x10
> > >
> > > Are they bits or numbers?
> >
> > These are bits
>
> Use BIT() then. Ditto for the rest of the bits.
Okay
> ...
>
> > > > +#define SMB_IDLE_SCALING_100KHZ 0x03E803C9
> > > > +#define SMB_IDLE_SCALING_400KHZ 0x01F4009D
> > > > +#define SMB_IDLE_SCALING_1000KHZ 0x01F4009D
> > >
> > > Shouldn't these magics be decimals?
>
> This Q seems unanswered.
These magic numbers need not be decimals. Configuring registers with these
values in driver will set the time in device. However, these values do not
convey any meaning when represented in decimals.
> > > Ditto for the rest similar stuff.
> >
> > There is no direct correlation between the hex value and time. Configuring
> > registers with these values in driver will set the time in device.
>
> ...
>
> > > > +#define I2C_DIR_WRITE 0
> > > > +#define I2C_DIR_READ 1
>
> https://elixir.bootlin.com/linux/v6.0-rc2/source/include/uapi/linux/i2c.h#L24
I2C_M_RD is used in driver. But the purpose of these MACROs is different.
I2C_DIR_WRITE is used inside both pci1xxxx_i2c_write as well as in
pci1xxxx_i2c_read (for sending slave address). Thus these MACROs are required
> > > Namespace collision. Doesn't I²C core provide these?
> >
> > I am unable to find any existing MACROs for WRITE and READ in I2C core.
> > Kindly
> > let me know the MACROs
>
> ...
>
> > > > +#define PCI1XXXX_I2C_TIMEOUT 1000
> > >
> > > Units? Same to the rest similar cases.
> >
> > Unit is milliseconds
>
> So you know what to do, right?
Yes, I will change MACRO to PCI1XXXX_I2C_TIMEOUT_MS
> ...
>
> > > > +#define SMBUS_PERI_LOCK BIT(3)
> > >
> > > BIT() out of a sudden. See above.
> >
> > Will use hex value for this like in other places to maintain uniformity
>
> See above.
Okay.
> ...
>
> > > > + pci1xxxx_i2c_shutdown(i2c);
> > >
> > > Do you really need this in ->remove()? I would expect something in
> > > the ->suspend() / ->shutdown().
> >
> > pci1xxxx_i2c_shutdown API will reset the registers that are set as part of
> > pci1xxxx_i2c_init. So, this API is present in ->remove() and not in -
> > >suspend()
> > callback
>
> I understand that, but it doesn't really answer my question.
I will remove this API in ->remove() callback and add in ->suspend() callback
Thanks,
Tharun Kumar P
next prev parent reply other threads:[~2022-08-25 13:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 14:56 [PATCH RFC i2c-master] i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch Tharun Kumar P
2022-08-23 10:31 ` Krzysztof Kozlowski
2022-08-24 13:48 ` Tharunkumar.Pasumarthi
2022-08-30 14:21 ` Tharunkumar.Pasumarthi
2022-08-23 11:48 ` Christophe JAILLET
2022-08-24 13:52 ` Tharunkumar.Pasumarthi
2022-08-30 14:25 ` Tharunkumar.Pasumarthi
2022-08-23 15:05 ` Andy Shevchenko
2022-08-24 14:38 ` Tharunkumar.Pasumarthi
2022-08-24 18:31 ` Andy Shevchenko
2022-08-25 13:15 ` Tharunkumar.Pasumarthi [this message]
2022-08-25 14:22 ` Andy Shevchenko
2022-08-26 4:00 ` Tharunkumar.Pasumarthi
2022-08-26 13:03 ` Tharunkumar.Pasumarthi
2022-08-26 15:37 ` Andy Shevchenko
2022-08-29 3:00 ` Tharunkumar.Pasumarthi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=787644272b3b260980ff8b9efc317ce3194b0acc.camel@microchip.com \
--to=tharunkumar.pasumarthi@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=arnd@arndb.de \
--cc=jarkko.nikula@linux.intel.com \
--cc=jsd@semihalf.com \
--cc=krzk@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=rafal@milecki.pl \
--cc=robh@kernel.org \
--cc=semen.protsenko@linaro.org \
--cc=sven@svenpeter.dev \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox