From patchwork Sat Oct 22 07:23:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1105053wrr; Sat, 22 Oct 2022 01:34:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OUS/kcqRLANBr7TRufTUSi17E3Fv03RvSEYBJxtUlAaThlAmnIsN1qPHbgAbBtHphmhWb X-Received: by 2002:aa7:8a0d:0:b0:562:a5bf:95e9 with SMTP id m13-20020aa78a0d000000b00562a5bf95e9mr23289916pfa.24.1666427640861; Sat, 22 Oct 2022 01:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427640; cv=none; d=google.com; s=arc-20160816; b=cAFTqrUD/95GY5rHS5P5s9jWv1JMRY8d+dwCN3sOOY1NcemMrxvc1psDIN+LO9mvqT ifoRtx/1JO7BxW4NspDylJLQBq4KbWybqO7/bf+qa8L21vrhFswA0xN1mgez1R7CPV4/ CtQSn6tCwDR88zKHVrs8qa+Y8DtfGzpu1j8HZ4AVMulSoHNw1IicOxxC6XTuP0fpdT4M fj0g4WmVbP2JCEWuQ2JbaukRFK2WE21DJ/AoeirNp+bU52cU1dur8a//cQzaT8Fd3/xC HGHhf/TDrGR+YKouKKoBCM4tH2TNw2E3s3DU+UBHt91eDN0idJ+7qI4iTioObpcWYCIo dIyQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a631f52000000b0043447486c84si27752684pgm.875.2022.10.22.01.33.45; Sat, 22 Oct 2022 01:34:00 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376030143003095?= X-GMAIL-MSGID: =?utf-8?q?1747376030143003095?= 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)