qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Corey Minyard <cminyard@mvista.com>
To: Patrick Venture <venture@google.com>
Cc: wuhaotsh@google.com, qemu-arm@nongnu.org, hskinnemoen@google.com,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 0/4] hw/i2c: Adds pca954x i2c mux switch device
Date: Fri, 9 Apr 2021 13:31:14 -0500	[thread overview]
Message-ID: <20210409183114.GW7167@minyard.net> (raw)
In-Reply-To: <20210409162545.3705962-1-venture@google.com>

On Fri, Apr 09, 2021 at 09:25:41AM -0700, Patrick Venture wrote:
> The i2c mux device pca954x implements two devices:
>  - the pca9546 and pca9548.
> 
> v2:
>  - the core i2c bus now calls a match method on each i2c child, which
>  by default will only check for a match against itself.
>  - the pca954x device overrides the i2c device match method to search
>  the children for each of its buses that are active.
>  - the pca954x device now owns an i2c bus for each channel, allowing
>  the normal device model to attach devices to the channels.

I like this design.  Avoiding hacking into the bus code is a bonus.

Can these devices really have multiple channels enabled at the same
time?  That seems strange, but I guess that could be useful.

I'm not sure if you need to add a vmstate structure for this.  In
general most new devices have them; if it's ever included on an x86
system (or a system with vmstate transfer capability, probably more than
x86) that will become an issue.  I'm not sure what the expectations are,
though.

-corey

> 
> Patrick Venture (4):
>   hw/i2c: name I2CNode list in I2CBus
>   hw/i2c: add match method for device search
>   hw/i2c: move search to i2c_scan_bus method
>   hw/i2c: add pca954x i2c-mux switch
> 
>  MAINTAINERS                      |   6 +
>  hw/i2c/Kconfig                   |   4 +
>  hw/i2c/core.c                    |  55 ++++--
>  hw/i2c/i2c_mux_pca954x.c         | 290 +++++++++++++++++++++++++++++++
>  hw/i2c/meson.build               |   1 +
>  hw/i2c/trace-events              |   5 +
>  include/hw/i2c/i2c.h             |  16 +-
>  include/hw/i2c/i2c_mux_pca954x.h |  19 ++
>  8 files changed, 382 insertions(+), 14 deletions(-)
>  create mode 100644 hw/i2c/i2c_mux_pca954x.c
>  create mode 100644 include/hw/i2c/i2c_mux_pca954x.h
> 
> -- 
> 2.31.1.295.g9ea45b61b8-goog
> 


  parent reply	other threads:[~2021-04-09 18:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 16:25 [PATCH v2 0/4] hw/i2c: Adds pca954x i2c mux switch device Patrick Venture
2021-04-09 16:25 ` [PATCH v2 1/4] hw/i2c: name I2CNode list in I2CBus Patrick Venture
2021-04-09 16:36   ` Philippe Mathieu-Daudé
2021-04-09 16:25 ` [PATCH v2 2/4] hw/i2c: add match method for device search Patrick Venture
2021-04-09 16:25 ` [PATCH v2 3/4] hw/i2c: move search to i2c_scan_bus method Patrick Venture
2021-04-09 16:25 ` [PATCH v2 4/4] hw/i2c: add pca954x i2c-mux switch Patrick Venture
2021-04-09 16:51   ` Philippe Mathieu-Daudé
2021-04-09 17:21     ` Patrick Venture
2021-04-09 21:20       ` Philippe Mathieu-Daudé
2021-04-09 21:32         ` Patrick Venture
2021-04-09 18:34   ` Corey Minyard
2021-04-09 19:30     ` Patrick Venture
2021-04-09 18:31 ` Corey Minyard [this message]
2021-04-09 19:33   ` [PATCH v2 0/4] hw/i2c: Adds pca954x i2c mux switch device Patrick Venture

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=20210409183114.GW7167@minyard.net \
    --to=cminyard@mvista.com \
    --cc=hskinnemoen@google.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=venture@google.com \
    --cc=wuhaotsh@google.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).