From patchwork Tue Oct 15 21:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 13837117 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B72961F80BC; Tue, 15 Oct 2024 21:20:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027222; cv=none; b=Htnd4srYVvZnDtVEtSluzkJTuRSg8LG2eIRb+pPUzFtM8ZElIX7nZCyb8a36W5yJZmcA0lKyONFLNqjyPx3wSouLck6DLuIz6rw1oAXm7btu4SCts7N/jMkPKOyNDo3KAqPxvdThiHFFY8yPU1TYnTppb8pGz6iy52fctGxt2RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027222; c=relaxed/simple; bh=VFWar1AVdl1MMxxxmu6s0gKcT0q68DyKEIw9U0yHbHc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=crMnZoO4HA91hDsTJq2ioNQggPBU9erHxVXbkctnzxMdYFrQDHe6bnG6BXSEMFtANFJFwerFpUe3OTyFItYaqikdxLKe77vPQ/Ek1J6kwHIUvEyJMxk7nBiGkyyRH/u/YmHlg3WH0O0zE806pzBeTv98TL69cJUxjIfEO2g0Kt8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=TNhW2w4Z; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="TNhW2w4Z" Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4BC7EA27; Tue, 15 Oct 2024 23:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1729027113; bh=VFWar1AVdl1MMxxxmu6s0gKcT0q68DyKEIw9U0yHbHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TNhW2w4ZiB9pdmWdk1Phn6de50s4jpd3rKLyWAUp6LjGqLQif+BVz/02lpUqGMOjQ hhZf2dH1Js7i+tWSnRGS7blPOipZ17LC/rfV+pJSQSoaiAEFZYK3+iz+y2nl0OU6E9 +2vxIxY+/cMq4SVR+wV7Eng8Zh2PUbpX89EnPu1U= From: Daniel Scally To: linux-media@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: anders.ruke@gmail.com, sakari.ailus@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hverkuil-cisco@xs4all.nl, Daniel Scally Subject: [PATCH 1/3] media: i2c: Defer ov5670_probe() if endpoint not found Date: Tue, 15 Oct 2024 22:19:56 +0100 Message-Id: <20241015211958.1465909-2-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015211958.1465909-1-dan.scally@ideasonboard.com> References: <20241015211958.1465909-1-dan.scally@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The OV5670 is found on a Dell 7212, coupled to Intel's CIO2 CSI-2 receiver. The ACPI tables don't describe the connection properly and so this is one of the sensors that needs to wait for the ipu-bridge to set up the graph with software nodes. Defer probe if an endpoint isn't found to allow time for that. Signed-off-by: Daniel Scally --- drivers/media/i2c/ov5670.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 2aee85965cf7..c02d42998fcb 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2688,10 +2688,15 @@ static int ov5670_probe(struct i2c_client *client) if (ret) return dev_err_probe(&client->dev, ret, "GPIO probe failed\n"); - /* Graph Endpoint */ + /* + * Graph Endpoint. If it's missing we defer rather than fail, as this + * sensor is known to co-exist on systems with the IPU3 and so it might + * be created by the ipu-bridge. + */ handle = fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), NULL); if (!handle) - return dev_err_probe(&client->dev, -ENXIO, "Endpoint for node get failed\n"); + return dev_err_probe(&client->dev, -EPROBE_DEFER, + "Endpoint for node get failed\n"); ov5670->endpoint.bus_type = V4L2_MBUS_CSI2_DPHY; ov5670->endpoint.bus.mipi_csi2.num_data_lanes = 2; From patchwork Tue Oct 15 21:19:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 13837118 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 322221FBF67; Tue, 15 Oct 2024 21:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027224; cv=none; b=BikASwuwrcCBHc/o8W3tMgmRUTti9KQK/Z2cA2Szj5EXQC5imCknSsofbtDOBdQBMz168pMS7tB8qTgHizP8SNf8W0G8TFtjoFGUzImpthh0NF3l4eLqojBe6RDvIJBdBRGu5BB84LzzAcmKnSfry1fr5Q/fwwv5C3qWNynLhAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027224; c=relaxed/simple; bh=AOpwWOkdter/dta//ea30tZULAc+Y+Lv9Fvv3KCFmz0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BIHexNDUZl+cOHZHDUDGW6R1bpg3xK0yErTdJ5kmjJtf4T4CINO5blDM4+I9bCrG9FBudw5GcW63QyQdlhPzqsEnEy+NJ/jHdb+hF4HS3JnHC76qI0FN9vgE93l639KmHU0ASG5cN3mI6Y9Nf0I5FaHEY3xgHN6htEnFxzMKtoc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=ox1VFVGO; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ox1VFVGO" Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C0BA5A34; Tue, 15 Oct 2024 23:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1729027114; bh=AOpwWOkdter/dta//ea30tZULAc+Y+Lv9Fvv3KCFmz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ox1VFVGORL5RJaYMYYsXRGP+h3S91HcqFMNZqlrzhnz7kO+i1o03oZCuZULueqJD8 XjxNE3kQ9AnYVTbiJSFgUzwYztBFanyHqPH82FmHefbeHrpcpDMGsNdPndMPapFLG/ a63crlpanbG2q2gLYryhzjlea/N7LBDx22nCMkdQ= From: Daniel Scally To: linux-media@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: anders.ruke@gmail.com, sakari.ailus@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hverkuil-cisco@xs4all.nl, Daniel Scally Subject: [PATCH 2/3] platform/x86: int3472: Add board data for Dell 7212 Date: Tue, 15 Oct 2024 22:19:57 +0100 Message-Id: <20241015211958.1465909-3-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015211958.1465909-1-dan.scally@ideasonboard.com> References: <20241015211958.1465909-1-dan.scally@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Dell 7212 Rugged Extreme Tablet pairs an OV5670 sensor with the Intel IPU3 ISP. The sensor is powered by a TPS68470 PMIC, and so we need some board data to describe how to configure the GPIOs and regulators to run the sensor. Signed-off-by: Daniel Scally --- .../x86/intel/int3472/tps68470_board_data.c | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/tps68470_board_data.c b/drivers/platform/x86/intel/int3472/tps68470_board_data.c index 322237e056f3..d28053733bd2 100644 --- a/drivers/platform/x86/intel/int3472/tps68470_board_data.c +++ b/drivers/platform/x86/intel/int3472/tps68470_board_data.c @@ -129,6 +129,109 @@ static const struct tps68470_regulator_platform_data surface_go_tps68470_pdata = }, }; +/* Settings for Dell 7212 Tablet */ + +static struct regulator_consumer_supply int3479_vsio_consumer_supplies[] = { + REGULATOR_SUPPLY("avdd", "i2c-INT3479:00"), +}; + +static struct regulator_consumer_supply int3479_aux1_consumer_supplies[] = { + REGULATOR_SUPPLY("dvdd", "i2c-INT3479:00"), +}; + +static struct regulator_consumer_supply int3479_aux2_consumer_supplies[] = { + REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), +}; + +static const struct regulator_init_data dell_7212_tps68470_core_reg_init_data = { + .constraints = { + .min_uV = 1200000, + .max_uV = 1200000, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 0, + .consumer_supplies = NULL +}; + +static const struct regulator_init_data dell_7212_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV = 2815200, + .max_uV = 2815200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 0, + .consumer_supplies = NULL +}; + +static const struct regulator_init_data dell_7212_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV = 2815200, + .max_uV = 2815200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 0, + .consumer_supplies = NULL +}; + +static const struct regulator_init_data dell_7212_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 0, + .consumer_supplies = NULL, +}; + +static const struct regulator_init_data dell_7212_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(int3479_vsio_consumer_supplies), + .consumer_supplies = int3479_vsio_consumer_supplies, +}; + +static const struct regulator_init_data dell_7212_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV = 1213200, + .max_uV = 1213200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(int3479_aux1_consumer_supplies), + .consumer_supplies = int3479_aux1_consumer_supplies, +}; + +static const struct regulator_init_data dell_7212_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(int3479_aux2_consumer_supplies), + .consumer_supplies = int3479_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_7212_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE] = &dell_7212_tps68470_core_reg_init_data, + [TPS68470_ANA] = &dell_7212_tps68470_ana_reg_init_data, + [TPS68470_VCM] = &dell_7212_tps68470_vcm_reg_init_data, + [TPS68470_VIO] = &dell_7212_tps68470_vio_reg_init_data, + [TPS68470_VSIO] = &dell_7212_tps68470_vsio_reg_init_data, + [TPS68470_AUX1] = &dell_7212_tps68470_aux1_reg_init_data, + [TPS68470_AUX2] = &dell_7212_tps68470_aux2_reg_init_data, + }, +}; + static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id = "i2c-INT347A:00", .table = { @@ -146,6 +249,15 @@ static struct gpiod_lookup_table surface_go_int347e_gpios = { } }; +static struct gpiod_lookup_table dell_7212_int3479_gpios = { + .dev_id = "i2c-INT3479:00", + .table = { + GPIO_LOOKUP("tps68470-gpio", 3, "reset", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("tps68470-gpio", 4, "powerdown", GPIO_ACTIVE_LOW), + { } + } +}; + static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name = "i2c-INT3472:05", .tps68470_regulator_pdata = &surface_go_tps68470_pdata, @@ -166,6 +278,15 @@ static const struct int3472_tps68470_board_data surface_go3_tps68470_board_data }, }; +static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = { + .dev_name = "i2c-INT3472:05", + .tps68470_regulator_pdata = &dell_7212_tps68470_pdata, + .n_gpiod_lookups = 1, + .tps68470_gpio_lookup_tables = { + &dell_7212_int3479_gpios, + }, +}; + static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = { @@ -188,6 +309,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&surface_go3_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Latitude 7212 Rugged Extreme Tablet"), + }, + .driver_data = (void *)&dell_7212_tps68470_board_data, + }, { } }; From patchwork Tue Oct 15 21:19:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Scally X-Patchwork-Id: 13837119 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B0B01F80BC; Tue, 15 Oct 2024 21:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027225; cv=none; b=kEAO57KINv+GP/1oR6CqPLAOuKrqMpq/riJ1E59F9OeUSdFghx2P1r5XklEDOR+gnSakqWDc2FRCSYD3QBHLLPCywInmppVuQpnNgqjGfr9dSrC8Z5ODcOYfwzJY2eJFCvrtg1Lt6MrAep5cjnPnSQYQJsbyQKn2KpyWH03fz3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729027225; c=relaxed/simple; bh=eqxuOksx4KeZdBeDotgtJkYmKVXv8UqH/qarvTInZME=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fDcX4R+6qG0Io4qcrhwzNZ8brvNOTMIzy/IwBoEKCQ5NvlMrelbQHg+7Pfyn18tPJR5N7JawvMppGTJBN5xAmtMkV/XmJEe6ctgxGmUlJ4e3hoDnpL4CzXiIJ1x4FxuAd4aPSN7/M3mkxAAcCY8pqUlxXZruDth0VDrK7t6U+yA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=vm5jjmxQ; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vm5jjmxQ" Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 47206A8F; Tue, 15 Oct 2024 23:18:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1729027114; bh=eqxuOksx4KeZdBeDotgtJkYmKVXv8UqH/qarvTInZME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vm5jjmxQS3Pt6xWXVgDUWh28SEgR6f1y+6qZsNIxNOlBcEzIMag1DFrqRLgNy7m36 GPnWhJVrjGTSpDh589ff1WPqjRQbJr9qUri8N2W2BrEizjiyeMwhShs9+Jeuu1RTV6 9IlVtUo8CDCuQ6e97wqsLRAyZannlo6sK4sE9E3c= From: Daniel Scally To: linux-media@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: anders.ruke@gmail.com, sakari.ailus@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, hverkuil-cisco@xs4all.nl, Daniel Scally Subject: [PATCH 3/3] media: ipu-bridge: Add _HID for OV5670 Date: Tue, 15 Oct 2024 22:19:58 +0100 Message-Id: <20241015211958.1465909-4-dan.scally@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015211958.1465909-1-dan.scally@ideasonboard.com> References: <20241015211958.1465909-1-dan.scally@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The OV5670 is found on Dell 7212 tablets paired with an IPU3 ISP and needs to be connected by the ipu-bridge. Add it to the list of supported devices. Signed-off-by: Daniel Scally --- drivers/media/pci/intel/ipu-bridge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index a0e9a71580b5..4e921c751629 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -59,6 +59,8 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = { IPU_SENSOR_CONFIG("INT33BE", 1, 419200000), /* 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 */