From patchwork Wed Oct 28 09:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11863587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCE7F14B7 for ; Wed, 28 Oct 2020 22:19:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A176B206E3 for ; Wed, 28 Oct 2020 22:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603923557; bh=C+i9hSG3DC7PYTlPO4OOMAUq70uMqJhl4BFFF/S06X4=; h=From:To:Cc:Subject:Date:List-ID:From; b=J8JD+3ciHSYwG7YR6RUrDlD4KtAa1B5qk0Q3jnmiqV07vV61ZuwH1vbTfo3S0UJT4 QykPN+Dqyx3zpO2O+uZXMsKDzikfP6uE+YgOSxZ1JeCaEmvpD219nGaMKzk56ySd2C KUgGa0LPwoE6wnx5/EHMKRihK6MjCUXdTkJQ/nQw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731819AbgJ1WTQ (ORCPT ); Wed, 28 Oct 2020 18:19:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:60530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731688AbgJ1WRl (ORCPT ); Wed, 28 Oct 2020 18:17:41 -0400 Received: from kozik-lap.proceq-device.com (unknown [194.230.155.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF9FB2468F; Wed, 28 Oct 2020 09:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603876799; bh=C+i9hSG3DC7PYTlPO4OOMAUq70uMqJhl4BFFF/S06X4=; h=From:To:Cc:Subject:Date:From; b=RM7TbMkLhzXq4/+CiVWwwhRX47sqvNzIlBi1osRLRkrdgFVTIQiFT+vkcSt9woh3O Ty7Obt2tA3yjv9dw9ZlmRBw+nHfRwEr7EBWdhx9CLhGz8DDlk5YoPrgLhF45L43hYw n2LfQopbnC1CEPTAuLhWEW71z6y2+RB30bqq+q/U= From: Krzysztof Kozlowski To: Sakari Ailus , Mauro Carvalho Chehab , Tomasz Figa , Jason Chen , Andy Yeh , Alan Chiang , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH] media: i2c: imx258: correct mode to GBGB/RGRG Date: Wed, 28 Oct 2020 10:19:47 +0100 Message-Id: <20201028091947.93097-1-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The IMX258 sensor outputs pixels in GBGB/RGRG mode. This is described explicitly in datasheet and was actually mentioned in a comment inside the driver. Using other - wrong mode - leads to pinkish pictures. Fixes: e4802cb00bfe ("media: imx258: Add imx258 camera sensor driver") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/media/i2c/imx258.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index ef069333a969..bf75d4e597af 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -715,7 +715,7 @@ static int imx258_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) /* Initialize try_fmt */ try_fmt->width = supported_modes[0].width; try_fmt->height = supported_modes[0].height; - try_fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; + try_fmt->code = MEDIA_BUS_FMT_SGBRG10_1X10; try_fmt->field = V4L2_FIELD_NONE; return 0; @@ -827,7 +827,7 @@ static int imx258_enum_mbus_code(struct v4l2_subdev *sd, if (code->index > 0) return -EINVAL; - code->code = MEDIA_BUS_FMT_SGRBG10_1X10; + code->code = MEDIA_BUS_FMT_SGBRG10_1X10; return 0; } @@ -839,7 +839,7 @@ static int imx258_enum_frame_size(struct v4l2_subdev *sd, if (fse->index >= ARRAY_SIZE(supported_modes)) return -EINVAL; - if (fse->code != MEDIA_BUS_FMT_SGRBG10_1X10) + if (fse->code != MEDIA_BUS_FMT_SGBRG10_1X10) return -EINVAL; fse->min_width = supported_modes[fse->index].width; @@ -855,7 +855,7 @@ static void imx258_update_pad_format(const struct imx258_mode *mode, { fmt->format.width = mode->width; fmt->format.height = mode->height; - fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10; + fmt->format.code = MEDIA_BUS_FMT_SGBRG10_1X10; fmt->format.field = V4L2_FIELD_NONE; } @@ -902,7 +902,7 @@ static int imx258_set_pad_format(struct v4l2_subdev *sd, mutex_lock(&imx258->mutex); /* Only one raw bayer(GBRG) order is supported */ - fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10; + fmt->format.code = MEDIA_BUS_FMT_SGBRG10_1X10; mode = v4l2_find_nearest_size(supported_modes, ARRAY_SIZE(supported_modes), width, height,