From: Wolfram Sang <wsa@the-dreams.de>
To: linux-sh@vger.kernel.org
Subject: [RFC V2 2/4] i2c: mux: add function to reparent a mux
Date: Tue, 17 Mar 2015 07:15:22 +0000 [thread overview]
Message-ID: <1426576524-22315-3-git-send-email-wsa@the-dreams.de> (raw)
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Used for n-to-1 demuxes. Needs discussion.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since RFC V1: none, only rebased
drivers/i2c/i2c-mux.c | 8 ++++++++
include/linux/i2c-mux.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 593f7ca9adc783..c64f3fc9bb3750 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -100,6 +100,14 @@ static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent)
return class;
}
+void i2c_mux_reparent(struct i2c_adapter *adap, struct i2c_adapter *new_parent)
+{
+ struct i2c_mux_priv *priv = adap->algo_data;
+
+ priv->parent = new_parent;
+}
+EXPORT_SYMBOL_GPL(i2c_mux_reparent);
+
struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
struct device *mux_dev,
void *mux_priv, u32 force_nr, u32 chan_id,
diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h
index b5f9a007a3abdd..488a7744732853 100644
--- a/include/linux/i2c-mux.h
+++ b/include/linux/i2c-mux.h
@@ -44,6 +44,8 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
void i2c_del_mux_adapter(struct i2c_adapter *adap);
+void i2c_mux_reparent(struct i2c_adapter *adap, struct i2c_adapter *new_parent);
+
#endif /* __KERNEL__ */
#endif /* _LINUX_I2C_MUX_H */
--
2.1.4
next reply other threads:[~2015-03-17 7:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 7:15 Wolfram Sang [this message]
2015-03-19 15:39 ` [RFC V2 2/4] i2c: mux: add function to reparent a mux Wolfram Sang
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=1426576524-22315-3-git-send-email-wsa@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=linux-sh@vger.kernel.org \
/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).