Show a patch.

GET /api/1.1/patches/4118/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 4118,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/4118/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/4118/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200622171910.608894-5-jacopo@jmondi.org>",
    "date": "2020-06-22T17:18:49",
    "name": "[libcamera-devel,04/25] media: ov5647: Add support for non-continuous clock mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "50c69b789c98550a8cb7888ede020f053892556e",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/4118/mbox/",
    "series": [
        {
            "id": 1026,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1026/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1026",
            "date": "2020-06-22T17:18:45",
            "name": "media: ov5647: Support RaspberryPi Camera Module v1",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1026/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/4118/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/4118/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D556E603B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jun 2020 19:16:17 +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 relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 62D3F20007;\n\tMon, 22 Jun 2020 17:16:14 +0000 (UTC)"
        ],
        "X-Originating-IP": "93.34.118.233",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "lolivei@synopsys.com, mchehab@kernel.org, sakari.ailus@linux.intel.com, \n\thverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com,\n\troman.kovalivskyi@globallogic.com, dave.stevenson@raspberrypi.org,\n\tnaush@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": "Mon, 22 Jun 2020 19:18:49 +0200",
        "Message-Id": "<20200622171910.608894-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200622171910.608894-1-jacopo@jmondi.org>",
        "References": "<20200622171910.608894-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": "Mon, 22 Jun 2020 17:16:18 -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"
    ]
}