Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9129321pxu; Mon, 28 Dec 2020 07:20:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBquHZj9xSkrusdsfFLiQKiD4F+AFHXnb+vyp2RA0rxiMSQSgnfWOPDUQsNQ0b3tKeQ66k X-Received: by 2002:a17:906:354a:: with SMTP id s10mr41927947eja.335.1609168814934; Mon, 28 Dec 2020 07:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168814; cv=none; d=google.com; s=arc-20160816; b=IbkBocao69Nn0aScUonIAi4cb5QszgPDxf5DI+29WsB6K0elNUuTns9t39N2E7b9vP fC4XBZhuXcIaLOB0xbI7I4B7J1v+1leKFAnaLar5+KnqxaDnw/GoR7EX3tAmZG4Y1euv zb7UAO7v4tKj2bPDBUtVwLU4ALlcUHL2+lMw6RWe9xflmC7YNstCYk4dfHeCsURPsndf MzOQCZ0K/muZcMzKV03dNUUUbRXGEebRYKHl8BJYENL71OBDB4ZAJhrKNWCUWrBIw2vW q/QOEkQ1MJNJprFfCRxP8NgmKiNHhSwAqrLm2DXF6y1UAzvNmGSHAXf0468iDwqP+Uai pIGQ== 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=kzUbkWGDFMf8uEKlNs9KOb+vyA5yB57DIRKpS6J2B7M=; b=ymVUdyIhX4UDCIW71R5ra/7LJXMhLUGnqZ6H3El6lJHoU3pO2QrdaKsQ90PwHeKnkb oLG+cYRbk6/m05n5NBi6FQ+FvtpkgW3mLUuEWn4BqulQ8RkP20iYjYSHab2+295ZSLe6 W8SyLQh/9MIJBiSbd4WD+VyCsJQooluiI5+ISPyyDtYZ18UFrpAQ/myj1HBUqsuFjtsy n84+5MPg0iJTieElKyZmLClqH43l8qEpsKeY6Z2Da+XwhuVLzfbFsz68A8bkn/M9gDKy kdq/8Zx5rKt7ZwNWhIq4sCKgne6Y9wK165DzP9GU7ztAvBdzL3L4kJt5DtJN9gp1u5pl C8dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZRA1AFdC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm18si19766805edb.422.2020.12.28.07.19.51; Mon, 28 Dec 2020 07:20:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZRA1AFdC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2437213AbgL1ODq (ORCPT + 99 others); Mon, 28 Dec 2020 09:03:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:37820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437160AbgL1ODn (ORCPT ); Mon, 28 Dec 2020 09:03:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 934B020791; Mon, 28 Dec 2020 14:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164183; bh=olZj1KjHhUKMN6RTBuDdrUGOGUDZ914utUyJaUpZVhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRA1AFdCqzuR3Z7R5wDX+XeczaNHLbyab7RsmqJ0zHuGgB6ErvsHWmayL6JcKkbnX Fraj+ITOQpXxfoBS9tI67LZpWDLoNW3YWxUIFz2idfpj3pqWB/fayX/ZtQ6rSG/PcK jsa9PxECuxFtRdnjqfgpKFjTMkQyyfo6+eDGmlnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhinav Kumar , Rob Clark , Sasha Levin Subject: [PATCH 5.10 091/717] drm/msm/dp: do not notify audio subsystem if sink doesnt support audio Date: Mon, 28 Dec 2020 13:41:29 +0100 Message-Id: <20201228125025.336303531@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Abhinav Kumar [ Upstream commit e8c765811b1064c200829eacf237ac8c25e79cd0 ] For sinks that do not support audio, there is no need to notify audio subsystem of the connection event. This will make sure that audio routes only to the primary display when connected to such sinks. changes in v2: - Added fixes tag - Removed nested if condition and removed usage of global pointer Fixes: d13e36d7d222 ("drm/msm/dp: add audio support for Display Port on MSM") Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dp/dp_display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 8703c63d85c87..fe0279542a1c2 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -563,7 +563,14 @@ static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data) static void dp_display_handle_plugged_change(struct msm_dp *dp_display, bool plugged) { - if (dp_display->plugged_cb && dp_display->codec_dev) + struct dp_display_private *dp; + + dp = container_of(dp_display, + struct dp_display_private, dp_display); + + /* notify audio subsystem only if sink supports audio */ + if (dp_display->plugged_cb && dp_display->codec_dev && + dp->audio_supported) dp_display->plugged_cb(dp_display->codec_dev, plugged); } -- 2.27.0