From patchwork Thu Apr 2 18:34:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7DEFC2BA12 for ; Thu, 2 Apr 2020 18:43:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D8EC2078E for ; Thu, 2 Apr 2020 18:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389065AbgDBSnE (ORCPT ); Thu, 2 Apr 2020 14:43:04 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:54775 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388540AbgDBSnE (ORCPT ); Thu, 2 Apr 2020 14:43:04 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MLiXQ-1jbkDG13se-00HgBH for ; Thu, 02 Apr 2020 20:43:02 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id 08EBD650A8B for ; Thu, 2 Apr 2020 18:43:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lYWiZEtjGgQM for ; Thu, 2 Apr 2020 20:43:01 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id A09A464D593 for ; Thu, 2 Apr 2020 20:43:01 +0200 (CEST) Received: from pflmari.corp.cetitec.com (10.8.5.12) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 20:43:01 +0200 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id 768EB804FE; Thu, 2 Apr 2020 20:34:03 +0200 (CEST) Date: Thu, 2 Apr 2020 20:34:03 +0200 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v5 2/9] media: adv748x: include everything adv748x.h needs into the file Message-ID: <046f909122e03286faf0a8916f30d56259656e14.1585852001.git.alexander.riesen@cetitec.com> Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.12] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6C7266 X-Provags-ID: V03:K1:mSnZgHVTaF2b5+9lcEMcZ/7WRWNtYmf6y96KI5NeftGFEMzOPtp vL9+3FV5W61+DHMuxnHHuDgZBdxuWzcJOvvTye+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.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org To follow the established practice of not depending on others to pull everything in. While at it, make sure it stays like this. Signed-off-by: Alexander Riesen Reviewed-by: Laurent Pinchart --- drivers/media/i2c/adv748x/adv748x-afe.c | 6 ++---- drivers/media/i2c/adv748x/adv748x-core.c | 6 ++---- drivers/media/i2c/adv748x/adv748x-csi2.c | 6 ++---- drivers/media/i2c/adv748x/adv748x-hdmi.c | 6 ++---- drivers/media/i2c/adv748x/adv748x.h | 2 ++ 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c b/drivers/media/i2c/adv748x/adv748x-afe.c index dbbb1e4d6363..5a25d1fbe25f 100644 --- a/drivers/media/i2c/adv748x/adv748x-afe.c +++ b/drivers/media/i2c/adv748x/adv748x-afe.c @@ -6,18 +6,16 @@ * Copyright (C) 2017 Renesas Electronics Corp. */ +#include "adv748x.h" + #include #include #include #include -#include -#include #include #include -#include "adv748x.h" - /* ----------------------------------------------------------------------------- * SDP */ diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c index c3fb113cef62..5c59aad319d1 100644 --- a/drivers/media/i2c/adv748x/adv748x-core.c +++ b/drivers/media/i2c/adv748x/adv748x-core.c @@ -10,6 +10,8 @@ * Kieran Bingham */ +#include "adv748x.h" + #include #include #include @@ -20,14 +22,10 @@ #include #include -#include -#include #include #include #include -#include "adv748x.h" - /* ----------------------------------------------------------------------------- * Register manipulation */ diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c index c43ce5d78723..c00d4f347d95 100644 --- a/drivers/media/i2c/adv748x/adv748x-csi2.c +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c @@ -5,15 +5,13 @@ * Copyright (C) 2017 Renesas Electronics Corp. */ +#include "adv748x.h" + #include #include -#include -#include #include -#include "adv748x.h" - static int adv748x_csi2_set_virtual_channel(struct adv748x_csi2 *tx, unsigned int vc) { diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c index c557f8fdf11a..f598acec3b5c 100644 --- a/drivers/media/i2c/adv748x/adv748x-hdmi.c +++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c @@ -5,18 +5,16 @@ * Copyright (C) 2017 Renesas Electronics Corp. */ +#include "adv748x.h" + #include #include -#include -#include #include #include #include -#include "adv748x.h" - /* ----------------------------------------------------------------------------- * HDMI and CP */ diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h index fccb388ce179..09aab4138c3f 100644 --- a/drivers/media/i2c/adv748x/adv748x.h +++ b/drivers/media/i2c/adv748x/adv748x.h @@ -19,6 +19,8 @@ */ #include +#include +#include #ifndef _ADV748X_H_ #define _ADV748X_H_ From patchwork Thu Apr 2 18:34:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99076C43331 for ; Thu, 2 Apr 2020 18:49:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6986120719 for ; Thu, 2 Apr 2020 18:49:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390086AbgDBSts (ORCPT ); Thu, 2 Apr 2020 14:49:48 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:38339 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388778AbgDBSts (ORCPT ); Thu, 2 Apr 2020 14:49:48 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MPoTl-1jfqkz2diV-00MqJw for ; Thu, 02 Apr 2020 20:49:46 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id 5ACA565052F for ; Thu, 2 Apr 2020 18:49:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EmxrTeCl11DH for ; Thu, 2 Apr 2020 20:49:46 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 0B01464F45C for ; Thu, 2 Apr 2020 20:49:46 +0200 (CEST) Received: from pflmari.corp.cetitec.com (10.8.5.12) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 20:49:45 +0200 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id E554580501; Thu, 2 Apr 2020 20:34:27 +0200 (CEST) Date: Thu, 2 Apr 2020 20:34:27 +0200 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v5 4/9] media: adv748x: add definitions for audio output related registers Message-ID: <26573ecdb48aa816f802b9d8bbe5f74157248021.1585852001.git.alexander.riesen@cetitec.com> Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.12] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6C7266 X-Provags-ID: V03:K1:O83jhekFIroCL+n+QkcQv1HdgxwHxyJqYnRialh5HJT2D4Sf4ML 68tFx4Jr9baTOLZ0e3jkFc/ptoc/3OfXgAE0Bl2QMS/fsV0pb+ZpggjszLJupx9vdE4F7MW DqPXx41Zr8+g10r+EHeBfvt6j9LlcSi1j+/qGBXmHvVbYvzb0XbvVLgHdpv3ThNvwsI0Vna g91adyTWRfCBsefiRqJtQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:Rc3mc4Bn9YA=:fry6t4l8pYMzvDU5e3Rwo3 2xMfLMofFqcOaanBYrQ6WBp87Bw2C3XTobCIw/P5euH7MPsnbD8dRM3NUcKfdLBGPEprgHLby 48VipWXBLK1VW1+RHGor2GAKa5aIReu5bAswAitcn200t5on6+FO1hFGg4VMQlQgJpbKzKqdl +bGew6obU87BvcNbdiBpWvY/EB9cW4/KAvKRJHOoO3GX/R18oo7Bm52SvyXwn220YtgcSB6PW 26RL1wKzRer3o21J2XtZtmn2gzY7AV5gnXc1pXBRdPeXQJSIFW5PlSh+Ef511lmg41BVIokY1 aEs3ubsm8NXXL/o4KVOblLBhlbvCJ2vXE0oE3gB2WFqjILjj0NH1X6qRQPFbniX7ViEzmZbqO y99qJF/sfqjtwGGwoqu2yN1nu8qlr93dclfeZ2rXFhJLAkXdHOMXQk8Hc1EXSXTyn9GXDY50j Rr5TLK/eSEV2MPTdGoV8LB8kqN0/LBT3R1jltCnL1Bir81oBj6LHEWnthlaEfvRo5NE5zJtmr q9vEYRTA0rJlWB8LKSQ3w2W523eUjAHhJ/JrMtSExSJzOuFv5/48ZLD6WqZTo+e9N2gwaZH/f 6rdF0LkzrE5reg56Nb+smsqNxYFakd3t/Xb1/LIG4K1vUPYrJzUU6XoIakTvezz2aZXXhLue5 V9rIqxMeXQU2sWcu5YSPrLXMNWhG+D3GgdsJD0vMXJ70UkUSIY44JVzul0sAlQmOHD2qs4JZV L51FL1a1HAZIwENQah6ecLB6+irv7k8IThGpCRyGqELdetcbP1RDvNnuH5kmJ0BHy6vxv7Hs+ a3CCNaPjI90gb8ZrJzVut286OjEAHeS+MgQL7Zkh36tBrukJU3Fn6CrAcWwygky6iUz4d1E Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Alexander Riesen --- drivers/media/i2c/adv748x/adv748x.h | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x.h b/drivers/media/i2c/adv748x/adv748x.h index 0a9d78c2870b..1a1ea70086c6 100644 --- a/drivers/media/i2c/adv748x/adv748x.h +++ b/drivers/media/i2c/adv748x/adv748x.h @@ -226,6 +226,11 @@ struct adv748x_state { #define ADV748X_IO_VID_STD 0x05 +#define ADV748X_IO_PAD_CONTROLS 0x0e +#define ADV748X_IO_PAD_CONTROLS_TRI_AUD BIT(5) +#define ADV748X_IO_PAD_CONTROLS_PDN_AUD BIT(1) +#define ADV748X_IO_PAD_CONTROLS1 0x1d + #define ADV748X_IO_10 0x10 /* io_reg_10 */ #define ADV748X_IO_10_CSI4_EN BIT(7) #define ADV748X_IO_10_CSI1_EN BIT(6) @@ -248,7 +253,21 @@ struct adv748x_state { #define ADV748X_IO_REG_FF 0xff #define ADV748X_IO_REG_FF_MAIN_RESET 0xff +/* DPLL Map */ +#define ADV748X_DPLL_MCLK_FS 0xb5 +#define ADV748X_DPLL_MCLK_FS_N_MASK GENMASK(2, 0) + /* HDMI RX Map */ +#define ADV748X_HDMI_I2S 0x03 /* I2S mode and width */ +#define ADV748X_HDMI_I2SBITWIDTH_MASK GENMASK(4, 0) +#define ADV748X_HDMI_I2SOUTMODE_SHIFT 5 +#define ADV748X_HDMI_I2SOUTMODE_MASK \ + GENMASK(6, ADV748X_HDMI_I2SOUTMODE_SHIFT) +#define ADV748X_I2SOUTMODE_I2S 0 +#define ADV748X_I2SOUTMODE_RIGHT_J 1 +#define ADV748X_I2SOUTMODE_LEFT_J 2 +#define ADV748X_I2SOUTMODE_SPDIF 3 + #define ADV748X_HDMI_LW1 0x07 /* line width_1 */ #define ADV748X_HDMI_LW1_VERT_FILTER BIT(7) #define ADV748X_HDMI_LW1_DE_REGEN BIT(5) @@ -260,6 +279,16 @@ struct adv748x_state { #define ADV748X_HDMI_F1H1 0x0b /* field1 height_1 */ #define ADV748X_HDMI_F1H1_INTERLACED BIT(5) +#define ADV748X_HDMI_MUTE_CTRL 0x1a +#define ADV748X_HDMI_MUTE_CTRL_MUTE_AUDIO BIT(4) +#define ADV748X_HDMI_MUTE_CTRL_WAIT_UNMUTE_MASK GENMASK(3, 1) +#define ADV748X_HDMI_MUTE_CTRL_NOT_AUTO_UNMUTE BIT(0) + +#define ADV748X_HDMI_AUDIO_MUTE_SPEED 0x0f +#define ADV748X_HDMI_AUDIO_MUTE_SPEED_MASK GENMASK(4, 0) +#define ADV748X_MAN_AUDIO_DL_BYPASS BIT(7) +#define ADV748X_AUDIO_DELAY_LINE_BYPASS BIT(6) + #define ADV748X_HDMI_HFRONT_PORCH 0x20 /* hsync_front_porch_1 */ #define ADV748X_HDMI_HFRONT_PORCH_MASK 0x1fff @@ -281,6 +310,9 @@ struct adv748x_state { #define ADV748X_HDMI_TMDS_1 0x51 /* hdmi_reg_51 */ #define ADV748X_HDMI_TMDS_2 0x52 /* hdmi_reg_52 */ +#define ADV748X_HDMI_REG_6D 0x6d /* hdmi_reg_6d */ +#define ADV748X_I2S_TDM_MODE_ENABLE BIT(7) + /* HDMI RX Repeater Map */ #define ADV748X_REPEATER_EDID_SZ 0x70 /* primary_edid_size */ #define ADV748X_REPEATER_EDID_SZ_SHIFT 4 From patchwork Thu Apr 2 18:34:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AF50C43331 for ; Thu, 2 Apr 2020 18:56:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79017206F8 for ; Thu, 2 Apr 2020 18:56:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389747AbgDBS4q (ORCPT ); Thu, 2 Apr 2020 14:56:46 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:53179 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388658AbgDBS4q (ORCPT ); Thu, 2 Apr 2020 14:56:46 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MWAjC-1jqYUx1IPi-00Xfun for ; Thu, 02 Apr 2020 20:56:45 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id 165AB65073A for ; Thu, 2 Apr 2020 18:56:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5OhCidiLQcDj for ; Thu, 2 Apr 2020 20:56:44 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id C3B2564E883 for ; Thu, 2 Apr 2020 20:56:44 +0200 (CEST) Received: from pflmari.corp.cetitec.com (10.8.5.12) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 20:56:44 +0200 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id E692280503; Thu, 2 Apr 2020 20:34:48 +0200 (CEST) Date: Thu, 2 Apr 2020 20:34:48 +0200 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v5 6/9] media: adv748x: prepare/enable mclk when the audio is used Message-ID: Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.12] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6C7266 X-Provags-ID: V03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vty2zaDgV1 QZYvz1urQvXycs4y/xoysCF7CV+K2+SOElA6cYLb7XyykGy636uFhgCcZ++0ssNI6PJSuUw Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As there is nothing else (the consumers are supposed to do that) which enables the clock, do it in the driver. Signed-off-by: Alexander Riesen --- v3: added --- drivers/media/i2c/adv748x/adv748x-dai.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv748x/adv748x-dai.c b/drivers/media/i2c/adv748x/adv748x-dai.c index c9191f8f1ca8..185f78023e91 100644 --- a/drivers/media/i2c/adv748x/adv748x-dai.c +++ b/drivers/media/i2c/adv748x/adv748x-dai.c @@ -117,11 +117,22 @@ static int adv748x_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int adv748x_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai *dai) { + int ret; struct adv748x_state *state = state_of(dai); if (sub->stream != SNDRV_PCM_STREAM_CAPTURE) return -EINVAL; - return set_audio_pads_state(state, 1); + ret = set_audio_pads_state(state, 1); + if (ret) + goto fail; + ret = clk_prepare_enable(mclk_of(state)); + if (ret) + goto fail_pwdn; + return 0; +fail_pwdn: + set_audio_pads_state(state, 0); +fail: + return ret; } static int adv748x_dai_hw_params(struct snd_pcm_substream *sub, @@ -174,6 +185,7 @@ static void adv748x_dai_shutdown(struct snd_pcm_substream *sub, struct snd_soc_d { struct adv748x_state *state = state_of(dai); + clk_disable_unprepare(mclk_of(state)); set_audio_pads_state(state, 0); } From patchwork Thu Apr 2 18:35:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDE9C43331 for ; Thu, 2 Apr 2020 19:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0E7520719 for ; Thu, 2 Apr 2020 19:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731823AbgDBTLK (ORCPT ); Thu, 2 Apr 2020 15:11:10 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:59053 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731689AbgDBTLK (ORCPT ); Thu, 2 Apr 2020 15:11:10 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N1cvQ-1jDe9E07eS-0122ab for ; Thu, 02 Apr 2020 21:11:08 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id AE49C650ABD for ; Thu, 2 Apr 2020 19:11:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pawzmrpyMw0D for ; Thu, 2 Apr 2020 21:11:06 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 3E2D464F42F for ; Thu, 2 Apr 2020 21:11:06 +0200 (CEST) Received: from pflmari.corp.cetitec.com (10.8.5.12) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 21:08:44 +0200 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id 34C0C80505; Thu, 2 Apr 2020 20:35:06 +0200 (CEST) Date: Thu, 2 Apr 2020 20:35:06 +0200 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v5 8/9] dt-bindings: adv748x: add information about serial audio interface (I2S/TDM) Message-ID: <337b689519806178458ab77385c8ac6f510cb0da.1585852001.git.alexander.riesen@cetitec.com> Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.12] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6C7266 X-Provags-ID: V03:K1:SPg5b4N94NVzAScZGVN7iTZJ0se/aNq0FHI5AlMDet/mC4EI+1H qjz4I+gJ4bTm6fM97NVfCELM6Nh0Fc1LnpFqVO8Ch3rth/Fwl+LvBdf3314fiQW6JkJaD93 wSItqtAGvujAbxg4X/SSKzqtdbu3TrkSLgwGj7XJ2bwfWesCcaL8S+9Ska+YYyQfQNgHehC LluC/fwXgpiOHgo59887Q== X-UI-Out-Filterresults: notjunk:1; V03:K0:Tk5l9sG2w4k=:q7g9UzKyZctVnQcfrLcFVh Lfhauz/kosa6mh1FPKzxyU9mRf3AlVioS43y3iyY+s7yDHePXn3g2wx0yQGfMStU+8pqdN3XD WA7KdPVWbD9ZOUh1ZB4G1r7N8XBKlRLg4xMF8BXZjEq41wC+BPUijrm2hcmSYUy20YhbEcOX0 LzP/xyckYNA+Of192wBRpIs6iKsbz1cQ2vOU5rPZ3meS3aQttyOCKKGvDTvRZferf4O7wwbl6 rQCs2zxpmq8g02PnQQyCu/M1Pnc3uTuCE+w9tBLmSrbWU9/oSYJx1TUMHv+OmQcwJzBUQtQM0 QSFDcRMtM6FwQQ3fRzqdHHYEa34FBFHnqPq3mCCeC1kXgNL3nR2TOzND75lcIjhz1MZwGYc6q RHm6nrWC4j5Eb6I6HXGdnozXHi44BRL2zUbWXJnIaTHMEWYyUU55XioSSckVfLG61u6souPyy 3R0FXE05WWChIWNs/fXfQnQ7kq7pCTrB4MyQJwPqnE0VbMg7/PPzYtvvWgWLl4OuIF98Kjuen rkR14asFmyzadqKBvS8KYx50oI0zM2hR0UrC9pmleaLUz4dqSyLqHIdF6FPz2d7r4HRU+WK/2 sqPn+UUy4TRQShy96uOfFPxhKCB64dj/UtwdbNsgI4FElPXRQnDinXleYZpGgBTw/m7KWx/fq JzxlblE+PNLlE1DWOt4/xq2K6Zdc8QNCVdeRr4dLhxPhee8dQtsY9+4CVQkOqra8vEFgv4czW Om0DEfGL9eDTVAt34ZJzld9xQib8ItBpgfB8wDIiokU0PZyIFnBClyLvjjvLsethDgASy4J9H G3J2fkCrX4RipqaKVz+8pfB3GhOE2h/CMkjkqdDdlnAypEoNRFhAso4W+MdtMIY6zm95+E3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As the driver has some support for the audio interface of the device, the bindings file should mention it. Signed-off-by: Alexander Riesen Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart --- v3: remove optionality off MCLK clock cell to ensure the description matches the hardware no matter if the line is connected. Suggested-by: Geert Uytterhoeven --- .../devicetree/bindings/media/i2c/adv748x.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/i2c/adv748x.txt b/Documentation/devicetree/bindings/media/i2c/adv748x.txt index 4f91686e54a6..50a753189b81 100644 --- a/Documentation/devicetree/bindings/media/i2c/adv748x.txt +++ b/Documentation/devicetree/bindings/media/i2c/adv748x.txt @@ -2,7 +2,9 @@ The ADV7481 and ADV7482 are multi format video decoders with an integrated HDMI receiver. They can output CSI-2 on two independent outputs TXA and TXB -from three input sources HDMI, analog and TTL. +from three input sources HDMI, analog and TTL. There is also support for an +I2S-compatible interface connected to the audio processor of the HDMI decoder. +The interface has TDM capability (8 slots, 32 bits, left or right justified). Required Properties: @@ -16,6 +18,8 @@ Required Properties: slave device on the I2C bus. The main address is mandatory, others are optional and remain at default values if not specified. + - #clock-cells: must be <0> + Optional Properties: - interrupt-names: Should specify the interrupts as "intrq1", "intrq2" and/or @@ -47,6 +51,7 @@ are numbered as follows. TTL sink 9 TXA source 10 TXB source 11 + I2S source 12 The digital output port nodes, when present, shall contain at least one endpoint. Each of those endpoints shall contain the data-lanes property as @@ -72,6 +77,7 @@ Example: #address-cells = <1>; #size-cells = <0>; + #clock-cells = <0>; interrupt-parent = <&gpio6>; interrupt-names = "intrq1", "intrq2"; @@ -113,4 +119,12 @@ Example: remote-endpoint = <&csi20_in>; }; }; + + port@c { + reg = <12>; + + adv7482_i2s: endpoint { + remote-endpoint = <&i2s_in>; + }; + }; };