From patchwork Tue Mar 17 07:15:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 6027541 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 660029F2A9 for ; Tue, 17 Mar 2015 07:15:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F39520458 for ; Tue, 17 Mar 2015 07:15:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C31120454 for ; Tue, 17 Mar 2015 07:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751908AbbCQHPT (ORCPT ); Tue, 17 Mar 2015 03:15:19 -0400 Received: from sauhun.de ([89.238.76.85]:41130 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbbCQHPS (ORCPT ); Tue, 17 Mar 2015 03:15:18 -0400 Received: from p4fe2508e.dip0.t-ipconnect.de ([79.226.80.142]:37298 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YXlie-0007Aq-VQ; Tue, 17 Mar 2015 08:15:17 +0100 From: Wolfram Sang To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , Laurent Pinchart , Geert Uytterhoeven , Wolfram Sang Subject: [RFC V2 2/4] i2c: mux: add function to reparent a mux Date: Tue, 17 Mar 2015 08:15:22 +0100 Message-Id: <1426576524-22315-3-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426576524-22315-1-git-send-email-wsa@the-dreams.de> References: <1426576524-22315-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 --- 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 */