From patchwork Mon Oct 24 11:28:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp462536wru; Mon, 24 Oct 2022 06:46:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Yx0ct6Frtm3/WaqZ2LYsVpPkX4zycKT5qqqE7WYnDR2JCxdcdl0b0OvNOQJYdCXHIG6b5 X-Received: by 2002:a05:6402:344:b0:461:7d4:9c9 with SMTP id r4-20020a056402034400b0046107d409c9mr20584825edw.141.1666619167950; Mon, 24 Oct 2022 06:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619167; cv=none; d=google.com; s=arc-20160816; b=0SQoe3raUj/kqkw1asKgBGGj9DmnMYc1OkgDQRCFxSIBin4Jh/zjD/yy146anl7jGy TMiNn2UPjVfczQpxUMLUOrvw6Z6eul5N3elclYa9qhjHcuouTZVAYkyQvkfUZp52As2Y y6MOFZPnjXb9b5IN/pbzsTSCjJiZbMMjAFGcf0ARorETr/0T7Or8C/o8xcGASOUdGkrT /TQRdZQQVIZiZE5xn4ycuaNEefSgnSOy3V01ttybZ7Y5wULu3t7uWp9U15agqFEw4/GU YWIK0Qv0rwZGui94lvvmt8ferVCtAp7mU21SvR7wX0z+BxQaCAY9jKhCvyV9IqnTUymK N9yw== 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=iE95Up2nP20MVDS/JFZExFHm1dsk+ymjMwrsMBnSeNs=; b=OQKQHR2JzQwfMubQVVj3iangR38HNxTM9CNq0x+YeExni7KgmsYRTGumiB5FHcFKpI t+29hDrP2cMjkCLAkb4NZNwfSIBkClM+4gLWZMvRkX1hz21mV//ZZ68Qbnpl9JSke97Y 4bWfHXkSyxrhoUXcuSkiQ/i/gHnKdp65JqlaqTHbtaGDPmVhe5Ofg/H6qR7ScBKSJoxn RYbWaLM1E5pbG3gvguwL0pPxlsmvbij7LiatQbXQ+JOCkhdVOgbfr4X6JVs1f/GTp4IZ sMvg1kMJk7FIW7Eg2p+I20CDbRBhc3RkPk9am5O6qbHy95o3oAM5SSfPisc5xJ+VRCwq Epdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QKCDr4DX; 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 i13-20020a1709064fcd00b00780def41dc4si29846650ejw.527.2022.10.24.06.45.39; Mon, 24 Oct 2022 06:46:07 -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=QKCDr4DX; 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 S236368AbiJXNoG (ORCPT + 99 others); Mon, 24 Oct 2022 09:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236896AbiJXNld (ORCPT ); Mon, 24 Oct 2022 09:41:33 -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 071EDB48BC; Mon, 24 Oct 2022 05:39:05 -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 EB2FF61252; Mon, 24 Oct 2022 12:22:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A674C433C1; Mon, 24 Oct 2022 12:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614124; bh=2KuOyOV61eUspe7lepKwhElGOBYuoUrGDz3e1x9QyYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QKCDr4DXXs9ssfYxwbCRgPMqwtfUYXJA57lLOuEJj8GE3NFKBErjuoM37XnWsxKPY 27lyGR5EBMFQRx19aBe8hE64Ijs51zrpX2M9INyibFkFnO4rf9uhVsKM9NuaA86ghG oBDGpt/BHmvVtLv7NzypgRZjRO5xKPGmKVkuOuFU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Alvin_=C5=A0ipraga?= , Robert Foss , Sasha Levin Subject: [PATCH 5.10 141/390] drm: bridge: adv7511: fix CEC power down control register offset Date: Mon, 24 Oct 2022 13:28:58 +0200 Message-Id: <20221024113028.672236319@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747576860618689954?= X-GMAIL-MSGID: =?utf-8?q?1747576860618689954?= From: Alvin Šipraga [ Upstream commit 1d22b6033ea113a4c3850dfa2c0770885c81aec8 ] The ADV7511_REG_CEC_CTRL = 0xE2 register is part of the main register map - not the CEC register map. As such, we shouldn't apply an offset to the register address. Doing so will cause us to address a bogus register for chips with a CEC register map offset (e.g. ADV7533). Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Alvin Šipraga Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220612144854.2223873-2-alvin@pqrs.dk Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/adv7511/adv7511.h | 5 +---- drivers/gpu/drm/bridge/adv7511/adv7511_cec.c | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h index a0f6ee15c248..711061bf3eb7 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h @@ -386,10 +386,7 @@ void adv7511_cec_irq_process(struct adv7511 *adv7511, unsigned int irq1); #else static inline int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) { - unsigned int offset = adv7511->type == ADV7533 ? - ADV7533_REG_CEC_OFFSET : 0; - - regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset, + regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL, ADV7511_CEC_CTRL_POWER_DOWN); return 0; } diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c index a20a45c0b353..ddd1305b82b2 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_cec.c @@ -316,7 +316,7 @@ int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) goto err_cec_alloc; } - regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset, 0); + regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL, 0); /* cec soft reset */ regmap_write(adv7511->regmap_cec, ADV7511_REG_CEC_SOFT_RESET + offset, 0x01); @@ -343,7 +343,7 @@ int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) dev_info(dev, "Initializing CEC failed with error %d, disabling CEC\n", ret); err_cec_parse_dt: - regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL + offset, + regmap_write(adv7511->regmap, ADV7511_REG_CEC_CTRL, ADV7511_CEC_CTRL_POWER_DOWN); return ret == -EPROBE_DEFER ? ret : 0; }