Arnd Bergmann
2021-Jul-23 09:03 UTC
[PATCH v15] i2c: virtio: add a virtio i2c frontend driver
On Fri, Jul 23, 2021 at 7:44 AM Jie Deng <jie.deng at intel.com> wrote:> + > + ret = virtio_i2c_setup_vqs(vi); > + if (ret) > + return ret; > + > + vi->adap.owner = THIS_MODULE; > + snprintf(vi->adap.name, sizeof(vi->adap.name), > + "i2c_virtio at virtio bus %d", vdev->index); > + vi->adap.algo = &virtio_algorithm; > + vi->adap.quirks = &virtio_i2c_quirks; > + vi->adap.dev.parent = &vdev->dev; > + i2c_set_adapdata(&vi->adap, vi); > + > + /* > + * Setup ACPI node for controlled devices which will be probed through > + * ACPI. > + */ > + ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(pdev));Since there is now a generic way for virtio drivers to link up with OF device nodes, maybe this should be handled the same way in the virtio core rather than the driver?> index 70a8057a..99aa27b 100644 > --- a/include/uapi/linux/virtio_ids.h > +++ b/include/uapi/linux/virtio_ids.h > @@ -55,6 +55,7 @@ > #define VIRTIO_ID_FS 26 /* virtio filesystem */ > #define VIRTIO_ID_PMEM 27 /* virtio pmem */ > #define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */ > +#define VIRTIO_ID_I2C_ADAPTER 34 /* virtio i2c adapter */ > #define VIRTIO_ID_BT 40 /* virtio bluetooth */This will now conflict with Viresh's patch that adds all the other IDs. Not sure if there is anything to be done about that. Arnd
Viresh Kumar
2021-Jul-26 03:59 UTC
[PATCH v15] i2c: virtio: add a virtio i2c frontend driver
On 23-07-21, 11:03, Arnd Bergmann wrote:> > index 70a8057a..99aa27b 100644 > > --- a/include/uapi/linux/virtio_ids.h > > +++ b/include/uapi/linux/virtio_ids.h > > @@ -55,6 +55,7 @@ > > #define VIRTIO_ID_FS 26 /* virtio filesystem */ > > #define VIRTIO_ID_PMEM 27 /* virtio pmem */ > > #define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */ > > +#define VIRTIO_ID_I2C_ADAPTER 34 /* virtio i2c adapter */ > > #define VIRTIO_ID_BT 40 /* virtio bluetooth */ > > This will now conflict with Viresh's patch that adds all the other IDs. > Not sure if there is anything to be done about that.An easier way of avoiding all such conflicts can be: - Michael applies my first patch (which sync's the device id's from specs) for 5.14-rc4. Rest of the patches can go for 5.15. - And then Wolfram applies this series over rc4 instead of rc1. Or we can leave the conflict there for Linus to handle. -- viresh
On 2021/7/23 17:03, Arnd Bergmann wrote:> On Fri, Jul 23, 2021 at 7:44 AM Jie Deng <jie.deng at intel.com> wrote: > >> + >> + ret = virtio_i2c_setup_vqs(vi); >> + if (ret) >> + return ret; >> + >> + vi->adap.owner = THIS_MODULE; >> + snprintf(vi->adap.name, sizeof(vi->adap.name), >> + "i2c_virtio at virtio bus %d", vdev->index); >> + vi->adap.algo = &virtio_algorithm; >> + vi->adap.quirks = &virtio_i2c_quirks; >> + vi->adap.dev.parent = &vdev->dev; >> + i2c_set_adapdata(&vi->adap, vi); >> + >> + /* >> + * Setup ACPI node for controlled devices which will be probed through >> + * ACPI. >> + */ >> + ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(pdev)); > Since there is now a generic way for virtio drivers to link up with OF > device nodes, maybe this should be handled the same way in the > virtio core rather than the driver?I'm currently based on the I2C tree. Has that patch been already merged ? Anyway, I think we can send an additional patch to remove this line once that "generic way" patch is merged. Regards, Jie