From patchwork Fri Sep 16 14:02:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12978576 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86E2BC54EE9 for ; Fri, 16 Sep 2022 14:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbiIPOCu (ORCPT ); Fri, 16 Sep 2022 10:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbiIPOC1 (ORCPT ); Fri, 16 Sep 2022 10:02:27 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18442AB1A0 for ; Fri, 16 Sep 2022 07:02:20 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id n40-20020a05600c3ba800b003b49aefc35fso6667677wms.5 for ; Fri, 16 Sep 2022 07:02:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=mQ+WNR4+ZoBFRpRt6BX4yAkPkUqFNL1hRrx7xYLMtk8=; b=fCQJznlKOHViX/ZDbZiZ/7cc3Rwjl2TsfaCeOteu63mykK9+lyIu4xBwIQsLGW/roi QTklzYtLTHBZgR9y53g7RXYWAgkWnC+d5AKfd+0dY6ITfpN45ihpSqioFsJq8wd2YYdn IJ00QjUhsKJqGlH8N9GT/iiVgFC75BCfTcQ4/xz8Z10dgWgqpKjyNxErqvwI2IuEjea2 xoZC/hEuM2GP6plZDw4ClrlUODKSaA8N9vK8Fh8A3t0P7fS8pXWnBgOFqM95dkOT9Bf3 cG8GMWo4b4343EinDCt8W9vNQT7GehVA+BvMGjiHOZmVGsBPCk4jag5E3QwJE8+jA7z+ WK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=mQ+WNR4+ZoBFRpRt6BX4yAkPkUqFNL1hRrx7xYLMtk8=; b=5MOryhX4HkE+9dey4fEqFrobHgTFsjr0la4/jyoAeeLGfyil9b07/uC50ZcrJeLzj6 su57zEcxphYGfAus4koKsJevaSdzn04NahT5/s8dYLUPLPOD8OI+1aJTzCfpcp0DIaRS DAnsXg3uwAg9xBMGS8IR1xvPBRfE9iW7/omiWwaWUfnN3LrNO3zfi2QhRZEyE6zGlZyJ yOg0B4Ju3IkJ+sP87iSQahW4uFvWMMoU7sZY4z2c4cyZw/xwib5fqpuje4+QqCHhW2Ew AXOEWqFHYPWxQv8T2MRwxeaW2UfTv9lfI3RVZP6NQlGdG9yO+RRv7e99pRZe3DURdBW7 STvQ== X-Gm-Message-State: ACgBeo0/VcsNbeHRlPVVZ4zzj3VeJ0ossmZEgtwLbDQJu7bnzSb7wTAd ApSScSqyPd+9XWyrKjiw0jBKPg== X-Google-Smtp-Source: AA6agR5PnVesYavB8nqBWI4nA2t/SP+djKujIC9/7/y36XCHBtBzmKmo/3ajtq3fguizRthtQGpvBg== X-Received: by 2002:a7b:cc10:0:b0:3b4:4944:5013 with SMTP id f16-20020a7bcc10000000b003b449445013mr10361546wmh.8.1663336939262; Fri, 16 Sep 2022 07:02:19 -0700 (PDT) Received: from planet9.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f17-20020a1cc911000000b003a61306d79dsm2615041wmb.41.2022.09.16.07.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 07:02:18 -0700 (PDT) From: Bryan O'Donoghue To: sakari.ailus@iki.fi, dave.stevenson@raspberrypi.com, jacopo@jmondi.org, paul.j.murphy@intel.com, daniele.alessandrelli@intel.com, mchehab@kernel.org, linux-media@vger.kernel.org Cc: bryan.odonoghue@linaro.org Subject: [PATCH v4 1/3] media: dt-bindings: imx412: Extend compatible strings Date: Fri, 16 Sep 2022 15:02:11 +0100 Message-Id: <20220916140213.1310304-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> References: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add compatible bindings for imx477 and imx577 both of which use the same silicon enabling reference code from Sony in the available examples provided. Signed-off-by: Bryan O'Donoghue --- .../devicetree/bindings/media/i2c/sony,imx412.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml index 26d1807d0bb6..ebb649c5e4c5 100644 --- a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml +++ b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml @@ -19,7 +19,11 @@ description: properties: compatible: - const: sony,imx412 + items: + - enum: + - sony,imx412 + - sony,imx477 + - sony,imx577 reg: description: I2C address maxItems: 1 From patchwork Fri Sep 16 14:02:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12978577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21BAEECAAD8 for ; Fri, 16 Sep 2022 14:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbiIPOCy (ORCPT ); Fri, 16 Sep 2022 10:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbiIPOC2 (ORCPT ); Fri, 16 Sep 2022 10:02:28 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75843AE874 for ; Fri, 16 Sep 2022 07:02:24 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id bg5-20020a05600c3c8500b003a7b6ae4eb2so19927382wmb.4 for ; Fri, 16 Sep 2022 07:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=p+c48jxk3f8O5xMrsXo92bCrPamQN4CKrrxle6FJKe4=; b=uBmrjTMDHt9/i6L2/JajBFmTnCPoRwi0yfu64zihS590CRFoqrCBaPBnQHzCLarNFj xN7J0j1AU5bpWVSaVIAma6STz5xP8p8roycswgsA5yFfg/tQcTLQQtpFPg4vNTeB+2XS o5Ya2PsFsioqv7CyqGN9gsVooxUsgCMW6i0LrmmGWCBSp0h3dNihKxZumWgjNOPU/o+Q iR3zhfOeZePf4FrTWqaSMOh6kdlScfEQJEO7Vo9sh1yelg38DddaVmlkXrcZ0G3aTZ0X CgGoLAEwPFFmrCQOc05Bw3yIDM4gCtsdLX7VjqsMJ3rdAv5UqN+EjmjlrDYSnPk8SEgW VRlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=p+c48jxk3f8O5xMrsXo92bCrPamQN4CKrrxle6FJKe4=; b=liktxIJ76TR+IjaoVRIKB+aU/fegfj+eEV/4bccUA8biorEpghZH6APYiYZ9WRQB27 mjhMJUzu3N+ETVoxgxV1MyH2ljejreoOui5O3sN5yLAOvliOlM/HvhKsK/lrY0LcrGfb ST950TiRdr9w/LGuI4Pel4eDAs6v0eK8AVEYKXGhyzrWFitBYCKtJe2zhlsVANnnvbsK RbJo2QwikuV5mBOu30Jdf9P3f/A3llSX0wpFdJB3ZaGSHbpf+8BLzDThsAdepU7MGUJG tE/4tTEGGbwSN9RF8FvIk9iHXGYCn5zjOE5aCOZ2G5QGmIrgJuq5+Cyg9VSsA/utWFJB DNCA== X-Gm-Message-State: ACgBeo1dB7jfkJBTgjMokoNOqK8EGdUqxWnOZcjacnHh05ApHs5SRuph q5CB3XBTuYwzp0uOj7LM4xF4Sw== X-Google-Smtp-Source: AA6agR7UcByPsH3jNiZthdipTxqHSc8uV/IjuCmbusnJnCalqNqvKAfbDv6THEa5/xsMz3aIdDnHdw== X-Received: by 2002:a05:600c:3d17:b0:3b4:adc7:976c with SMTP id bh23-20020a05600c3d1700b003b4adc7976cmr5488286wmb.108.1663336942737; Fri, 16 Sep 2022 07:02:22 -0700 (PDT) Received: from planet9.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f17-20020a1cc911000000b003a61306d79dsm2615041wmb.41.2022.09.16.07.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 07:02:22 -0700 (PDT) From: Bryan O'Donoghue To: sakari.ailus@iki.fi, dave.stevenson@raspberrypi.com, jacopo@jmondi.org, paul.j.murphy@intel.com, daniele.alessandrelli@intel.com, mchehab@kernel.org, linux-media@vger.kernel.org Cc: bryan.odonoghue@linaro.org Subject: [PATCH v4 2/3] media: i2c: imx412: Assign v4l2 device subname based on compat string Date: Fri, 16 Sep 2022 15:02:12 +0100 Message-Id: <20220916140213.1310304-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> References: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org imx412, imx477 and imx577 all return the same chip-id when interrogated via i2c. I've confirmed this myself by - Looking at the code in Qcom and Nvidia stacks - Running the upstream imx412 driver on imx577 with a Qcom sm8250 RB5 - Running the downstream Qcom stack on the same hardware. This uses a commercial licensed stack with a driver/userspace pair that make no differentiation between imx412, imx477 and imx577. - Running the imx412 and imx577 on a Nvidia Nano with cameras from Leopard Imaging. Again this is a commercial non-upstream user-space/kernel-space pairing and again the same imx driver, works for both parts. Sakari suggested we should add a new compat but that the compat string should also set the media entity name also https://patchwork.kernel.org/project/linux-media/patch/20220607134057.2427663-3-bryan.odonoghue@linaro.org/#24894500 Set up the .data parameter of of_device_id to pass a string which we use to set the media entity name. Once done we can add in imx477 and imx577 as compatible chips with the media names reflecting the directed compat string. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/imx412.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c index a1394d6c1432..9f854a1a4c2f 100644 --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -1172,6 +1172,7 @@ static int imx412_init_controls(struct imx412 *imx412) static int imx412_probe(struct i2c_client *client) { struct imx412 *imx412; + const char *name; int ret; imx412 = devm_kzalloc(&client->dev, sizeof(*imx412), GFP_KERNEL); @@ -1179,6 +1180,9 @@ static int imx412_probe(struct i2c_client *client) return -ENOMEM; imx412->dev = &client->dev; + name = device_get_match_data(&client->dev); + if (!name) + return -ENODEV; /* Initialize subdev */ v4l2_i2c_subdev_init(&imx412->sd, client, &imx412_subdev_ops); @@ -1218,6 +1222,8 @@ static int imx412_probe(struct i2c_client *client) imx412->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; imx412->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; + v4l2_i2c_subdev_set_name(&imx412->sd, client, name, NULL); + /* Initialize source pad */ imx412->pad.flags = MEDIA_PAD_FL_SOURCE; ret = media_entity_pads_init(&imx412->sd.entity, 1, &imx412->pad); @@ -1281,7 +1287,7 @@ static const struct dev_pm_ops imx412_pm_ops = { }; static const struct of_device_id imx412_of_match[] = { - { .compatible = "sony,imx412" }, + { .compatible = "sony,imx412", .data = "imx412" }, { } }; From patchwork Fri Sep 16 14:02:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 12978578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B27FAC54EE9 for ; Fri, 16 Sep 2022 14:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbiIPOC4 (ORCPT ); Fri, 16 Sep 2022 10:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbiIPOCk (ORCPT ); Fri, 16 Sep 2022 10:02:40 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D9A7AB180 for ; Fri, 16 Sep 2022 07:02:26 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id i203-20020a1c3bd4000000b003b3df9a5ecbso15215335wma.1 for ; Fri, 16 Sep 2022 07:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=6CvF1XXx94MfM8P5Aw9kd8Rda9CjzbWOT+YyUiF/JnY=; b=jXVxcjpU+3u+KJMBa6box1d6vsnBlAliT56oCeVAWJdtZZDwWeRb/zBFZzAec9wqrf mnfJtSIieUDPo6Ra8T/w/qLGs5G/7ZqaW2GNk3Kx3ELqc10bStCCaZnlmY7bn8/Iqm1s A/csJ3u9gOSdy/TEhP2BBzK1gzR9Ji/n/S/41/E2ZGjqy/Ce4dFsJ0WiCEte7SQhYkZ9 OdNIJedbKbzsyaoffjRw/gIHHoTydSLSUX2PyTw+QbHG7s72fdI6jDdjsV+oB6ZqutOI uqH9ZjptcEpiL1FxYlz1r4ZlMs1kqapWrX8m9GmN8jAAJ3NlGTUpIEXDjmMKrNXuDl6+ aVBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=6CvF1XXx94MfM8P5Aw9kd8Rda9CjzbWOT+YyUiF/JnY=; b=LMtgu2OMgC5c1gwK4kQ3zkZZRqfgUl7Y16M/SmMr0l3dxUFkJhqZMC8vcCmPfOylcW PLt6RkHBX4tZN10nuQ/GjfLa2SMgWjbnDrjUZ1NJzYKSZhiuyHuduo0dTn0aL4KGfCzo q9Ts8DYeoD7qC9PJeB8/VyREYjuzp3/3ITmi/6LAcnnFk6vBo6fIEZnX5EC/pcc0W0vX 3IHSBoz+ZVrg5GzbHIuNipieOEIAAIzhGpuP+aN2Nlll+3TtutD4pZJzkT30wd1YI7kt ofzLESREerQpQ9968Dybk5umyIlGM3d9HbiqyWMVxPrjxs6hHXKw2YVeKl4j3RUlr7WM 4veA== X-Gm-Message-State: ACgBeo0/R65NeEsZ9a7GsSfKiPuIz3S66eCwQNrBP/j5ZjKk7285z7G2 jO9bDddti0B4fbz8sFukV9wtyg== X-Google-Smtp-Source: AA6agR5Zsc+tZeuuIw1wrhh4ZKC05STEYD5OPwW/gkXoXkBj/D/RA0kBx1GPhfPNxb0JODswa1lQXg== X-Received: by 2002:a05:600c:3b1b:b0:3b4:92fd:559a with SMTP id m27-20020a05600c3b1b00b003b492fd559amr10180257wms.69.1663336944609; Fri, 16 Sep 2022 07:02:24 -0700 (PDT) Received: from planet9.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f17-20020a1cc911000000b003a61306d79dsm2615041wmb.41.2022.09.16.07.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 07:02:24 -0700 (PDT) From: Bryan O'Donoghue To: sakari.ailus@iki.fi, dave.stevenson@raspberrypi.com, jacopo@jmondi.org, paul.j.murphy@intel.com, daniele.alessandrelli@intel.com, mchehab@kernel.org, linux-media@vger.kernel.org Cc: bryan.odonoghue@linaro.org Subject: [PATCH v4 3/3] media: i2c: imx412: Add new compatible strings Date: Fri, 16 Sep 2022 15:02:13 +0100 Message-Id: <20220916140213.1310304-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> References: <20220916140213.1310304-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The Sony imx477 and imx577 use the same silicon enabling reference code from Sony in the available examples provided as the imx412. Add in compatible strings to differentiate the parts. Signed-off-by: Bryan O'Donoghue --- drivers/media/i2c/imx412.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c index 9f854a1a4c2f..93f362e3b132 100644 --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -1288,6 +1288,8 @@ static const struct dev_pm_ops imx412_pm_ops = { static const struct of_device_id imx412_of_match[] = { { .compatible = "sony,imx412", .data = "imx412" }, + { .compatible = "sony,imx477", .data = "imx477" }, + { .compatible = "sony,imx577", .data = "imx577" }, { } };