Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp810730rwi; Wed, 19 Oct 2022 03:18:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kJFbWCBEJqcD/UAjwUQASfwe8C6hI7xUT5sxRi63wov3Daq1J03sJuHk/GnpWLgvijqNb X-Received: by 2002:a17:90a:86c6:b0:20b:dba4:758a with SMTP id y6-20020a17090a86c600b0020bdba4758amr8928861pjv.71.1666174735296; Wed, 19 Oct 2022 03:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174735; cv=none; d=google.com; s=arc-20160816; b=dFxmwJ25c1NgeEWWNlVPxQxg49izpFZhtDlyWW0Z90PWMyBjyyEhju6QOHVIGQb86V AnS8zAyTIEEN/XQA0PMUjEpuc/75fIQTCefE/pUQv5nS8FAsTzSSDauDbzSh5cNLk5Ok a/pvszgPW+qILblJM2qqA6rhyf1Jt6qEt82EI6XmWQhORBAUujY8Fru2fEHtaLXVsqwk cvpHiqdgW9ZpaTwzF9IoBNTsPYaOyBETq65hNRoLrFVvU7PM1u3OWUYdaiB7l20yDAuU pbwY/N/f0Y8wJHKDd1jzpn3skjJoVP+Wqp9ieS3OosGy+3WT3kM2ePnsQwWuCdy4Q/1R vZkA== 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=/FwD+DyVZnA/iggt0gVDgpVAayGoG0kwpeZTnWyARRY=; b=MIzKXFobgK/SidCpkSt6YZPnIzvaC5n9Jw5og5Qoh1bbmKU9xMzqgre+Qxs3aDSSDl yY0mEYGJ/aJ9fbfFijmfooVvyRHxNZNYhtK1Foqy4L9on2VoqIfDmIuNE+4aj0/455OW 5CycVS7wNxaU1wkXICe/9Z9GQDnE/NYJ+ODUjQ3D8WtfYj3yg3B5NVpksRSvKWcldUnX QlgSGLEzJuzNxiMknnz6UE00fCwVBtPWBHg6zM2J7tNxzemOXxXyEctqQGQXGpsHEnaX huNOBO2Y7/i6QIvIVvZn03Nbsu0Y6jIoXjINwpx3J6hC96ANJaQkH89RsWw2pBHZK9sh nLIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pu1KDnag; 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 h2-20020a654042000000b0045c88c3b799si18209150pgp.709.2022.10.19.03.18.42; Wed, 19 Oct 2022 03:18:55 -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=pu1KDnag; 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 S232365AbiJSJF6 (ORCPT + 99 others); Wed, 19 Oct 2022 05:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232445AbiJSJER (ORCPT ); Wed, 19 Oct 2022 05:04:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2871AC3A8; Wed, 19 Oct 2022 01:57:24 -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 B1C9761840; Wed, 19 Oct 2022 08:55:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFBABC433D6; Wed, 19 Oct 2022 08:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169748; bh=BUoZSVtnJYKGm7Y4/4qkfKMhQWKbZhy/Miz88YbtnhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pu1KDnagm5Y+OLIB9G6lmDOL99vSlRYRQK/iQDqsh03mztqwu0zFsrFd2QX/oiucd /EMVy9YWXu2rgrit9NS6yAKrOJvw0J6mx4D41kVULQVmJ6vOGSHYPsg3dk6TNnaCeV NsOTSQlPVMepoyXKF7abCC16/blKyhs6isBw+7sI= 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 6.0 376/862] platform/chrome: cros_ec_typec: Correct alt mode index Date: Wed, 19 Oct 2022 10:27:43 +0200 Message-Id: <20221019083306.598780576@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 4d81d8d45b73..dc5722db2066 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -698,7 +698,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