Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3912340rwi; Sat, 22 Oct 2022 02:04:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+h+WKdNGwXBbFWevRDd9KonsjgEjat/gI/BwQt+8uSYqNAqYlMs0bbMQRQDw6HhJVvBFh X-Received: by 2002:a17:902:e849:b0:17f:f3c4:a2c4 with SMTP id t9-20020a170902e84900b0017ff3c4a2c4mr23191557plg.125.1666429488993; Sat, 22 Oct 2022 02:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666429488; cv=none; d=google.com; s=arc-20160816; b=NzbeGkLqiIzJhPhUPAF7eXqIickjdx4slHyF3eSrYSRMQ0v1IT6cInDjlFQ7nGPi5w YLsM4CQ+W4on48VoOqLcbQtnZ4cqshU90seo2KS3yEWTxgOsVaLG28GB54Khm3m6Aa9s 2x+rACCqPlH8qs+NXCP+BQFoOXBV9OANhAPNJfjy8MOIrKb8BF3eX8tHtZ8WX0CAuTuV Rt54fFAST2lM07WjInkiWkEC0mQ55cXONiOJ/peN9UklZ+tPyTI8XEiWeE0qubOILOLd qOqtxP4ZxkVr7mXAQOfxmz4emELUYCLKXg+R2bf6Mgg1wewJpmq0qwM9smleicd2GJ7m sz2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v6ZgtwWTu0SMSjjucml8ubJp2Z5Eb14X5zOTO1c4uzs=; b=iyF2d0XHxRUeKByoFUwm0KDFQU1i/VD/1LTmPSZd68k46W9DVerEc66opTMXfY0wPX sgUoeAfWN+RUOoqxvONkDIoRyfeC2HeXbLSyTNprK72V5anF8oTq7WwQoxCLRsdeabLc 2416mq8P+wzLsnYA58eVcmatmHjd90yi0wJCJwQkeh17HZ77oc1/xk4TohbVoLGd2L96 k2k+sjmOtnAcfL1GXgrGApPYpMBkBu1P9t/BHB3XeR+jzuEnbk6TTMlIW/vLHAVDbAmn DkNVrrqS8HoQLBnaLl82mkH+LpyOUrzyg0mYk+X9gcI9H0yDwDnf6uUCuvN9oKpSzpCA RPow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ffnpsx5W; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t67-20020a632d46000000b0043966935b33si28972051pgt.166.2022.10.22.02.04.36; Sat, 22 Oct 2022 02:04:48 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=ffnpsx5W; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiJVIUw (ORCPT + 99 others); Sat, 22 Oct 2022 04:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbiJVITQ (ORCPT ); Sat, 22 Oct 2022 04:19:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EED42DF454; Sat, 22 Oct 2022 00:58:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 766FD60B1B; Sat, 22 Oct 2022 07:48:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 893BEC433D7; Sat, 22 Oct 2022 07:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424894; bh=c2ft1Iae6NDuIB9gttmxUKDBTR38ExvWyk+Gc+BZs0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ffnpsx5W0lH/6U6JuEs0dYEn/YVGKRvdrFlZYF7Q3ujX9pPOS7NG6stBi+36KWqXx GeR4sQ52ChsWrDhTiOJRXV7a+/TF+L6oioZI+PGbLSQ4B8HI1LwpuMqGiIPjJ3agof hgFQrEtPng34IjSmqKUhl/D94D+dOjOJW44Iykpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Prashant Malani , Heikki Krogerus , Tzung-Bi Shih , Sasha Levin Subject: [PATCH 5.19 316/717] platform/chrome: cros_ec_typec: Correct alt mode index Date: Sat, 22 Oct 2022 09:23:15 +0200 Message-Id: <20221022072508.049503779@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Prashant Malani [ Upstream commit 4e477663e396f48c5cfc5f2d75d4b514f409516a ] Alt mode indices used by USB PD (Power Delivery) start with 1, not 0. Update the alt mdoe registration code to factor this in to the alt mode descriptor. Fixes: de0f49487db3 ("platform/chrome: cros_ec_typec: Register partner altmodes") Signed-off-by: Prashant Malani Acked-by: Heikki Krogerus Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220819190807.1275937-3-pmalani@chromium.org Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_typec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 7cb2e35c4ded..1305a22a8831 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -669,7 +669,7 @@ static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_ for (j = 0; j < sop_disc->svids[i].mode_count; j++) { memset(&desc, 0, sizeof(desc)); desc.svid = sop_disc->svids[i].svid; - desc.mode = j; + desc.mode = j + 1; desc.vdo = sop_disc->svids[i].mode_vdo[j]; if (is_partner) -- 2.35.1