From: Hans de Goede <hdegoede@redhat.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kate Hsuan <hpa@redhat.com>, Tsuchiya Yuto <kitakar@gmail.com>,
Fabio Aiuto <fabioaiuto83@gmail.com>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH 18/23] media: atomisp: Remove struct atomisp_platform_data
Date: Mon, 15 Apr 2024 14:02:15 +0200 [thread overview]
Message-ID: <20240415120220.219480-19-hdegoede@redhat.com> (raw)
In-Reply-To: <20240415120220.219480-1-hdegoede@redhat.com>
struct atomisp_platform_data only has a single subdevs member. Remove
this struct and replace atomisp_get_platform_data() with
atomisp_platform_get_subdevs().
Note atomisp_get_platform_data() and now atomisp_platform_get_subdevs()
always succeed, so while at it also remove unnecessary error checking.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
.../atomisp/include/linux/atomisp_platform.h | 6 +---
.../media/atomisp/pci/atomisp_gmin_platform.c | 36 +++++++++----------
.../media/atomisp/pci/atomisp_internal.h | 1 -
.../staging/media/atomisp/pci/atomisp_v4l2.c | 16 ++-------
4 files changed, 19 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h
index 098859bde86f..0e3f6fb78483 100644
--- a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h
+++ b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h
@@ -115,10 +115,6 @@ struct intel_v4l2_subdev_table {
struct v4l2_subdev *subdev;
};
-struct atomisp_platform_data {
- struct intel_v4l2_subdev_table *subdevs;
-};
-
/*
* Sensor of external ISP can send multiple steams with different mipi data
* type in the same virtual channel. This information needs to come from the
@@ -173,7 +169,7 @@ struct camera_mipi_info {
const u32 *metadata_effective_width;
};
-const struct atomisp_platform_data *atomisp_get_platform_data(void);
+const struct intel_v4l2_subdev_table *atomisp_platform_get_subdevs(void);
int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
enum atomisp_input_format format,
enum atomisp_bayer_order bayer_order);
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index e12354820a3a..e176483df301 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -127,17 +127,13 @@ static int gmin_v2p8_enable_count;
/* The atomisp uses subdev==NULL for the end-of-list marker, so leave space. */
static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1];
-static const struct atomisp_platform_data pdata = {
- .subdevs = pdata_subdevs,
-};
-
static struct gmin_subdev *find_gmin_subdev(struct v4l2_subdev *subdev);
-const struct atomisp_platform_data *atomisp_get_platform_data(void)
+const struct intel_v4l2_subdev_table *atomisp_platform_get_subdevs(void)
{
- return &pdata;
+ return pdata_subdevs;
}
-EXPORT_SYMBOL_GPL(atomisp_get_platform_data);
+EXPORT_SYMBOL_GPL(atomisp_platform_get_subdevs);
int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data)
@@ -164,7 +160,7 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
adev->power.flags.power_resources = 0;
for (i = 0; i < MAX_SUBDEVS; i++)
- if (!pdata.subdevs[i].subdev)
+ if (!pdata_subdevs[i].subdev)
break;
if (i == MAX_SUBDEVS)
@@ -179,9 +175,9 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
if (!gs)
return -ENODEV;
- pdata.subdevs[i].port = gs->csi_port;
- pdata.subdevs[i].lanes = gs->csi_lanes;
- pdata.subdevs[i].subdev = subdev;
+ pdata_subdevs[i].port = gs->csi_port;
+ pdata_subdevs[i].lanes = gs->csi_lanes;
+ pdata_subdevs[i].subdev = subdev;
return 0;
}
EXPORT_SYMBOL_GPL(atomisp_register_i2c_module);
@@ -194,9 +190,9 @@ int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd)
return 0;
for (i = 0; i < MAX_SUBDEVS; i++) {
- if (pdata.subdevs[i].subdev == sd) {
+ if (pdata_subdevs[i].subdev == sd) {
for (j = i + 1; j <= MAX_SUBDEVS; j++)
- pdata.subdevs[j - 1] = pdata.subdevs[j];
+ pdata_subdevs[j - 1] = pdata_subdevs[j];
}
if (gmin_subdevs[i].subdev == sd) {
if (gmin_subdevs[i].gpio0)
@@ -1125,7 +1121,7 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
}
for (i = 0; i < MAX_SUBDEVS; i++)
- if (!pdata.subdevs[i].subdev)
+ if (!pdata_subdevs[i].subdev)
break;
if (i >= MAX_SUBDEVS) {
@@ -1137,9 +1133,9 @@ int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
if (ret)
return ret;
- pdata.subdevs[i].port = port;
- pdata.subdevs[i].lanes = lanes;
- pdata.subdevs[i].subdev = subdev;
+ pdata_subdevs[i].port = port;
+ pdata_subdevs[i].lanes = lanes;
+ pdata_subdevs[i].subdev = subdev;
return 0;
}
EXPORT_SYMBOL_GPL(atomisp_register_sensor_no_gmin);
@@ -1149,12 +1145,12 @@ void atomisp_unregister_subdev(struct v4l2_subdev *subdev)
int i;
for (i = 0; i < MAX_SUBDEVS; i++) {
- if (pdata.subdevs[i].subdev != subdev)
+ if (pdata_subdevs[i].subdev != subdev)
continue;
camera_sensor_csi_free(subdev);
- pdata.subdevs[i].subdev = NULL;
- pdata.subdevs[i].port = 0;
+ pdata_subdevs[i].subdev = NULL;
+ pdata_subdevs[i].port = 0;
break;
}
}
diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h
index 9227399502b9..9c2bc5332fa4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h
@@ -175,7 +175,6 @@ struct atomisp_device {
struct media_device media_dev;
struct atomisp_sub_device asd;
struct v4l2_async_notifier notifier;
- struct atomisp_platform_data *pdata;
void *mmu_l1_base;
void __iomem *base;
const struct firmware *firmware;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 470c123256a7..4a87401a5389 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -783,27 +783,20 @@ int atomisp_csi_lane_config(struct atomisp_device *isp)
static int atomisp_subdev_probe(struct atomisp_device *isp)
{
- const struct atomisp_platform_data *pdata;
- struct intel_v4l2_subdev_table *subdevs;
+ const struct intel_v4l2_subdev_table *subdevs;
int ret, mipi_port;
ret = atomisp_csi2_bridge_parse_firmware(isp);
if (ret)
return ret;
- pdata = atomisp_get_platform_data();
- if (!pdata) {
- dev_err(isp->dev, "no platform data available\n");
- return 0;
- }
-
/*
* TODO: this is left here for now to allow testing atomisp-sensor
* drivers which are still using the atomisp_gmin_platform infra before
* converting them to standard v4l2 sensor drivers using runtime-pm +
* ACPI for pm and v4l2_async_register_subdev_sensor() registration.
*/
- for (subdevs = pdata->subdevs; subdevs->subdev; ++subdevs) {
+ for (subdevs = atomisp_platform_get_subdevs(); subdevs->subdev; ++subdevs) {
ret = v4l2_device_register_subdev(&isp->v4l2_dev, subdevs->subdev);
if (ret)
continue;
@@ -1186,7 +1179,6 @@ static void atomisp_pm_uninit(struct atomisp_device *isp)
static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
- const struct atomisp_platform_data *pdata;
struct atomisp_device *isp;
unsigned int start;
u32 val;
@@ -1195,10 +1187,6 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
/* Pointer to struct device. */
atomisp_dev = &pdev->dev;
- pdata = atomisp_get_platform_data();
- if (!pdata)
- dev_warn(&pdev->dev, "no platform data available\n");
-
start = pci_resource_start(pdev, ATOM_ISP_PCI_BAR);
dev_dbg(&pdev->dev, "start: 0x%x\n", start);
--
2.44.0
next prev parent reply other threads:[~2024-04-15 12:03 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 12:01 [PATCH 00/23] media: atomisp: Further media-controller related fixes + dead code removal Hans de Goede
2024-04-15 12:01 ` [PATCH 01/23] media: atomisp: Add atomisp_s_sensor_power() helper Hans de Goede
2024-04-15 12:01 ` [PATCH 02/23] media: atomisp: Turn on sensor power from atomisp_set_fmt() Hans de Goede
2024-04-15 12:02 ` [PATCH 03/23] media: atomisp: Add atomisp_select_input() helper Hans de Goede
2024-04-15 12:02 ` [PATCH 04/23] media: atomisp: Simplify atomisp_s_input() input argument checking Hans de Goede
2024-04-15 12:02 ` [PATCH 05/23] media: atomisp: Ensure CSI-receiver[x] -> ISP links correctly reflect current sensor Hans de Goede
2024-04-15 12:02 ` [PATCH 06/23] media: atomisp: Propagate set_fmt on sensor results to CSI port Hans de Goede
2024-04-15 12:02 ` [PATCH 07/23] media: atomisp: Propagate v4l2_mbus_framefmt.field to CSI port sink pad Hans de Goede
2024-04-15 12:02 ` [PATCH 08/23] media: atomisp: Call media_pipeline_alloc_start() in stream start Hans de Goede
2024-04-15 12:02 ` [PATCH 09/23] media: atomisp: Drop atomisp_pipe_check() from atomisp_link_setup() Hans de Goede
2024-04-15 12:02 ` [PATCH 10/23] media: atomisp: ov2722: Remove power on sensor from set_fmt() callback Hans de Goede
2024-04-15 12:02 ` [PATCH 11/23] media: atomisp: Remove test pattern generator (TPG) support Hans de Goede
2024-04-15 14:40 ` Andy Shevchenko
2024-04-16 9:25 ` Hans de Goede
2024-04-16 13:34 ` Andy Shevchenko
2024-04-16 14:37 ` Kieran Bingham
2024-04-16 14:40 ` Kieran Bingham
2024-04-16 14:50 ` Andy Shevchenko
2024-04-16 14:52 ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 12/23] media: atomisp: Remove input_port_ID_t Hans de Goede
2024-04-15 12:02 ` [PATCH 13/23] media: atomisp: Drop the atomisp custom lm3554 flash driver Hans de Goede
2024-04-15 14:49 ` Andy Shevchenko
2024-04-15 14:50 ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 14/23] media: atomisp: Drop custom flash support Hans de Goede
2024-04-15 14:53 ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 15/23] media: atomisp: Drop unused frame_status tracking Hans de Goede
2024-04-15 12:02 ` [PATCH 16/23] media: atomisp: Drop intel_v4l2_subdev_type Hans de Goede
2024-04-15 14:55 ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 17/23] media: atomisp: Remove gmin_platform VCM code Hans de Goede
2024-04-15 12:02 ` Hans de Goede [this message]
2024-04-15 12:02 ` [PATCH 19/23] media: atomisp: Remove clearing of ISP crop / compose rectangles on file release Hans de Goede
2024-04-15 12:02 ` [PATCH 20/23] media: atomisp: Remove empty s_power() op from ISP subdev Hans de Goede
2024-04-15 12:02 ` [PATCH 21/23] media: atomisp: Remove empty s_stream() op from CSI subdev Hans de Goede
2024-04-15 12:02 ` [PATCH 22/23] media: atomisp: Cleanup atomisp_isr_thread() spinlock handling Hans de Goede
2024-04-15 12:02 ` [PATCH 23/23] media: atomisp: Remove setting of f->fmt.pix.priv from atomisp_set_fmt() Hans de Goede
2024-04-15 14:58 ` [PATCH 00/23] media: atomisp: Further media-controller related fixes + dead code removal Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240415120220.219480-19-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andy@kernel.org \
--cc=fabioaiuto83@gmail.com \
--cc=hpa@redhat.com \
--cc=kitakar@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox