From patchwork Mon Dec 15 20:20:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 5497511 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A3079F50E for ; Mon, 15 Dec 2014 20:20:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F02D209EB for ; Mon, 15 Dec 2014 20:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DE6220A1B for ; Mon, 15 Dec 2014 20:20:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030AbaLOUUs (ORCPT ); Mon, 15 Dec 2014 15:20:48 -0500 Received: from sauhun.de ([89.238.76.85]:52466 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbaLOUUs (ORCPT ); Mon, 15 Dec 2014 15:20:48 -0500 Received: from p4fe25b75.dip0.t-ipconnect.de ([79.226.91.117]:34941 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Y0c8M-0000mt-GA; Mon, 15 Dec 2014 21:20:46 +0100 From: Wolfram Sang To: linux-sh@vger.kernel.org Cc: Wolfram Sang , Magnus Damm , Simon Horman , Laurent Pinchart , Geert Uytterhoeven Subject: [RFC 2/4] i2c: mux: add function to reparent a mux Date: Mon, 15 Dec 2014 21:20:15 +0100 Message-Id: <1418674817-12809-3-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418674817-12809-1-git-send-email-wsa@the-dreams.de> References: <1418674817-12809-1-git-send-email-wsa@the-dreams.de> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang Used for n-to-1 demuxes. Needs discussion. Signed-off-by: Wolfram Sang --- 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 2a0207e9645a..1c2db2e10671 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); + /* Simple consistent prefix for i2c_add_mux_adapter */ #define i2c_mux_msg(fmt, ...) "%s-%u: " fmt, dev_name(mux_dev), chan_id, ##__VA_ARGS__ diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h index b5f9a007a3ab..488a77447328 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 */