From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 6CC40C5DF62 for ; Wed, 6 Nov 2019 09:08:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 432CF2178F for ; Wed, 6 Nov 2019 09:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731482AbfKFJIu (ORCPT ); Wed, 6 Nov 2019 04:08:50 -0500 Received: from retiisi.org.uk ([95.216.213.190]:56050 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbfKFJIt (ORCPT ); Wed, 6 Nov 2019 04:08:49 -0500 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 7A2CF634C87; Wed, 6 Nov 2019 11:07:33 +0200 (EET) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1iSHHo-0002Vb-HM; Wed, 06 Nov 2019 11:07:32 +0200 Date: Wed, 6 Nov 2019 11:07:32 +0200 From: Sakari Ailus To: Benoit Parrot Cc: Hans Verkuil , linux-media@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch v2 14/20] media: ti-vpe: cal: Add AM654 support Message-ID: <20191106090732.GC6253@valkosipuli.retiisi.org.uk> References: <20191104193140.31145-1-bparrot@ti.com> <20191104193140.31145-15-bparrot@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104193140.31145-15-bparrot@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benoit, On Mon, Nov 04, 2019 at 01:31:34PM -0600, Benoit Parrot wrote: > Add the needed control module register bit layout to support the AM654 > family of devices. > > Signed-off-by: Benoit Parrot > --- > drivers/media/platform/Kconfig | 2 +- > drivers/media/platform/ti-vpe/cal.c | 28 +++++++++++++++++++++++++++- > 2 files changed, 28 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index e84f35d3a68e..995f4c67f764 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -151,7 +151,7 @@ source "drivers/media/platform/sunxi/Kconfig" > config VIDEO_TI_CAL > tristate "TI CAL (Camera Adaptation Layer) driver" > depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API > - depends on SOC_DRA7XX || COMPILE_TEST > + depends on SOC_DRA7XX || ARCH_K3 || COMPILE_TEST > select VIDEOBUF2_DMA_CONTIG > select V4L2_FWNODE > help > diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c > index 72ed2348389d..45653e9ed6cd 100644 > --- a/drivers/media/platform/ti-vpe/cal.c > +++ b/drivers/media/platform/ti-vpe/cal.c > @@ -322,6 +322,26 @@ static struct cal_data dra76x_cal_data = { > .flags = 0, > }; > > +static struct reg_field am654_ctrl_core_csi0_reg_fields[F_MAX_FIELDS] = { > + [F_CTRLCLKEN] = REG_FIELD(0, 15, 15), > + [F_CAMMODE] = REG_FIELD(0, 24, 25), > + [F_LANEENABLE] = REG_FIELD(0, 0, 4), > +}; > + > +static struct cal_csi2_phy am654_cal_csi_phy[] = { > + { > + .base_fields = am654_ctrl_core_csi0_reg_fields, > + .num_lanes = 5, > + }, > +}; > + > +static struct cal_data am654_cal_data = { > + .csi2_phy_core = am654_cal_csi_phy, > + .num_csi2_phy = ARRAY_SIZE(am654_cal_csi_phy), > + > + .flags = 0, Same comments as on 12th patch. Could all these structs be const? > +}; > + > /* > * there is one cal_dev structure in the driver, it is shared by > * all instances. > @@ -548,7 +568,9 @@ static void camerarx_phy_enable(struct cal_ctx *ctx) > /* Always enable all lanes at the phy control level */ > max_lanes = (1 << cal_data_get_phy_max_lanes(ctx)) - 1; > regmap_field_write(phy->fields[F_LANEENABLE], max_lanes); > - regmap_field_write(phy->fields[F_CSI_MODE], 1); > + /* F_CSI_MODE is not present on every architecture */ > + if (phy->fields[F_CSI_MODE]) > + regmap_field_write(phy->fields[F_CSI_MODE], 1); > regmap_field_write(phy->fields[F_CTRLCLKEN], 1); > } > -- Regards, Sakari Ailus