Patch Detail
Show a patch.
GET /api/patches/4148/?format=api
{ "id": 4148, "url": "https://patchwork.libcamera.org/api/patches/4148/?format=api", "web_url": "https://patchwork.libcamera.org/patch/4148/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200623100815.10674-5-jacopo@jmondi.org>", "date": "2020-06-23T10:07:54", "name": "[libcamera-devel,04/25] media: ov5647: Add support for non-continuous clock mode", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "50c69b789c98550a8cb7888ede020f053892556e", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": { "id": 15, "url": "https://patchwork.libcamera.org/api/users/15/?format=api", "username": "jmondi", "first_name": "Jacopo", "last_name": "Mondi", "email": "jacopo@jmondi.org" }, "mbox": "https://patchwork.libcamera.org/patch/4148/mbox/", "series": [ { "id": 1030, "url": "https://patchwork.libcamera.org/api/series/1030/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1030", "date": "2020-06-23T10:07:50", "name": "media: ov5647: Support RaspberryPi Camera Module v1", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1030/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/4148/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/4148/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A9720609A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jun 2020 12:05:22 +0200 (CEST)", "from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 83D24C0006;\n\tTue, 23 Jun 2020 10:05:19 +0000 (UTC)" ], "X-Originating-IP": "93.34.118.233", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "mchehab@kernel.org, sakari.ailus@linux.intel.com, hverkuil@xs4all.nl,\n\tlaurent.pinchart@ideasonboard.com, roman.kovalivskyi@globallogic.com, \n\tdave.stevenson@raspberrypi.org, naush@raspberrypi.com", "Cc": "Jacopo Mondi <jacopo@jmondi.org>, mrodin@de.adit-jv.com,\n\thugues.fruchet@st.com, mripard@kernel.org, aford173@gmail.com,\n\tsudipi@jp.adit-jv.com, andrew_gabbasov@mentor.com,\n\terosca@de.adit-jv.com, \n\tlinux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org", "Date": "Tue, 23 Jun 2020 12:07:54 +0200", "Message-Id": "<20200623100815.10674-5-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200623100815.10674-1-jacopo@jmondi.org>", "References": "<20200623100815.10674-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 04/25] media: ov5647: Add support for\n\tnon-continuous clock mode", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Tue, 23 Jun 2020 10:05:22 -0000" }, "content": "From: Dave Stevenson <dave.stevenson@raspberrypi.org>\n\nAdd support for optional non-continuous clock mode to the ov5647\nsensor driver.\n\nNon-continuous clock saves a small amount of power and on some SoCs\nis easier to interface with.\n\nSigned-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>\nSigned-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n drivers/media/i2c/ov5647.c | 24 ++++++++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c\nindex 105ff7f899b34..2d69cd97142d7 100644\n--- a/drivers/media/i2c/ov5647.c\n+++ b/drivers/media/i2c/ov5647.c\n@@ -44,6 +44,7 @@\n #define PWDN_ACTIVE_DELAY_MS\t20\n \n #define MIPI_CTRL00_CLOCK_LANE_GATE\t\tBIT(5)\n+#define MIPI_CTRL00_LINE_SYNC_ENABLE\t\tBIT(4)\n #define MIPI_CTRL00_BUS_IDLE\t\t\tBIT(2)\n #define MIPI_CTRL00_CLOCK_LANE_DISABLE\t\tBIT(0)\n \n@@ -95,6 +96,7 @@ struct ov5647 {\n \tint\t\t\t\tpower_count;\n \tstruct clk\t\t\t*xclk;\n \tstruct gpio_desc\t\t*pwdn;\n+\tbool\t\t\t\tclock_ncont;\n };\n \n static inline struct ov5647 *to_state(struct v4l2_subdev *sd)\n@@ -269,9 +271,15 @@ static int ov5647_set_virtual_channel(struct v4l2_subdev *sd, int channel)\n \n static int ov5647_stream_on(struct v4l2_subdev *sd)\n {\n+\tstruct ov5647 *ov5647 = to_state(sd);\n+\tu8 val = MIPI_CTRL00_BUS_IDLE;\n \tint ret;\n \n-\tret = ov5647_write(sd, OV5647_REG_MIPI_CTRL00, MIPI_CTRL00_BUS_IDLE);\n+\tif (ov5647->clock_ncont)\n+\t\tval |= MIPI_CTRL00_CLOCK_LANE_GATE |\n+\t\t MIPI_CTRL00_LINE_SYNC_ENABLE;\n+\n+\tret = ov5647_write(sd, OV5647_REG_MIPI_CTRL00, val);\n \tif (ret < 0)\n \t\treturn ret;\n \n@@ -546,9 +554,11 @@ static const struct v4l2_subdev_internal_ops ov5647_subdev_internal_ops = {\n \t.open = ov5647_open,\n };\n \n-static int ov5647_parse_dt(struct device_node *np)\n+static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np)\n {\n-\tstruct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };\n+\tstruct v4l2_fwnode_endpoint bus_cfg = {\n+\t\t.bus_type = V4L2_MBUS_CSI2_DPHY,\n+\t};\n \tstruct device_node *ep;\n \n \tint ret;\n@@ -558,7 +568,13 @@ static int ov5647_parse_dt(struct device_node *np)\n \t\treturn -EINVAL;\n \n \tret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);\n+\tif (ret)\n+\t\tgoto out;\n \n+\tsensor->clock_ncont = bus_cfg.bus.mipi_csi2.flags &\n+\t\t\t V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;\n+\n+out:\n \tof_node_put(ep);\n \treturn ret;\n }\n@@ -577,7 +593,7 @@ static int ov5647_probe(struct i2c_client *client)\n \t\treturn -ENOMEM;\n \n \tif (IS_ENABLED(CONFIG_OF) && np) {\n-\t\tret = ov5647_parse_dt(np);\n+\t\tret = ov5647_parse_dt(sensor, np);\n \t\tif (ret) {\n \t\t\tdev_err(dev, \"DT parsing error: %d\\n\", ret);\n \t\t\treturn ret;\n", "prefixes": [ "libcamera-devel", "04/25" ] }