Skip to content

Commit 69d126d

Browse files
authored
for isx031 + max9296
2 parents ed52819 + 379bab5 commit 69d126d

6 files changed

Lines changed: 44 additions & 29 deletions

File tree

drivers/media/i2c/max9x/max9296.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,11 @@ static int max9296_freeze(struct device *dev)
892892
return max9296_suspend(dev);
893893
}
894894

895+
static int max9296_thaw(struct device *dev)
896+
{
897+
return max9296_resume(dev);
898+
}
899+
895900
static int max9296_restore(struct device *dev)
896901
{
897902
return max9296_resume(dev);
@@ -941,6 +946,7 @@ static const struct dev_pm_ops max9296_pm_ops = {
941946
.resume = max9296_resume,
942947
.freeze = max9296_freeze,
943948
.restore = max9296_restore,
949+
.thaw = max9296_thaw,
944950
};
945951

946952
static struct i2c_device_id max9296_idtable[] = {

drivers/media/platform/intel/ipu6-acpi-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (c) 2016--2024 Intel Corporation.
3+
* Copyright (c) 2016-2024 Intel Corporation.
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License version

drivers/media/platform/intel/ipu6-acpi-pdata.c

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (c) 2016--2025 Intel Corporation.
3+
* Copyright (c) 2016-2025 Intel Corporation.
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License version
@@ -109,6 +109,10 @@ static void print_serdes_subdev(struct ipu_isys_subdev_info *sd)
109109
pr_debug("\t\tFPD_gpio \t\t= %d", sd_pdata->FPD_gpio);
110110
pr_debug("\t\tsuffix \t\t\t= %c", sd_pdata->suffix);
111111

112+
pr_debug("\t\tlink_freq_mbps \t\t= %d", sd_pdata->link_freq_mbps);
113+
pr_debug("\t\tdeser_nlanes \t\t= %d", sd_pdata->deser_nlanes);
114+
pr_debug("\t\tser_nlanes \t\t= %d", sd_pdata->ser_nlanes);
115+
112116
for (i = 0; i < serdes_info.rx_port; i++) {
113117
sd_sdinfo = &sd_pdata->subdev_info[i];
114118
sd_mpdata = sd_sdinfo->board_info.platform_data;
@@ -592,7 +596,8 @@ static int set_pdata(struct ipu_isys_subdev_info **sensor_sd,
592596
unsigned int subdev_num,
593597
unsigned int deser_lanes,
594598
bool is_dummy,
595-
enum connection_type connect)
599+
enum connection_type connect,
600+
u32 link_freq)
596601
{
597602
if (connect == TYPE_DIRECT) {
598603
struct sensor_platform_data *pdata;
@@ -636,11 +641,7 @@ static int set_pdata(struct ipu_isys_subdev_info **sensor_sd,
636641
} else
637642
pr_err("IPU6 ACPI: Invalid MIPI Port : %d", port);
638643

639-
#if IS_ENABLED(CONFIG_VIDEO_ISX031)
640-
if (!strcmp(sensor_name, ISX031_NAME))
641-
pdata->link_freq_mbps = 1600;
642-
#endif
643-
644+
pdata->link_freq_mbps = link_freq;
644645
pdata->deser_nlanes = deser_lanes;
645646
pdata->ser_nlanes = lanes;
646647
set_serdes_subdev(sensor_sd, dev, &pdata, sensor_name, hid_name, lanes, addr, subdev_num);
@@ -654,7 +655,8 @@ static int set_pdata(struct ipu_isys_subdev_info **sensor_sd,
654655

655656
static void set_serdes_info(struct device *dev, const char *sensor_name,
656657
const char *serdes_name,
657-
struct sensor_bios_data *cam_data)
658+
struct sensor_bios_data *cam_data,
659+
int sensor_physical_addr)
658660
{
659661
int i;
660662

@@ -673,13 +675,7 @@ static void set_serdes_info(struct device *dev, const char *sensor_name,
673675

674676
serdes_info.gpio_powerup_seq = 0;
675677

676-
serdes_info.phy_i2c_addr = 0;
677-
678-
#if IS_ENABLED(CONFIG_VIDEO_ISX031)
679-
if (!strcmp(sensor_name, ISX031_NAME))
680-
serdes_info.phy_i2c_addr = ISX031_I2C_ADDRESS;
681-
#endif
682-
678+
serdes_info.phy_i2c_addr = sensor_physical_addr;
683679
}
684680

685681
static int populate_sensor_pdata(struct device *dev,
@@ -689,7 +685,9 @@ static int populate_sensor_pdata(struct device *dev,
689685
enum connection_type connect,
690686
const char *sensor_name,
691687
const char *serdes_name,
692-
const char *hid_name)
688+
const char *hid_name,
689+
int sensor_physical_addr,
690+
int link_freq)
693691
{
694692
int ret;
695693

@@ -741,14 +739,13 @@ static int populate_sensor_pdata(struct device *dev,
741739
}
742740

743741
/* local serdes info */
744-
set_serdes_info(dev, sensor_name, serdes_name, cam_data);
742+
set_serdes_info(dev, sensor_name, serdes_name, cam_data, sensor_physical_addr);
745743
}
746744

747745
/* Use last I2C device */
748746
ret = set_pdata(sensor_sd, dev, sensor_name, hid_name, ctl_data, cam_data->link,
749747
cam_data->lanes, cam_data->i2c[cam_data->i2c_num - 1].addr,
750-
cam_data->pprunit, cam_data->pprval, false, connect);
751-
748+
cam_data->pprunit, cam_data->pprval, false, connect, link_freq);
752749
if (ret)
753750
return ret;
754751

@@ -763,7 +760,8 @@ int get_sensor_pdata(struct device *dev,
763760
struct ipu_camera_module_data *data,
764761
void *priv, size_t size,
765762
enum connection_type connect, const char *sensor_name,
766-
const char *serdes_name, const char *hid_name)
763+
const char *serdes_name, const char *hid_name,
764+
int sensor_physical_addr, int link_freq)
767765
{
768766
struct sensor_bios_data *cam_data;
769767
struct control_logic_data *ctl_data;
@@ -811,7 +809,8 @@ int get_sensor_pdata(struct device *dev,
811809

812810
/* populate pdata */
813811
rval = populate_sensor_pdata(dev, &sensor_sd, cam_data, ctl_data,
814-
connect, sensor_name, serdes_name, hid_name);
812+
connect, sensor_name, serdes_name, hid_name,
813+
sensor_physical_addr, link_freq);
815814
if (rval) {
816815
kfree(sensor_sd);
817816
kfree(cam_data);

drivers/media/platform/intel/ipu6-acpi.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (c) 2016--2025 Intel Corporation.
3+
* Copyright (c) 2016-2025 Intel Corporation.
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License version
@@ -66,11 +66,13 @@ static struct ipu_camera_module_data *add_device_to_list(
6666

6767
static const struct ipu_acpi_devices supported_devices[] = {
6868
/*
69-
* { "ACPI ID", sensor_name, get_sensor_pdata, NULL, 0, TYPE, serdes_name }, // Custom HID
69+
* { "ACPI ID", sensor_name, get_sensor_pdata, NULL, 0, TYPE, serdes_name,
70+
* sensor_physical_addr, link_freq(mbps) }, // Custom HID
7071
*/
7172
#if IS_ENABLED(CONFIG_VIDEO_MAX9X)
7273
#if IS_ENABLED(CONFIG_VIDEO_ISX031)
73-
{ "INTC031M", ISX031_NAME, get_sensor_pdata, NULL, 0, TYPE_SERDES, "max9296" },// D3 ISX031 HID
74+
{ "INTC031M", ISX031_NAME, get_sensor_pdata, NULL, 0, TYPE_SERDES, "max9296",
75+
ISX031_I2C_ADDRESS, 1600 }, // D3 ISX031 HID
7476
#endif
7577
#endif
7678
};
@@ -124,7 +126,9 @@ static int ipu_acpi_get_pdata(struct device *dev, int index)
124126
supported_devices[index].connect,
125127
supported_devices[index].real_driver,
126128
supported_devices[index].serdes_name,
127-
supported_devices[index].hid_name);
129+
supported_devices[index].hid_name,
130+
supported_devices[index].sensor_physical_addr,
131+
supported_devices[index].link_freq);
128132

129133
if (rval)
130134
return -EPROBE_DEFER;

include/media/ipu-acpi-pdata.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ int get_sensor_pdata(struct device *dev,
2020
enum connection_type connect,
2121
const char *sensor_name,
2222
const char *serdes_name,
23-
const char *hid_name);
23+
const char *hid_name,
24+
int sensor_physical_addr,
25+
int link_freq);
2426

2527
struct ipu_isys_subdev_pdata *get_acpi_subdev_pdata(void);
2628

include/media/ipu-acpi.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/*
3-
* Copyright (c) 2016--2022 Intel Corporation.
3+
* Copyright (c) 2016-2025 Intel Corporation.
44
*
55
* This program is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU General Public License version
@@ -212,11 +212,15 @@ struct ipu_acpi_devices {
212212
enum connection_type type,
213213
const char *sensor_name,
214214
const char *serdes_name,
215-
const char *hid_name);
215+
const char *hid_name,
216+
int sensor_physical_addr,
217+
int link_freq);
216218
void *priv_data;
217219
size_t priv_size;
218220
enum connection_type connect;
219221
const char *serdes_name;
222+
int sensor_physical_addr;
223+
int link_freq; /* in mbps */
220224
};
221225

222226
#endif

0 commit comments

Comments
 (0)