Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1478637rdh; Mon, 25 Sep 2023 14:13:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2Zdxrr4cPgOzz3xyNdu0urpp2mSg/dt0CdixKnE5R/wD5q8oBqTfXwHbwHA+U/cu6Zh2K X-Received: by 2002:a17:90a:1197:b0:268:18e:9dfa with SMTP id e23-20020a17090a119700b00268018e9dfamr7260094pja.5.1695676388734; Mon, 25 Sep 2023 14:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695676388; cv=none; d=google.com; s=arc-20160816; b=Asha+Qa24zUTQbCsMInq96+HtT7VX/Qr/W8vLQHtRy4bL3pG+JOOq2Ta+Qd0hjnURv /dTwn61i806rIzIh+NrP0RW4o5YFz9epX22SanwBolnM3FyZHWqhujrof4Lf3AebjIzd WboN6etIF4UGoTNeQjX8gJbb031qdmCTK3jZ7I1oul9VOIZaSEmFh3yjo6cqswstbons AJTAWl9czM9S/zuR6EwvR3AN9RCLfWaAfIsDG8HFl1mY6OPyiCO3xDkeqzAWWjhBRA1B dkmul3z+ZpXjhHEokOkHsZZWNI3Ow+sGUYPuK3ifWvnVDAElGlVDqfYl3nLzgspEoIvi 7LRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bEExl+Qnlpbjs/kQF5vqHTfDAzymWTPDJmQL5fGoUhU=; fh=YrDxnoZE2zu1w4A5O/pMyb6W2NB5EAkKDOR3m7KPwy0=; b=ASGMKmYB9ETdtYakTV6iUpqKkz7i4X4ppjYXMayW27BGbW12dTbz7KokP2R6CAg1fr ZnbxW5e7/oadUjswW+eUYweRBXIogKLgbdi3VqIuuIJUns677r2bxzBSrKM6OJfnFxeQ ClQu50B0/6dpwgwmQp84WBwj3I8g2mp5j4jvJgBnWv2pHXLCV5XYjKsbW5hpzmOUkjCO BbxN548hPhijrlVGwQIE/OHGs/rD6rXBYUQcG94rZuawT/LvvSpNqGlndzFBGPgCqVJ4 Z7B/aslnztStjIcAPDhVY2nMgY+XOIfgoqkM5+iKg8MRc4tTXzmB2lElNJBdQb2HDzgS vnGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OzH9sbAj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id np18-20020a17090b4c5200b0027744a9de69si5105760pjb.126.2023.09.25.14.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OzH9sbAj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DD52A80F4E29; Mon, 25 Sep 2023 08:47:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231577AbjIYPrV (ORCPT + 99 others); Mon, 25 Sep 2023 11:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbjIYPrU (ORCPT ); Mon, 25 Sep 2023 11:47:20 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DB85BC for ; Mon, 25 Sep 2023 08:47:13 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3231d67aff2so3150672f8f.0 for ; Mon, 25 Sep 2023 08:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695656831; x=1696261631; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bEExl+Qnlpbjs/kQF5vqHTfDAzymWTPDJmQL5fGoUhU=; b=OzH9sbAjwvrspYURlHGUKNZaWXaiCuT5Ii4eTET7chaJpi+kMMH0zdqZ9VS8fOA3pX 4nVJ/Hd6DcXIAMeyhalf58ng3Uxxn5O+1KabMIyjP7lE7jvIamKLHTlN9FyBWg6a5CFM L1whhC1vY/khfYIdjH61pSQZmMdWHnCBA7spCi6W7pB58gOZql93NRoUxJ7JTVtpbqCh VBM2uggVN6oqb2LSVNm875G6axQO4k6zi5u0NV6n+CMBewUVzevulJw/c1THZmQr7rGg lL8W5EnugbdCjKLetBQUvPUMPJy/QbAYr3F04Zlv6RsW5XpDXWSz8nbjD3ASoBwcx7ME mgmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695656831; x=1696261631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bEExl+Qnlpbjs/kQF5vqHTfDAzymWTPDJmQL5fGoUhU=; b=AbyaVtCMyQrMZdQOK4gawdnZCBghgYpYcirwR4iGfG2YdWHjiQLTo0wDtbh80UX3hF G25o8NKiyxa8qPmJXN/9uBYUWUHkF1oR3ODHIWpta7AZjWOWDkvHnOmzgb6R6ny+WzAm yWf98EwZx8FC2iZ5RdDm2tqlGEHgboUoRf0YRvmV0AzVL3xX1oX1DtSg+JZTs3IxQmiV 9MkkvXB0JhyQAXlsXqLHtm/WPZAu9CNRLEmtMM1QJRTglfLv5jj+E2Smnm4cgP++/jhX KzqydcP77zRA3TG6EjfNFdbExkIygf+pxWReR8BvRPo8/J4mepfIeXU7jUOoCTkYFW8G sLIw== X-Gm-Message-State: AOJu0YwrUkNQ7OfeVip5X7RLAlDP+R9g/AXtnBOUzZuODgBI8AOAh4K1 APZaAeDzwaamPd6+ckwkMPcu0A== X-Received: by 2002:adf:fb51:0:b0:31f:e980:cd88 with SMTP id c17-20020adffb51000000b0031fe980cd88mr5610836wrs.61.1695656831560; Mon, 25 Sep 2023 08:47:11 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id d4-20020adffd84000000b0031f34a395e7sm12077536wrr.45.2023.09.25.08.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 08:47:11 -0700 (PDT) From: Bryan O'Donoghue To: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, rfoss@kernel.org, todor.too@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, sakari.ailus@linux.intel.com, andrey.konovalov@linaro.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue Subject: [RESEND PATCH v6 01/17] media: qcom: camss: Amalgamate struct resource with struct resource_ispif Date: Mon, 25 Sep 2023 16:46:51 +0100 Message-ID: <20230925154707.837542-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230925154707.837542-1-bryan.odonoghue@linaro.org> References: <20230925154707.837542-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:47:22 -0700 (PDT) There is no good reason to differentiate the two resource structures here. As part of a general tidyup of the declaration and passing of resources within in the CAMSS driver it will be advantageous to have one unified resource structure. The two structures are very similar anyway thus leading more credence still to the argument there should be only one. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart --- drivers/media/platform/qcom/camss/camss-ispif.c | 4 ++-- drivers/media/platform/qcom/camss/camss-ispif.h | 4 ++-- drivers/media/platform/qcom/camss/camss.c | 14 +++++++------- drivers/media/platform/qcom/camss/camss.h | 8 +------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c index 1c7e4b1b49401..61765b874b9a2 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -1095,7 +1095,7 @@ static int ispif_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) * Return 0 on success or a negative error code otherwise */ int msm_ispif_subdev_init(struct camss *camss, - const struct resources_ispif *res) + const struct resources *res) { struct device *dev = camss->dev; struct ispif_device *ispif = camss->ispif; @@ -1152,7 +1152,7 @@ int msm_ispif_subdev_init(struct camss *camss, /* Interrupt */ - ret = platform_get_irq_byname(pdev, res->interrupt); + ret = platform_get_irq_byname(pdev, res->interrupt[0]); if (ret < 0) return ret; diff --git a/drivers/media/platform/qcom/camss/camss-ispif.h b/drivers/media/platform/qcom/camss/camss-ispif.h index fdf28e68cc7d8..c7c41f7afcaad 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.h +++ b/drivers/media/platform/qcom/camss/camss-ispif.h @@ -66,10 +66,10 @@ struct ispif_device { struct camss *camss; }; -struct resources_ispif; +struct resources; int msm_ispif_subdev_init(struct camss *camss, - const struct resources_ispif *res); + const struct resources *res); int msm_ispif_register_entities(struct ispif_device *ispif, struct v4l2_device *v4l2_dev); diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index c6df862c79e39..fa0eb30d77c26 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -93,14 +93,14 @@ static const struct resources csid_res_8x16[] = { }, }; -static const struct resources_ispif ispif_res_8x16 = { +static const struct resources ispif_res_8x16 = { /* ISPIF */ .clock = { "top_ahb", "ahb", "ispif_ahb", "csi0", "csi0_pix", "csi0_rdi", "csi1", "csi1_pix", "csi1_rdi" }, .clock_for_reset = { "vfe0", "csi_vfe0" }, .reg = { "ispif", "csi_clk_mux" }, - .interrupt = "ispif" + .interrupt = { "ispif" } }; @@ -234,7 +234,7 @@ static const struct resources csid_res_8x96[] = { } }; -static const struct resources_ispif ispif_res_8x96 = { +static const struct resources ispif_res_8x96 = { /* ISPIF */ .clock = { "top_ahb", "ahb", "ispif_ahb", "csi0", "csi0_pix", "csi0_rdi", @@ -243,7 +243,7 @@ static const struct resources_ispif ispif_res_8x96 = { "csi3", "csi3_pix", "csi3_rdi" }, .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" }, .reg = { "ispif", "csi_clk_mux" }, - .interrupt = "ispif" + .interrupt = { "ispif" } }; static const struct resources vfe_res_8x96[] = { @@ -410,7 +410,7 @@ static const struct resources csid_res_660[] = { } }; -static const struct resources_ispif ispif_res_660 = { +static const struct resources ispif_res_660 = { /* ISPIF */ .clock = { "top_ahb", "ahb", "ispif_ahb", "csi0", "csi0_pix", "csi0_rdi", @@ -419,7 +419,7 @@ static const struct resources_ispif ispif_res_660 = { "csi3", "csi3_pix", "csi3_rdi" }, .clock_for_reset = { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" }, .reg = { "ispif", "csi_clk_mux" }, - .interrupt = "ispif" + .interrupt = { "ispif" } }; static const struct resources vfe_res_660[] = { @@ -1122,7 +1122,7 @@ static int camss_init_subdevices(struct camss *camss) { const struct resources *csiphy_res; const struct resources *csid_res; - const struct resources_ispif *ispif_res; + const struct resources *ispif_res; const struct resources *vfe_res; unsigned int i; int ret; diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index f6c326cb853b8..e95211cdb1fd6 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -44,18 +44,12 @@ struct resources { char *regulators[CAMSS_RES_MAX]; char *clock[CAMSS_RES_MAX]; + char *clock_for_reset[CAMSS_RES_MAX]; u32 clock_rate[CAMSS_RES_MAX][CAMSS_RES_MAX]; char *reg[CAMSS_RES_MAX]; char *interrupt[CAMSS_RES_MAX]; }; -struct resources_ispif { - char *clock[CAMSS_RES_MAX]; - char *clock_for_reset[CAMSS_RES_MAX]; - char *reg[CAMSS_RES_MAX]; - char *interrupt; -}; - struct icc_bw_tbl { u32 avg; u32 peak; -- 2.42.0