From patchwork Wed Jul 25 03:32:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Qu, Jim" X-Patchwork-Id: 10543423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52AA514E2 for ; Wed, 25 Jul 2018 03:33:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 417CA28573 for ; Wed, 25 Jul 2018 03:33:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33F2F2866F; Wed, 25 Jul 2018 03:33:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 851D828573 for ; Wed, 25 Jul 2018 03:33:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8219789DC9; Wed, 25 Jul 2018 03:32:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0043.outbound.protection.outlook.com [104.47.40.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DE8F89DB5; Wed, 25 Jul 2018 03:32:55 +0000 (UTC) Received: from DM3PR12MB0873.namprd12.prod.outlook.com (10.164.7.143) by DM3PR12MB0859.namprd12.prod.outlook.com (10.164.7.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.20; Wed, 25 Jul 2018 03:32:52 +0000 Received: from DM3PR12MB0873.namprd12.prod.outlook.com ([fe80::8ce9:6961:2e6d:6415]) by DM3PR12MB0873.namprd12.prod.outlook.com ([fe80::8ce9:6961:2e6d:6415%4]) with mapi id 15.20.0995.014; Wed, 25 Jul 2018 03:32:52 +0000 From: "Qu, Jim" To: Takashi Iwai , "alsa-devel@alsa-project.org" Subject: =?eucgb2312_cn?b?tPC4tDogW1BBVENIIDMvNF0gZHJtL3JhZGVvbjogQWRkIGF1ZGlvIGNv?= =?eucgb2312_cn?b?bXBvbmVudCBzdXBwb3J0?= Thread-Topic: [PATCH 3/4] drm/radeon: Add audio component support Thread-Index: AQHUIpSIe2EILI84j0K+lxQ/T1y7SaSfSG4f Date: Wed, 25 Jul 2018 03:32:52 +0000 Message-ID: References: <20180723145030.25133-1-tiwai@suse.de>, <20180723145030.25133-4-tiwai@suse.de> In-Reply-To: <20180723145030.25133-4-tiwai@suse.de> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [116.228.147.241] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM3PR12MB0859; 20:6K2QLM8XChUcoIBt98BuKKDYRr6V7rCOeFFAk6H8TpaVNpu4CH76vhGTn5UznrJRZSgaUOO21L1vdBUt3o6f77b79VfgrQypjmfzLe5jJruqOWNn/3jlrs/deir3bwukFBjxRTplMxF4h6cvHOsxdb2hz9MCfmpLxIuIqXI/f1dt+Gw/4Mda1Sv/vjkLM7m2Uye5GS2+94B1MXLQdQ/hApTakvAukpaVy+Uli9cFY3V03nw7AtjsaCpoFbVmpAY9 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 9de00148-165f-4f09-d4a0-08d5f1df4da2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM3PR12MB0859; x-ms-traffictypediagnostic: DM3PR12MB0859: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(217544274631240); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM3PR12MB0859; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0859; x-forefront-prvs: 0744CFB5E8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(346002)(376002)(366004)(396003)(189003)(199004)(6116002)(81156014)(26005)(33656002)(3846002)(186003)(8936002)(102836004)(6506007)(11346002)(68736007)(81166006)(7696005)(97736004)(76176011)(55016002)(446003)(9686003)(6306002)(53936002)(486006)(6436002)(4326008)(2900100001)(25786009)(2906002)(14454004)(2501003)(5250100002)(224303003)(966005)(45080400002)(478600001)(110136005)(72206003)(476003)(305945005)(7736002)(74316002)(99286004)(54906003)(316002)(5660300001)(575784001)(86362001)(14444005)(105586002)(256004)(106356001)(66066001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0859; H:DM3PR12MB0873.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: FwomAh2oDkU5redbSgGVlC6i1iiJKOB9faVs1I82Yi0MW2hrOyQ3UjZ0t2LQ2mZImI6dVYsPDhxBd4vGe91F2ttwp0fo6JU12/YgHWEa1oZFVDRNTtzpsU6wTMs9cytPMc+PkIaDYDIFgBJe/sgY+fiUEWIBS/0uJmGhTn4M53HPG4z8HjwYObwv5JaWOBTWqP1qP2dAl61/+/29KGeq+Y9nnvlZEtWXRyQtPRya+tnBO3i885WKQ60agfmPtLpYpNWzsKq0dApJpwqjhhpKxleoZryQti8IAz2YsN5n0z3UcLg3AgyQi69btgIzJNIgiEJfsPqRCCHzBCVrvQT6BlmZoRYA+UhC961/Tuy4ajA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9de00148-165f-4f09-d4a0-08d5f1df4da2 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2018 03:32:52.4520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0859 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Takashi lwai, Sorry, I have to use outlook again, since my mail client had some problems that did not receive these series patches. See the commands in line. Thanks JimQu diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 2a72d2feb76d..2c7112ddfed4 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -170,6 +170,7 @@ config DRM_RADEON select BACKLIGHT_CLASS_DEVICE select BACKLIGHT_LCD_SUPPORT select INTERVAL_TREE + select SND_HDA_COMPONENT if SND_HDA_CORE help Choose this option if you have an ATI Radeon graphics card. There are both PCI and AGP versions. You don't need to choose this to diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 4a2eb409aacc..fad58df0bf19 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -75,6 +75,7 @@ #include #include +#include #include "radeon_family.h" #include "radeon_mode.h" @@ -1760,6 +1761,8 @@ struct r600_audio { struct radeon_audio_funcs *hdmi_funcs; struct radeon_audio_funcs *dp_funcs; struct radeon_audio_basic_funcs *funcs; + struct drm_audio_component *component; + bool component_registered; }; /* diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index 770e31f5fd1b..58e149b7a7a4 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -23,6 +23,7 @@ */ #include +#include #include #include #include "radeon.h" @@ -248,6 +249,7 @@ static void radeon_audio_enable(struct radeon_device *rdev, struct drm_encoder *encoder; struct radeon_encoder *radeon_encoder; struct radeon_encoder_atom_dig *dig; + struct drm_audio_component *acomp = rdev->audio.component; int pin_count = 0; if (!pin) @@ -269,6 +271,10 @@ static void radeon_audio_enable(struct radeon_device *rdev, if (rdev->audio.funcs->enable) rdev->audio.funcs->enable(rdev, pin, enable_mask); + + if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) + acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr, + pin->id, -1); >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Jim: radeon_audio_enable() can enable audios and also disable them, so eld noitfy callback should be called when enable_mask is true.