summaryrefslogtreecommitdiff
path: root/drivers/media/pci/intel/ipu-bridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/pci/intel/ipu-bridge.c')
-rw-r--r--drivers/media/pci/intel/ipu-bridge.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index a0e9a71580b5..c9827e9fe6ff 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -2,6 +2,7 @@
/* Author: Dan Scally <djrscally@gmail.com> */
#include <linux/acpi.h>
+#include <acpi/acpi_bus.h>
#include <linux/cleanup.h>
#include <linux/device.h>
#include <linux/i2c.h>
@@ -54,17 +55,23 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
/* Himax HM2172 */
IPU_SENSOR_CONFIG("HIMX2172", 1, 384000000),
/* GalaxyCore GC0310 */
- IPU_SENSOR_CONFIG("INT0310", 0),
+ IPU_SENSOR_CONFIG("INT0310", 1, 55692000),
/* Omnivision OV5693 */
IPU_SENSOR_CONFIG("INT33BE", 1, 419200000),
+ /* Onsemi MT9M114 */
+ IPU_SENSOR_CONFIG("INT33F0", 1, 384000000),
/* Omnivision OV2740 */
IPU_SENSOR_CONFIG("INT3474", 1, 180000000),
+ /* Omnivision OV5670 */
+ IPU_SENSOR_CONFIG("INT3479", 1, 422400000),
/* Omnivision OV8865 */
IPU_SENSOR_CONFIG("INT347A", 1, 360000000),
/* Omnivision OV7251 */
IPU_SENSOR_CONFIG("INT347E", 1, 319200000),
/* Hynix Hi-556 */
IPU_SENSOR_CONFIG("INT3537", 1, 437000000),
+ /* Lontium lt6911uxe */
+ IPU_SENSOR_CONFIG("INTC10C5", 0),
/* Omnivision OV01A10 / OV01A1S */
IPU_SENSOR_CONFIG("OVTI01A0", 1, 400000000),
IPU_SENSOR_CONFIG("OVTI01AS", 1, 400000000),
@@ -72,10 +79,12 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
IPU_SENSOR_CONFIG("OVTI02C1", 1, 400000000),
/* Omnivision OV02E10 */
IPU_SENSOR_CONFIG("OVTI02E1", 1, 360000000),
+ /* Omnivision ov05c10 */
+ IPU_SENSOR_CONFIG("OVTI05C1", 1, 480000000),
/* Omnivision OV08A10 */
IPU_SENSOR_CONFIG("OVTI08A1", 1, 500000000),
/* Omnivision OV08x40 */
- IPU_SENSOR_CONFIG("OVTI08F4", 1, 400000000),
+ IPU_SENSOR_CONFIG("OVTI08F4", 3, 400000000, 749000000, 800000000),
/* Omnivision OV13B10 */
IPU_SENSOR_CONFIG("OVTI13B1", 1, 560000000),
IPU_SENSOR_CONFIG("OVTIDB10", 1, 560000000),
@@ -83,6 +92,10 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
IPU_SENSOR_CONFIG("OVTI2680", 1, 331200000),
/* Omnivision OV8856 */
IPU_SENSOR_CONFIG("OVTI8856", 3, 180000000, 360000000, 720000000),
+ /* Sony IMX471 */
+ IPU_SENSOR_CONFIG("SONY471A", 1, 200000000),
+ /* Toshiba T4KA3 */
+ IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
};
static const struct ipu_property_names prop_names = {
@@ -107,7 +120,6 @@ static const char * const ipu_vcm_types[] = {
"lc898212axb",
};
-#if IS_ENABLED(CONFIG_ACPI)
/*
* Used to figure out IVSC acpi device by ipu_bridge_get_ivsc_acpi_dev()
* instead of device and driver match to probe IVSC device.
@@ -127,11 +139,11 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
const struct acpi_device_id *acpi_id = &ivsc_acpi_ids[i];
struct acpi_device *consumer, *ivsc_adev;
- acpi_handle handle = acpi_device_handle(adev);
+ acpi_handle handle = acpi_device_handle(ACPI_PTR(adev));
for_each_acpi_dev_match(ivsc_adev, acpi_id->id, NULL, -1)
/* camera sensor depends on IVSC in DSDT if exist */
for_each_acpi_consumer_dev(ivsc_adev, consumer)
- if (consumer->handle == handle) {
+ if (ACPI_PTR(consumer->handle) == handle) {
acpi_dev_put(consumer);
return ivsc_adev;
}
@@ -139,12 +151,6 @@ static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev
return NULL;
}
-#else
-static struct acpi_device *ipu_bridge_get_ivsc_acpi_dev(struct acpi_device *adev)
-{
- return NULL;
-}
-#endif
static int ipu_bridge_match_ivsc_dev(struct device *dev, const void *adev)
{
@@ -259,12 +265,8 @@ static enum v4l2_fwnode_orientation ipu_bridge_parse_orientation(struct acpi_dev
{
enum v4l2_fwnode_orientation orientation;
struct acpi_pld_info *pld = NULL;
- acpi_status status = AE_ERROR;
-#if IS_ENABLED(CONFIG_ACPI)
- status = acpi_get_physical_device_location(adev->handle, &pld);
-#endif
- if (ACPI_FAILURE(status)) {
+ if (!acpi_get_physical_device_location(ACPI_PTR(adev->handle), &pld)) {
dev_warn(ADEV_DEV(adev), "_PLD call failed, using default orientation\n");
return V4L2_FWNODE_ORIENTATION_EXTERNAL;
}
@@ -323,7 +325,7 @@ int ipu_bridge_parse_ssdb(struct acpi_device *adev, struct ipu_sensor *sensor)
return 0;
}
-EXPORT_SYMBOL_NS_GPL(ipu_bridge_parse_ssdb, INTEL_IPU_BRIDGE);
+EXPORT_SYMBOL_NS_GPL(ipu_bridge_parse_ssdb, "INTEL_IPU_BRIDGE");
static void ipu_bridge_create_fwnode_properties(
struct ipu_sensor *sensor,
@@ -498,9 +500,7 @@ static void ipu_bridge_create_connection_swnodes(struct ipu_bridge *bridge,
if (sensor->csi_dev) {
const char *device_hid = "";
-#if IS_ENABLED(CONFIG_ACPI)
device_hid = acpi_device_hid(sensor->ivsc_adev);
-#endif
snprintf(sensor->ivsc_name, sizeof(sensor->ivsc_name), "%s-%u",
device_hid, sensor->link);
@@ -567,8 +567,8 @@ static void ipu_bridge_instantiate_vcm_work(struct work_struct *work)
vcm_client = i2c_acpi_new_device_by_fwnode(acpi_fwnode_handle(adev),
1, &data->board_info);
if (IS_ERR(vcm_client)) {
- dev_err(data->sensor, "Error instantiating VCM client: %ld\n",
- PTR_ERR(vcm_client));
+ dev_err(data->sensor, "Error instantiating VCM client: %pe\n",
+ vcm_client);
goto out_pm_put;
}
@@ -631,7 +631,7 @@ int ipu_bridge_instantiate_vcm(struct device *sensor)
return 0;
}
-EXPORT_SYMBOL_NS_GPL(ipu_bridge_instantiate_vcm, INTEL_IPU_BRIDGE);
+EXPORT_SYMBOL_NS_GPL(ipu_bridge_instantiate_vcm, "INTEL_IPU_BRIDGE");
static int ipu_bridge_instantiate_ivsc(struct ipu_sensor *sensor)
{
@@ -671,11 +671,7 @@ static int ipu_bridge_connect_sensor(const struct ipu_sensor_config *cfg,
struct acpi_device *adev = NULL;
int ret;
-#if IS_ENABLED(CONFIG_ACPI)
for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) {
-#else
- while (true) {
-#endif
if (!ACPI_PTR(adev->status.enabled))
continue;
@@ -768,15 +764,10 @@ static int ipu_bridge_ivsc_is_ready(void)
unsigned int i;
for (i = 0; i < ARRAY_SIZE(ipu_supported_sensors); i++) {
-#if IS_ENABLED(CONFIG_ACPI)
const struct ipu_sensor_config *cfg =
&ipu_supported_sensors[i];
for_each_acpi_dev_match(sensor_adev, cfg->hid, NULL, -1) {
-#else
- while (true) {
- sensor_adev = NULL;
-#endif
if (!ACPI_PTR(sensor_adev->status.enabled))
continue;
@@ -828,7 +819,8 @@ int ipu_bridge_init(struct device *dev,
return 0;
if (!ipu_bridge_ivsc_is_ready())
- return -EPROBE_DEFER;
+ return dev_err_probe(dev, -EPROBE_DEFER,
+ "waiting for IVSC to become ready\n");
bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
if (!bridge)
@@ -882,7 +874,7 @@ err_free_bridge:
return ret;
}
-EXPORT_SYMBOL_NS_GPL(ipu_bridge_init, INTEL_IPU_BRIDGE);
+EXPORT_SYMBOL_NS_GPL(ipu_bridge_init, "INTEL_IPU_BRIDGE");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Intel IPU Sensors Bridge driver");