From: Frank Li <Frank.li@nxp.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: alexandre.belloni@bootlin.com, conor.culhane@silvaco.com,
devicetree@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
imx@lists.linux.dev, Jiri Slaby <jirislaby@kernel.org>,
joe@perches.com, krzysztof.kozlowski+dt@linaro.org,
krzysztof.kozlowski@linaro.org, linux-i3c@lists.infradead.org,
LKML <linux-kernel@vger.kernel.org>,
linux-serial <linux-serial@vger.kernel.org>,
miquel.raynal@bootlin.com, robh@kernel.org,
zbigniew.lukwinski@linux.intel.com
Subject: Re: [PATCH v7 6/8] i3c: target: func: add tty driver
Date: Tue, 6 Feb 2024 10:22:58 -0500 [thread overview]
Message-ID: <ZcJO0u8rKgrIH4k8@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <9b5bb389-4238-0a32-5e16-3c62ea6c00e7@linux.intel.com>
On Tue, Feb 06, 2024 at 01:54:42PM +0200, Ilpo Järvinen wrote:
> On Mon, 5 Feb 2024, Frank Li wrote:
>
> > Add tty over I3C target function driver.
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> >
> > Notes:
> > Change from v4 to v5
> > - remove void*
> > - include bitfield.h
> > - remove extra ()
> > - oneline for struct ttyi3c_port *sport
> >
> > drivers/i3c/Kconfig | 3 +
> > drivers/i3c/Makefile | 1 +
> > drivers/i3c/func/Kconfig | 9 +
> > drivers/i3c/func/Makefile | 3 +
> > drivers/i3c/func/tty.c | 474 ++++++++++++++++++++++++++++++++++++++
> > 5 files changed, 490 insertions(+)
> > create mode 100644 drivers/i3c/func/Kconfig
> > create mode 100644 drivers/i3c/func/Makefile
> > create mode 100644 drivers/i3c/func/tty.c
> >
> > diff --git a/drivers/i3c/Kconfig b/drivers/i3c/Kconfig
> > index d59a7eb83d13a..fca808cda87b3 100644
> > --- a/drivers/i3c/Kconfig
> > +++ b/drivers/i3c/Kconfig
> > @@ -48,3 +48,6 @@ config I3C_TARGET_CONFIGFS
> > the target function and used to bind the function with a target
> > controller.
> >
> > +if I3C_TARGET
> > +source "drivers/i3c/func/Kconfig"
> > +endif # I3C_TARGET
> > diff --git a/drivers/i3c/Makefile b/drivers/i3c/Makefile
> > index c275aeae8970c..11f026d6876fe 100644
> > --- a/drivers/i3c/Makefile
> > +++ b/drivers/i3c/Makefile
> > @@ -4,3 +4,4 @@ obj-$(CONFIG_I3C) += i3c.o
> > obj-$(CONFIG_I3C_TARGET) += target.o
> > obj-$(CONFIG_I3C_TARGET_CONFIGFS) += i3c-cfs.o
> > obj-$(CONFIG_I3C) += master/
> > +obj-$(CONFIG_I3C_TARGET) += func/
> > diff --git a/drivers/i3c/func/Kconfig b/drivers/i3c/func/Kconfig
> > new file mode 100644
> > index 0000000000000..7115129eb7d5a
> > --- /dev/null
> > +++ b/drivers/i3c/func/Kconfig
> > @@ -0,0 +1,9 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +config I3C_TARGET_FUNC_TTY
> > + tristate "I3C target tty driver"
> > + depends on I3C_TARGET
> > + help
> > + I3C Target TTY Function Driver.
> > +
> > + General TTY over I3C target controller function drivers.
> > diff --git a/drivers/i3c/func/Makefile b/drivers/i3c/func/Makefile
> > new file mode 100644
> > index 0000000000000..16b3b9301496b
> > --- /dev/null
> > +++ b/drivers/i3c/func/Makefile
> > @@ -0,0 +1,3 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +obj-$(CONFIG_I3C_TARGET_FUNC_TTY) += tty.o
> > diff --git a/drivers/i3c/func/tty.c b/drivers/i3c/func/tty.c
> > new file mode 100644
> > index 0000000000000..50673bfb6a003
> > --- /dev/null
> > +++ b/drivers/i3c/func/tty.c
> > @@ -0,0 +1,474 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (C) 2023 NXP
> > + * Author: Frank Li <Frank.Li@nxp.com>
> > + */
> > +
> > +#include <linux/bitfield.h>
> > +#include <linux/iopoll.h>
> > +#include <linux/i3c/target.h>
> > +#include <linux/serial_core.h>
> > +#include <linux/slab.h>
> > +#include <linux/tty_flip.h>
> > +
> > +static DEFINE_IDR(i3c_tty_minors);
> > +
> > +static struct tty_driver *i3c_tty_driver;
> > +
> > +#define I3C_TTY_MINORS 8
> > +
> > +#define I3C_TX_NOEMPTY BIT(0)
> > +#define I3C_TTY_TRANS_SIZE 16
> > +#define I3C_TTY_IBI_TX BIT(0)
>
> This is #include <linux/bits.h>
>
> ...which will include <vdso/bits.h> that contains the actual definition.
>
> #include <bitfield.h> is for FIELD_GET/PREP(), etc.
>
> > +struct ttyi3c_port {
> > + struct tty_port port;
> > + int minor;
> > + struct i3c_target_func *i3cdev;
> > + struct completion txcomplete;
> > + spinlock_t xlock;
> > + void *buffer;
> > + struct work_struct work;
>
> This file seems to also lack some includes. Please go through your
> #include in the series and add those you use.
Do you have tools to check? It is easy to missed some header files.
Frank
>
> --
> i.
>
next prev parent reply other threads:[~2024-02-06 15:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 23:33 [PATCH v7 0/8] I3C target mode support Frank Li
2024-02-05 23:33 ` [PATCH v7 1/8] i3c: add " Frank Li
2024-02-05 23:33 ` [PATCH v7 2/8] dt-bindings: i3c: svc: add proptery mode Frank Li
2024-02-05 23:33 ` [PATCH v7 3/8] Documentation: i3c: Add I3C target mode controller and function Frank Li
2024-02-05 23:33 ` [PATCH v7 4/8] i3c: svc: Add svc-i3c-main.c and svc-i3c.h Frank Li
2024-02-05 23:33 ` [PATCH v7 5/8] i3c: target: add svc target controller support Frank Li
2024-03-06 16:01 ` Joshua Yeong
2024-03-06 17:45 ` Frank Li
2024-03-06 18:10 ` Joshua Yeong
2024-03-06 19:11 ` Frank Li
2024-02-05 23:33 ` [PATCH v7 6/8] i3c: target: func: add tty driver Frank Li
2024-02-06 11:54 ` Ilpo Järvinen
2024-02-06 15:22 ` Frank Li [this message]
2024-02-05 23:33 ` [PATCH v7 7/8] i3c: add API i3c_dev_gettstatus_format1() to get target device status Frank Li
2024-02-05 23:33 ` [PATCH v7 8/8] tty: i3c: add TTY over I3C master support Frank Li
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=ZcJO0u8rKgrIH4k8@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor.culhane@silvaco.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=imx@lists.linux.dev \
--cc=jirislaby@kernel.org \
--cc=joe@perches.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=robh@kernel.org \
--cc=zbigniew.lukwinski@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