From patchwork Thu Mar 19 17:42:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Riesen X-Patchwork-Id: 210524 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 F3FF7C4332D for ; Thu, 19 Mar 2020 17:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D45E9208C3 for ; Thu, 19 Mar 2020 17:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728673AbgCSRmr (ORCPT ); Thu, 19 Mar 2020 13:42:47 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:34335 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727009AbgCSRmr (ORCPT ); Thu, 19 Mar 2020 13:42:47 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M6m1g-1jDL2206Os-008Nbk; Thu, 19 Mar 2020 18:42:28 +0100 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id A53C765021B; Thu, 19 Mar 2020 17:42:27 +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 ueP1BSl6eNCA; Thu, 19 Mar 2020 18:42:27 +0100 (CET) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 5716D64FCB4; Thu, 19 Mar 2020 18:42:27 +0100 (CET) Received: from pflmari.corp.cetitec.com (10.8.5.52) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 19 Mar 2020 18:42:27 +0100 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id AFE738050C; Thu, 19 Mar 2020 18:42:26 +0100 (CET) Date: Thu, 19 Mar 2020 18:42:26 +0100 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v2 06/10] media: adv748x: only activate DAI if it is described in device tree Message-ID: <59bbe09aa6e42b3b226b394dc7edf6ac8e385d47.1584639664.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.52] 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: 37303A290D7F536A6D7762 X-Provags-ID: V03:K1:VN3VMvTICSQ56pLhXQ+DUtZDlCw5I8O1qjE7zi2ANwi99hhSBiK VVPuS5wMcnNx7McRoEj9B8jRCdc579FbPXHjiCjOScMXzntsm4/04BS6MkKYoUME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precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org To avoid setting it up even if the hardware is not actually connected to anything physically. Besides, the bindings explicitly notes that port definitions are "optional if they are not connected to anything at the hardware level". Signed-off-by: Alexander Riesen --- drivers/media/i2c/adv748x/adv748x-dai.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/i2c/adv748x/adv748x-dai.c b/drivers/media/i2c/adv748x/adv748x-dai.c index 4775a0c7ed7f..ce3ae7de765c 100644 --- a/drivers/media/i2c/adv748x/adv748x-dai.c +++ b/drivers/media/i2c/adv748x/adv748x-dai.c @@ -204,6 +204,11 @@ int adv748x_dai_init(struct adv748x_dai *dai) int ret; struct adv748x_state *state = adv748x_dai_to_state(dai); + if (!state->endpoints[ADV748X_PORT_I2S]) { + adv_info(state, "no I2S port, DAI disabled\n"); + ret = 0; + goto fail; + } dai->mclk = clk_register_fixed_rate(state->dev, "adv748x-hdmi-i2s-mclk", NULL /* parent_name */,