From patchwork Wed Oct 19 08:27:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4699 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp213748wrs; Wed, 19 Oct 2022 02:10:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JlCVWweqflVh1/AuCfMUSx5Dvh3L1raR8S4HoFMV0g4Y2AylL2CZASTB8YZBh8l+yC7SI X-Received: by 2002:a17:906:3287:b0:78d:8877:d50f with SMTP id 7-20020a170906328700b0078d8877d50fmr5894079ejw.486.1666170659674; Wed, 19 Oct 2022 02:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170659; cv=none; d=google.com; s=arc-20160816; b=C8zx5Ef0odjS4heLBvowcSKYaMHpcl5mA9hgtw+oamjB4P5y4bnvj0AxGFsgfkw7WW PKuEzVgeqeauPiDVjD7LZgiQ7zmq1b35DGOl8O9SRICX5Z1VFPcidw0D2nDMe6hkqHlb 9odPjBdC87ctuT68IzrLGGCLf4uj1czWBoLKBVN/Hg4zoIFktp+2EH/f8K6gBF9Jy6Gy IQ98RKhiudlTzQ6iVAUuMUoHlMEEZvoYR3cTvrPniW6JfIEbD9VADzvZ+k8vLT/4m97W QyGr2u/+0J7lr+krixX1tdKRKdrlMQwkRMxwAc7hKNC9bplUo9EFZxeF5/8t4PqNr0sI aGLw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id st11-20020a170907c08b00b007806c7c3fc1si10841149ejc.975.2022.10.19.02.10.33; Wed, 19 Oct 2022 02:10:59 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106565569555308?= X-GMAIL-MSGID: =?utf-8?q?1747106565569555308?= 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)