Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1778618pxb; Wed, 9 Feb 2022 04:25:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+APzgi/bPR4vgsaKT/2XWf+qhgUtCefS2vDKHygxNLiQ/xEkj3h9Cz8EgWv43+crCLIEJ X-Received: by 2002:a63:8243:: with SMTP id w64mr1706867pgd.588.1644409530896; Wed, 09 Feb 2022 04:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644409530; cv=none; d=google.com; s=arc-20160816; b=aKhVhozt6Ij9rN0oCuLzKgpBtr7HVaFamaVzOuBzztc3qJEH3HSFMbL6BoCMWxWOLg y1ZJDW6Ju4KZL0kuDJcwVJqSwjl2+PR91Wnb8DgvGKAvZcivxG4Yv3v0sdEk0wjQZRgw xIvN/8itPBhUUCyhjBlnbvUolZHU4nabzNJoBRh3KiEgFyRfs/7xUhlLGMoRvAv8vpns lBEJq59P/t9PBIQ2oC9u7vjOCl/rgiGMTCHyyLdn5pKh7z46H5OcS4wnmemtwiQakBRL O7lSDAjlZTaoGx/1byF3y/bs7VhsW1HJaJzqqS6GF6lDs7s8EosBdj64X6EyRAZaZxP2 PnSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kvgkdpHYOT9hT97Eiz4ThApHg16vK+7+EjSGNAq5fVs=; b=njyINaIdUHPQmttuK8B0zSgYUPH2eZCU4lrGlsoLliUoxQZGKSn618gXqVjQczIqqQ 8M1U3xw8TKFekvV3aujphb6OOOZ4lEXj/730YpxCGg586mgqr4Q3pWYxqCH/1oc/JFg7 hzXtWJ0JpDyEFsp/eSLLHP1wFNi35s/1f3cmE1wMi6VPnBjs2hjrdQed5g05wS3vzINr A3QapnjiNNQAfTY6JpRiQBdn8+BoLZUDtpwnNQfS8BIsPVz6OjcTBLPb9cKxgCaSH2QA JR6Uufh0pqow120PQ0jaGuXJnb/gBMMj0QRACEW48KYhgZP87MI/N9CMbhBUJzDIh6rA QaEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Q/wFyU1o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g15si19973709pgk.863.2022.02.09.04.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:25:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Q/wFyU1o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56FCBE08F1BD; Wed, 9 Feb 2022 02:17:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345160AbiBHGEk (ORCPT + 99 others); Tue, 8 Feb 2022 01:04:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236586AbiBHGEj (ORCPT ); Tue, 8 Feb 2022 01:04:39 -0500 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5B0C0401DC for ; Mon, 7 Feb 2022 22:04:39 -0800 (PST) Received: by mail-yb1-xb30.google.com with SMTP id y6so32134412ybc.5 for ; Mon, 07 Feb 2022 22:04:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kvgkdpHYOT9hT97Eiz4ThApHg16vK+7+EjSGNAq5fVs=; b=Q/wFyU1ox5X6pXRZj19yAZ3gCpmA62oayq/7m6jnZMsVZ8/Gtg7ZwNdQf7cps7FYHn 5nNHP3r1aOE4zFoyot/Bb6oDUREC4MtH+FabIl7eEARuEJl84eAfXgkY6cYms+Qr2MqZ a2xkD1VfJxVSRzcALlYe2LvQRElYvV9I2zUsA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kvgkdpHYOT9hT97Eiz4ThApHg16vK+7+EjSGNAq5fVs=; b=Yb1eq3iBd0v3438wBSSLYDUtqBJbhVbUEmIMC7NsehC246pwSXAKUg5NZjGAipythw 3RtumTrUp953K6T7XrnB6MROC262BbjtV5SK274aflUqIEJoipyYt7MsDN/XIYKHPTuS aubQeqFem6G9vCybECxmyyfaso1/7EpSoZarekKZmJhbzvWu/MYzuuQKM5lBjX2MpqkX BfOECj3gaVFb1E6ppL3okhB7fa9k0EZFq2vLiPQix4XLjwNMw29nGQCqyjkHWV26275B LFvOwOTBHEwGaZUVfNMU50cpPoSPgaFhdeCBXmqjzojrlz+we9OnYOiB/52L94V7tCQb QpMA== X-Gm-Message-State: AOAM530Jhp6VtU/rno1Gu6mJmFHKFUC5OrvYi6gh64O1rry1TD2V4eiH mqSyMlSlQaL8y2BFZHn4xhjJ3rtvHyeNNQbZIcqyjg== X-Received: by 2002:a05:6902:124c:: with SMTP id t12mr3115810ybu.656.1644300278348; Mon, 07 Feb 2022 22:04:38 -0800 (PST) MIME-Version: 1.0 References: <20220207214026.1526151-1-pmalani@chromium.org> <20220207214026.1526151-3-pmalani@chromium.org> In-Reply-To: From: Prashant Malani Date: Mon, 7 Feb 2022 22:04:27 -0800 Message-ID: Subject: Re: [PATCH 2/4] platform/chrome: cros_ec_typec: Get mux state inside configure_mux To: Tzung-Bi Shih Cc: linux-kernel@vger.kernel.org, Benson Leung , "open list:CHROMEOS EC USB TYPE-C DRIVER" , Guenter Roeck Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Feb 7, 2022 at 9:35 PM Tzung-Bi Shih wrote: > > On Mon, Feb 07, 2022 at 09:40:26PM +0000, Prashant Malani wrote: > > Move the function which gets current mux state inside the > > cros_typec_configure_mux() function. It is better to group those > > bits of functionality together, and it makes it easier to move around > > cros_typec_configure_mux() later. > > nit: s/Move/Moves/. Move is fine. Please see: https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html#describe-your-changes Quoting from the above: " Describe your changes in imperative mood," > > > static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num, > > - uint8_t mux_flags, > > struct ec_response_usb_pd_control_v2 *pd_ctrl) > > { > > struct cros_typec_port *port = typec->ports[port_num]; > > + struct ec_response_usb_pd_mux_info mux_resp; > > + struct ec_params_usb_pd_mux_info req = { > > + .port = port_num, > > + }; > > struct ec_params_usb_pd_mux_ack mux_ack; > > enum typec_orientation orientation; > > int ret = 0; > > > > + ret = cros_ec_command(typec->ec, 0, EC_CMD_USB_PD_MUX_INFO, > > + &req, sizeof(req), &mux_resp, sizeof(mux_resp)); > > It was `req` and `resp` in cros_typec_get_mux_info(). However, `mux_resp` for > separating from `struct ec_response_usb_pd_control_v2 resp` in > cros_typec_port_update(). > > It would be neat to be either {`req`, `resp`} or {`mux_req`, `mux_resp`} in > cros_typec_configure_mux(). I'll change it to resp (instead of mux_resp)