From: Jason Wang <jasowang@redhat.com>
To: Jie Deng <jie.deng@intel.com>,
linux-i2c@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Cc: mst@redhat.com, wsa+renesas@sang-engineering.com, wsa@kernel.org,
andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com,
jdelvare@suse.de, Sergey.Semin@baikalelectronics.ru,
krzk@kernel.org, rppt@kernel.org, loic.poulain@linaro.org,
tali.perry1@gmail.com, bjorn.andersson@linaro.org,
shuo.a.liu@intel.com, conghui.chen@intel.com, yu1.wang@intel.com
Subject: Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver
Date: Wed, 9 Sep 2020 17:02:07 +0800 [thread overview]
Message-ID: <acf0e13d-3080-81e8-9cb1-82af6935d402@redhat.com> (raw)
In-Reply-To: <0efc2605c8c06b4b1bf68cbad5536c4a900dc019.1599110284.git.jie.deng@intel.com>
On 2020/9/3 下午1:34, Jie Deng wrote:
> --- a/drivers/i2c/busses/Makefile
> +++ b/drivers/i2c/busses/Makefile
> @@ -6,6 +6,9 @@
> # ACPI drivers
> obj-$(CONFIG_I2C_SCMI) += i2c-scmi.o
>
> +# VIRTIO I2C host controller driver
> +obj-$(CONFIG_I2C_VIRTIO) += i2c-virtio.o
> +
> # PC SMBus host controller drivers
> obj-$(CONFIG_I2C_ALI1535) += i2c-ali1535.o
> obj-$(CONFIG_I2C_ALI1563) += i2c-ali1563.o
> diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
> new file mode 100644
> index 0000000..47f9fd1
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-virtio.c
> @@ -0,0 +1,276 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Virtio I2C Bus Driver
> + *
> + * Copyright (c) 2020 Intel Corporation. All rights reserved.
> + */
> +
> +#include <linux/acpi.h>
> +#include <linux/completion.h>
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/io.h>
> +#include <linux/jiffies.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/wait.h>
> +
> +#include <linux/virtio.h>
> +#include <linux/virtio_ids.h>
> +#include <linux/virtio_config.h>
> +
> +#define VIRTIO_I2C_MSG_OK 0
> +#define VIRTIO_I2C_MSG_ERR 1
> +
> +/**
> + * struct virtio_i2c_hdr - the virtio I2C message header structure
> + * @addr: i2c_msg addr, the slave address
> + * @flags: i2c_msg flags
> + * @len: i2c_msg len
> + */
> +struct virtio_i2c_hdr {
> + __virtio16 addr;
> + __virtio16 flags;
> + __virtio16 len;
> +} __packed;
Btw, this part should belong to uAPI, and you need to define the status
in uAPI.
Thanks
prev parent reply other threads:[~2020-09-09 9:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 5:34 [PATCH] i2c: virtio: add a virtio i2c frontend driver Jie Deng
2020-09-03 6:12 ` Jason Wang
2020-09-03 7:19 ` Jie Deng
2020-09-03 9:14 ` Loic Poulain
2020-09-04 3:38 ` Jason Wang
2020-09-03 9:58 ` Michael S. Tsirkin
2020-09-04 5:28 ` Jie Deng
2020-09-03 10:20 ` Andy Shevchenko
2020-09-04 6:08 ` Jie Deng
2020-09-04 4:06 ` Jason Wang
2020-09-04 13:21 ` Jie Deng
2020-09-07 5:40 ` Jason Wang
[not found] ` <c9be298b-c51b-f7f3-994b-b7bd9ae53b99@intel.com>
2020-09-09 8:54 ` Jason Wang
2020-09-09 9:02 ` Jason Wang [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=acf0e13d-3080-81e8-9cb1-82af6935d402@redhat.com \
--to=jasowang@redhat.com \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bjorn.andersson@linaro.org \
--cc=conghui.chen@intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jdelvare@suse.de \
--cc=jie.deng@intel.com \
--cc=krzk@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=mst@redhat.com \
--cc=rppt@kernel.org \
--cc=shuo.a.liu@intel.com \
--cc=tali.perry1@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@kernel.org \
--cc=yu1.wang@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