From patchwork Mon Oct 24 11:29:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp480639wru; Mon, 24 Oct 2022 07:21:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62V9pZFL9aIllLip8mzNpEaAjmJL+LwmA0AW0UnXoD5ALqc4W6AikmpZ+gsVYbJ+vNQ7F2 X-Received: by 2002:a17:907:1c8a:b0:782:1a0d:3373 with SMTP id nb10-20020a1709071c8a00b007821a0d3373mr26883106ejc.135.1666621283441; Mon, 24 Oct 2022 07:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621283; cv=none; d=google.com; s=arc-20160816; b=cFkhMovew9xg3r2GO2Y7kUHB8ix3sM54Jy3iiL+gxodOUZGKg1/DIuiF0bDUM8KmMZ Ck463Db8muWNQvw7LnDuRJ2KvmkTGn8PQT+DS5gk6amf0Rv4gmJqVDtg4Sty+7Znh0cj +YeSOUvDChnf3rWztuez+zOWhb1OKORYzCRRWOBZBD1dNJvqwprj4B31sbqdmdvMlAc5 gWy3JY0lo/52dBdaD0rQ5kfLIMtwAn2ITIIkL+G3FNirrwEB/LCnvvf1qGaqELlwO64x U6bL3Q2AKu03X0j2pxZ/oKkSZMvkeZWFqQjjHkWHDHl9B3VUmrVjjJcoA/fUcLGFIW+i Gt0w== 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=IwYgoUcLLFLrbKpQ0Px2Ko0UU8x59P+uAprM7cph0q0=; b=FyRxZB6+PV3EaKKZJyQhlIktOg+dWv44+w7hTvr6DIRrrnY4bDcp/y8z5bBeLHAL/L nEpb3lB6DIUEm8qSZ+AkOpV9d4/F0DUXkBXKIdPZYUlKtdXdGq0x+RmGmFDmqrW7Qrac TJeOFK3eABpYE/DbQqWz2MgmaYeByBNRcKKsaa3th3Co3PkdHH8FggGewcCV0emMvuub Q7uW1OTjRaldBzBpZHwnGlbIeA5c6HgliIlzNmLROH5DGYVDtibJRBdbAPqZrlNXqfnK 2ZRWuAh3zt6zI6UbV7loFx6tJcGwl8i3dHyo8Ls1UYQY+q+wfw5VyFkdss9ptY740fIW j66g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i/v8rd1c"; 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 dn15-20020a17090794cf00b0078d2ecb1d38si31073334ejc.832.2022.10.24.07.20.55; Mon, 24 Oct 2022 07:21:23 -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="i/v8rd1c"; 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 S235201AbiJXOSz (ORCPT + 99 others); Mon, 24 Oct 2022 10:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235211AbiJXOOe (ORCPT ); Mon, 24 Oct 2022 10:14:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3581EE46; Mon, 24 Oct 2022 05:54:11 -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 1DD7D612A5; Mon, 24 Oct 2022 12:42:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 334F1C433D7; Mon, 24 Oct 2022 12:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615324; bh=r49JMVeVIjpFQw3blqoYd2C9BmlZp5GcV0pBs2vtgvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i/v8rd1c9Tqhv8gvuKDp5kV3nGYb6tok1a9GcmP040Ci+HNc1CFruEf8wnrbXhQ7f BYpBDM9yUr5DXIxX4+f8RmVemX5HyADBnAkeRC65EDVHfP7ALs/iwg7z60ndL+P0Av DeJn7iKsm8WGLJzhsWl60JtAFYgY53HtNS/cmwUE= 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.15 208/530] drm: bridge: adv7511: fix CEC power down control register offset Date: Mon, 24 Oct 2022 13:29:12 +0200 Message-Id: <20221024113054.491703722@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747579079288815689?= X-GMAIL-MSGID: =?utf-8?q?1747579079288815689?= 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 1b00dfda6e0d..aeeb09a27202 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h @@ -387,10 +387,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; }