Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp465170ybi; Fri, 21 Jun 2019 02:41:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3G7UyEFBfWH/dmu4k2e6jMUXFyaadfmxhyHUHB6/oDeHttW9zPYxvKHLr+4K35JJSA4xF X-Received: by 2002:a17:90a:d34f:: with SMTP id i15mr5445934pjx.1.1561110119743; Fri, 21 Jun 2019 02:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561110119; cv=none; d=google.com; s=arc-20160816; b=dSxEwZmBQnpsZH+cZnE6UuLPYUnFHK5I2YSKDWBA3+Dr2N/gu0BUU9c9sYAv6JrdZ7 wxX8DtfOnH9iGTmGybQTNpyIX4NNNPYNCHhE8Jeg/5dppu31XHSoCafnKqXTnvwoHhdn haOx5vFHJptV32J1kGSA4+7NWKI5tlyeJA27gBNOKWsKwHleMewlfEa1KwDEKZd68I50 e9VIJfUehyqmpz3roUVebfOvfoOJPc4iINaPGQ/KP1BlKxT2HK7nUNFoKLKJ2mOpZjh5 Q3M0nBeJmy0QIVWwswJtpI9+0MaYa2ac7b7obDaA1/Yv4nB7zVzT7b9QoKqUbjEuu9YZ g/pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8vCdcbqoZQ1U1i7mBxY4bPH1TOrRBXQaqjxbkNh/nbQ=; b=aiavZiMJfT6z1U7E1Dqs2/R14lE2jiXBTB0AyEhLYzyY6wW+s+h4FF5tlkYBYJOLAM y7G5PjqaqY45sKNw0iEAk1Hh4+zU9nSHhGMIFRhOnzmA4XxWqWpAT/+MBJTSsHx1j69T N6qAgKe2Klc5GqmLxlHFiR0TA1c5D2gSispzcLW5nqRE6P3NcTKtbpqGUgltU5BMFFR5 6izmIy6X1D/LaFrkUt2vSfmkqFyxAy7fXQl+EXHtIuQdOGOLr97GGrR97lW/0h2kHvRd sAWIS0PW2VMxJowwMSoRj8GKdY+WDVIeV90vNMKhxvKQOBcDZeHSaVuHomV4Wz2fBLqx grnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aISYU0Au; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20si2237680pfh.95.2019.06.21.02.41.44; Fri, 21 Jun 2019 02:41:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aISYU0Au; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbfFUJkN (ORCPT + 99 others); Fri, 21 Jun 2019 05:40:13 -0400 Received: from mail-vk1-f195.google.com ([209.85.221.195]:33423 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbfFUJkM (ORCPT ); Fri, 21 Jun 2019 05:40:12 -0400 Received: by mail-vk1-f195.google.com with SMTP id y130so1170975vkc.0 for ; Fri, 21 Jun 2019 02:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8vCdcbqoZQ1U1i7mBxY4bPH1TOrRBXQaqjxbkNh/nbQ=; b=aISYU0AuOWSMAGgxgMsNgcwyyCsQfgC0WTiJZVc6DjDjjnxMKUEageDY0FcrkMp5o7 ifs6RlrFO0OjnAJaxSecDeakh4ZBOJPZ3vTpXi66AbMzyFoXJ4nrLFwPI1pk8zMLyg1v CuJnbc9bE0uzsi55qKLvlz/emOEVFfRxcBzaA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8vCdcbqoZQ1U1i7mBxY4bPH1TOrRBXQaqjxbkNh/nbQ=; b=qZnDRzMmZsyiTzaKY5WQdYlCwiBG9tRq+i88KF6CvCGFaNKYrwp8T89RTnumz12+4q Y4EkZBYCupqbVHk1Mb+dFGGIhhhD47xZXcf/ZXwTnsxcGdLEedj7EzbhuzZbKVOnRxbw bybiSKqxXHEolkbaEuhiGkEDzfIxbuJ/8/Il6lYp6L3sn2fUU3gMkKbF3CHMaS4WocTV R4TaslvMun5s7WlAOFBTiQ+FR1WxPqXKJpk2TR7n41NoAY48tnRLD31d9/6K71xpKHYb MrTt1LBFxTMxP3tjLeDn/eDDLePlIkn1a2jDTugCu1yJs5FLVzVXH2e1vuFBhpuSXhgf 4FiQ== X-Gm-Message-State: APjAAAUu5g+GZr0emEnWuPJugoG7yvOhRIABPnVPoPFZiRZDqlgCu7/R dnZfCkf5/qpg0rDYjEjq/fn7oxLLslJSOhvJyTV1qA== X-Received: by 2002:a1f:3692:: with SMTP id d140mr9227965vka.88.1561110010447; Fri, 21 Jun 2019 02:40:10 -0700 (PDT) MIME-Version: 1.0 References: <20190603080931.GG21222@phenom.ffwll.local> <20190604072411.GP21222@phenom.ffwll.local> <20190611123455.GD2458@phenom.ffwll.local> <20190618121220.GU12905@phenom.ffwll.local> <20190620092506.GP12905@phenom.ffwll.local> <20190620211204.GW12905@phenom.ffwll.local> In-Reply-To: <20190620211204.GW12905@phenom.ffwll.local> From: Cheng-yi Chiang Date: Fri, 21 Jun 2019 17:39:43 +0800 Message-ID: Subject: Re: [PATCH 1/7] video: add HDMI state notifier support To: Cheng-yi Chiang , Hans Verkuil , linux-kernel , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , Philipp Zabel , Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela , Russell King , Andrzej Hajda , Laurent Pinchart , David Airlie , Rob Herring , Heiko Stuebner , Doug Anderson , Dylan Reid , tzungbi@chromium.org, linux-media@vger.kernel.org, "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, Dariusz Marcinkiewicz Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 5:12 AM Daniel Vetter wrote: > > Massively cutting this thread, since halfway through in my previous reply > I realized that maybe hdmi_codec is a much better starting point. > ACK > On Thu, Jun 20, 2019 at 09:23:23PM +0800, Cheng-yi Chiang wrote: > > On Thu, Jun 20, 2019 at 5:25 PM Daniel Vetter wrote: > > > Yeah fully agreeing that hdmi_audio_code is probably a better starting > > > point. Problem is that becuase hdmi_codec is built on top of platform > > > device it's quite a bit harder to extend with callbacks and things like > > > that, without breaking the driver model. > > > > > > I need to think about this more, but if all we need to look at is > > > hdmi_codec, then I think this becomes a lot easier. And we can ignore > > > drm_audio_component.h completely. > > > > > > It is surprising that you think this way. > > Maybe the original patch before hdmi-notifier was introduced is the > > better way to solve this issue, if we only need to look at hdmi_codec. > > > > The history of hdmi_codec driver is in this patch series: > > > > https://lore.kernel.org/patchwork/patch/539656/ > > Hm, this doesn't seem to be the hdmi_codec driver I meant, but another, > new one. I was talking about SND_SOC_HDMI_CODEC. > Yes you are right. They are different codec drivers. Sorry for the confusion. What I meant was that my use case on RK3288 was using dw-hdmi-audio.c codec driver, which was later replaced by a more general version hdmi-codec.c. > > There was a callback mechanism implemented between dw-hdmi and hdmi > > codec driver. > > It was later consolidated by Doug in this patch for better jack status > > reporting: > > > > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/303573/ > > Hm that still seems entirely separate hdmi-codec specific to dw-hdmi only > ... > Again you are right. Sorry for the confusion. What I meant is that this callback mechanism should work on hdmi-codec.c driver as well. > > I am not sure why the original patch series did not get fully accepted > > in the upstream. > > It was quite long time ago. > > > > But if you think this might be the right way to do, then it is even > > better for us because the patch series and Doug's patch had been quite > > stable > > on our RK3288 products for about four years with plenty of users, so > > we have much higher confidence in them. > > I can rebase and clean up them and post another patch for review. > > > > Please let me know what approach you feel is better. > > Thanks again! > > Not sure we're talking about the same. What I had in mind is to add jack > status to the hdmi-codec.c stuff, which is used by multiple soc drm > display drivers already. Looking at git grep output, there seems to be > already some support for dw-hdmi synopsys drm_bridge driver. I thought of > extending that. Does that not work for you? > I think extending current interface will work. There is a struct hdmi_codec_pdata to let ALSA codec driver access some ops through platform data. And after this patch https://lore.kernel.org/patchwork/patch/692324/ ALSA codec driver can get access to the struct on DRM side. Based on this I can add a new ops to register callback function for jack status. It will be similar to Doug's chromium patch above. I think that is quite a feasible way, and can benefit all boards using hdmi-codec.c. Thanks a lot!! > Thanks, Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch