Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4690583rwb; Tue, 17 Jan 2023 04:22:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcpZ+itjs9838Ru66Lp/HVQt1QqB+TrFYUwy+NVeKOUsrrsBJ/ZqGAl3Jt0/pQB90a7SZ8 X-Received: by 2002:a17:907:d68c:b0:812:d53e:1222 with SMTP id wf12-20020a170907d68c00b00812d53e1222mr2818463ejc.31.1673958160651; Tue, 17 Jan 2023 04:22:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673958160; cv=none; d=google.com; s=arc-20160816; b=j6DC/9fqKGRJ0IBUbg7kOX7b/rkPEMj/2LQMFRKTT0UgZjQ/cLB67k9PpCHMp2PQyc vMdYVHbzTx/Qb9ZRKALI4PqbIWCiq+G8PV+/AnVz8CB6RfRmHkJ+z7hggAMIN2MeBV9s lHqM58BmjcTC0mRQnc6k0EblLvX2g3lttnDOFASMAEWP9jYe124ftXcTUS68or06DraI 5IYPMhbIc0dEGQ2O+g3UAEKWmnzK42iSpm819nogZenZ/266Y2zUuW1Byl25PQ2zUWCY fi9Sb/TMr3bF/XxfM5yk2uoMmayZWBEfJJgzY8CgUo/yZW325WsI0MlH6w0qVNF5fkKd Bzcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BADwIqqCqQ42QlO1JQTT2gOxhFEC4KGWB+40fIsZzGA=; b=03bpGvC6Z41OfS/QyBmXSxotIucEdrr0wer1VPwfhz4LLJv4MsDSPjtC/QQPw3nQ8+ ebeQPBVLpqqjbhsDRgWToTJ7VAbdlb55jxWCudLWXH2arkDqIoYh3Q1MDjuN2QKrLTHp 8qn8lP42mGM0RNZ11qBRvknyuutBjCX3i7lUPm/Na7fUVjQLM5L77FRd521EnkaWHvpF 5nye8AHh43+d35sz0UfqXf6tYBDaLYNgxpsQ6Ye4I8qNPpNuZ6CdXtPSbVu/NWC4AsZU vbvrBgb/nFajNSn18i0NTqrSftW6MUtFJgSCYEQYuX5J7RL9tEcjf+b08Rl7vUbWdDYC TNpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IIBcvQ7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc22-20020a1709071c1600b008700e354518si7442874ejc.40.2023.01.17.04.22.28; Tue, 17 Jan 2023 04:22:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IIBcvQ7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236663AbjAQLmn (ORCPT + 48 others); Tue, 17 Jan 2023 06:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbjAQLmk (ORCPT ); Tue, 17 Jan 2023 06:42:40 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A2219012; Tue, 17 Jan 2023 03:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673955760; x=1705491760; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=L2Mpvw1T5mkrtqn1GsvAMIMZtRNRFrll7lHm1p+0s8k=; b=IIBcvQ7al0/9/X+WOoqrs9EGg8jOJTOlxQcNfbmM16cTZaZvE+OH/vzg nVS+lCrc83NnwocEqjbbA+EV7KJsNJkrDrfu+77tc6ZJ5BFfLkZzIiDQn Si63uu123bJJMfRIH+thO4gamcAJGe/V0E8jHSOvAc2W8DXVhNEdJT6Zy Iyj1vIfmm77aLkg3UL0/jHYRmnIAgaF0pvXPHll1n4sT/Hyu4Yi7IcuAV H4UOiPKqLbTq1awX0rfVpvuq+LOQRluzXGgTEVDSOT5pVbEW/0wuKdlol m+RKxMlr88GThjNlh9UfXlpOWhIQjfSIqEBSbuH1amKA2RpvgsM3dcZi8 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="387024518" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="387024518" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 03:42:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="801716990" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="801716990" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 17 Jan 2023 03:42:36 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 17 Jan 2023 13:42:36 +0200 Date: Tue, 17 Jan 2023 13:42:36 +0200 From: Heikki Krogerus To: Prashant Malani Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, bleung@chromium.org, Greg Kroah-Hartman Subject: Re: [PATCH 2/3] usb: typec: Add wrapper for bus switch set code Message-ID: References: <20230112221609.540754-1-pmalani@chromium.org> <20230112221609.540754-3-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112221609.540754-3-pmalani@chromium.org> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 12, 2023 at 10:16:07PM +0000, Prashant Malani wrote: > Add a wrapper that calls the set() function for various switches > associated with a port altmode. > > Right now, it just wraps the existing typec_mux_set() command, > but it can be expanded to include other switches in future patches. > > No functional changes introduced by this patch. > > Signed-off-by: Prashant Malani Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/bus.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c > index 31c2a3130cad..9f1bbd26ca47 100644 > --- a/drivers/usb/typec/bus.c > +++ b/drivers/usb/typec/bus.c > @@ -27,6 +27,13 @@ typec_altmode_set_mux(struct altmode *alt, unsigned long conf, void *data) > return typec_mux_set(alt->mux, &state); > } > > +/* Wrapper to set various Type-C port switches together. */ > +static inline int > +typec_altmode_set_switches(struct altmode *alt, unsigned long conf, void *data) > +{ > + return typec_altmode_set_mux(alt, conf, data); > +} > + > static int typec_altmode_set_state(struct typec_altmode *adev, > unsigned long conf, void *data) > { > @@ -35,7 +42,7 @@ static int typec_altmode_set_state(struct typec_altmode *adev, > > port_altmode = is_port ? to_altmode(adev) : to_altmode(adev)->partner; > > - return typec_altmode_set_mux(port_altmode, conf, data); > + return typec_altmode_set_switches(port_altmode, conf, data); > } > > /* -------------------------------------------------------------------------- */ > @@ -73,7 +80,7 @@ int typec_altmode_notify(struct typec_altmode *adev, > is_port = is_typec_port(adev->dev.parent); > partner = altmode->partner; > > - ret = typec_altmode_set_mux(is_port ? altmode : partner, conf, data); > + ret = typec_altmode_set_switches(is_port ? altmode : partner, conf, data); > if (ret) > return ret; > > -- > 2.39.0.314.g84b9a713c41-goog -- heikki