From: Lee Jones <lee.jones@linaro.org>
To: Min Li <min.li.xe@renesas.com>
Cc: "sameo@linux.intel.com" <sameo@linux.intel.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH mfd v2] mfd: Add Renesas Synchronization Management Unit (SMU) support
Date: Wed, 16 Jun 2021 17:35:39 +0100 [thread overview]
Message-ID: <YMooW5AALqdaGjXz@dell> (raw)
In-Reply-To: <OS3PR01MB65937F621F5A7B6C855D3627BA0F9@OS3PR01MB6593.jpnprd01.prod.outlook.com>
On Wed, 16 Jun 2021, Min Li wrote:
> > > diff --git a/drivers/mfd/rsmu_spi.c b/drivers/mfd/rsmu_spi.c
> > > new file mode 100644
> > > index 0000000..f3a087b
> > > --- /dev/null
> > > +++ b/drivers/mfd/rsmu_spi.c
> > > @@ -0,0 +1,265 @@
> > > +// SPDX-License-Identifier: GPL-2.0+
> > > +/*
> > > + * SPI driver for the IDT ClockMatrix(TM) and 82P33xxx families of
> > > + * timing and synchronization devices.
> > > + *
> > > + * Copyright (C) 2019 Integrated Device Technology, Inc., a Renesas
> > Company.
> > > + */
> > > +
> > > +#include <linux/kernel.h>
> > > +#include <linux/module.h>
> > > +#include <linux/init.h>
> > > +#include <linux/slab.h>
> > > +#include <linux/spi/spi.h>
> > > +#include <linux/regmap.h>
> > > +#include <linux/of.h>
> > > +#include <linux/mfd/core.h>
> > > +#include <linux/mfd/rsmu.h>
> > > +#include "rsmu_private.h"
> > > +
> > > +/*
> > > + * 16-bit register address: the lower 7 bits of the register address come
> > > + * from the offset addr byte and the upper 9 bits come from the page
> > register.
> > > + */
> > > +#define RSMU_CM_PAGE_ADDR 0x7C
> > > +#define RSMU_SABRE_PAGE_ADDR 0x7F
> > > +#define RSMU_HIGHER_ADDR_MASK 0xFF80
> > > +#define RSMU_HIGHER_ADDR_SHIFT 7
> > > +#define RSMU_LOWER_ADDR_MASK 0x7F
> > > +
> > > +static int rsmu_read_device(struct rsmu_dev *rsmu, u8 reg, u8 *buf,
> > u16 bytes)
> > > +{
> > > + struct spi_device *client = to_spi_device(rsmu->dev);
> > > + struct spi_transfer xfer = {0};
> > > + struct spi_message msg;
> > > + u8 cmd[256] = {0};
> > > + u8 rsp[256] = {0};
> > > + int ret;
> > > +
> > > + cmd[0] = reg | 0x80;
> > > + xfer.rx_buf = rsp;
> > > + xfer.len = bytes + 1;
> > > + xfer.tx_buf = cmd;
> > > + xfer.bits_per_word = client->bits_per_word;
> > > + xfer.speed_hz = client->max_speed_hz;
> > > +
> > > + spi_message_init(&msg);
> > > + spi_message_add_tail(&xfer, &msg);
> > > +
> > > + ret = spi_sync(client, &msg);
> > > + if (ret >= 0)
> > > + memcpy(buf, &rsp[1], xfer.len-1);
> >
> > What's at rsp[0]? Worth a comment?
> >
>
> I don't really know. This code is being used as is and tested working.
> Can I find out and add the comment later?
Yes, please find out before you submit the next version.
> > > +MODULE_LICENSE("GPL");
> > > diff --git a/include/linux/mfd/idt82p33_reg.h
> > b/include/linux/mfd/idt82p33_reg.h
> > > new file mode 100644
> > > index 0000000..fb41ab0
> > > --- /dev/null
> > > +++ b/include/linux/mfd/idt82p33_reg.h
> > > @@ -0,0 +1,112 @@
> > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > +/* idt82p33_reg.h
> >
> > Remove the filename, they have a habit of becoming out of date.
> >
> > > + *
> > > + * Register Map - AN888_SMUforIEEE_SynchEther_82P33xxx_RevH.pdf
> > > + *
> > > + */
> >
> > Copyright.
>
> Sorry, what do you mean by this?
This file is missing a copyright header/statement.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2021-06-16 16:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 16:43 [PATCH mfd v2] mfd: Add Renesas Synchronization Management Unit (SMU) support min.li.xe
2021-06-14 20:31 ` Min Li
2021-06-14 21:40 ` Lee Jones
2021-06-15 13:50 ` Lee Jones
2021-06-15 16:38 ` Min Li
2021-06-16 7:57 ` Lee Jones
2021-06-16 14:32 ` Min Li
2021-06-16 14:51 ` Lee Jones
2021-06-16 15:07 ` Min Li
2021-06-16 15:28 ` Lee Jones
2021-06-16 16:24 ` Min Li
2021-06-16 16:35 ` Lee Jones [this message]
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=YMooW5AALqdaGjXz@dell \
--to=lee.jones@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=min.li.xe@renesas.com \
--cc=robh+dt@kernel.org \
--cc=sameo@linux.intel.com \
/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;
as well as URLs for NNTP newsgroup(s).