{"id":4119,"url":"https://patchwork.libcamera.org/api/patches/4119/?format=json","web_url":"https://patchwork.libcamera.org/patch/4119/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","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-6-jacopo@jmondi.org>","date":"2020-06-22T17:18:50","name":"[libcamera-devel,05/25] media: ov5647: Add set_fmt and get_fmt calls.","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"aa5bc1cb275b50d5efcae33a05421ea71c453484","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/4119/mbox/","series":[{"id":1026,"url":"https://patchwork.libcamera.org/api/series/1026/?format=json","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/4119/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/4119/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 588C5603B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 Jun 2020 19:16:21 +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 F27E020005;\n\tMon, 22 Jun 2020 17:16:17 +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:50 +0200","Message-Id":"<20200622171910.608894-6-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 05/25] media: ov5647: Add set_fmt and\n\tget_fmt calls.","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:21 -0000"},"content":"From: Dave Stevenson <dave.stevenson@raspberrypi.org>\n\nThere's no way to query the subdevice for the supported\nresolutions. Add set_fmt and get_fmt implementations. Since there's\nonly one format supported set_fmt does nothing and get returns single\nformat.\n\nSigned-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>\nSigned-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n drivers/media/i2c/ov5647.c | 19 +++++++++++++++++++\n 1 file changed, 19 insertions(+)","diff":"diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c\nindex 2d69cd97142d7..43fecf0ca58f3 100644\n--- a/drivers/media/i2c/ov5647.c\n+++ b/drivers/media/i2c/ov5647.c\n@@ -487,8 +487,27 @@ static int ov5647_enum_mbus_code(struct v4l2_subdev *sd,\n \treturn 0;\n }\n \n+static int ov5647_set_get_fmt(struct v4l2_subdev *sd,\n+\t\t\t      struct v4l2_subdev_pad_config *cfg,\n+\t\t\t      struct v4l2_subdev_format *format)\n+{\n+\tstruct v4l2_mbus_framefmt *fmt = &format->format;\n+\n+\t/* Only one format is supported, so return that */\n+\tmemset(fmt, 0, sizeof(*fmt));\n+\tfmt->code = MEDIA_BUS_FMT_SBGGR8_1X8;\n+\tfmt->colorspace = V4L2_COLORSPACE_SRGB;\n+\tfmt->field = V4L2_FIELD_NONE;\n+\tfmt->width = 640;\n+\tfmt->height = 480;\n+\n+\treturn 0;\n+}\n+\n static const struct v4l2_subdev_pad_ops ov5647_subdev_pad_ops = {\n \t.enum_mbus_code = ov5647_enum_mbus_code,\n+\t.set_fmt =\t  ov5647_set_get_fmt,\n+\t.get_fmt =\t  ov5647_set_get_fmt,\n };\n \n static const struct v4l2_subdev_ops ov5647_subdev_ops = {\n","prefixes":["libcamera-devel","05/25"]}