From: Jimmy Su <jimmy.su@intel.com>
To: linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com, andy.yeh@intel.com,
jimmy.su@intel.com, yhuang@ovt.com, akeem.chen@ovt.com
Subject: [PATCH v2] UPSTREAM: media: ov8856: skip OTP read in non-zero ACPI D state
Date: Tue, 10 May 2022 23:12:41 +0800 [thread overview]
Message-ID: <20220510151241.12435-1-jimmy.su@intel.com> (raw)
To skip OTP read function while enable non-zero ACPI D state.
This OTP read only influences streaming output with 3280x2464 &
1640x1232 resolution.
Signed-off-by: Jimmy Su <jimmy.su@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
---
drivers/media/i2c/ov8856.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c
index 8785764b7a74..f1bb7d882183 100644
--- a/drivers/media/i2c/ov8856.c
+++ b/drivers/media/i2c/ov8856.c
@@ -1448,6 +1448,9 @@ struct ov8856 {
/* True if the device has been identified */
bool identified;
+
+ /* True for skipping otp read */
+ bool acpi_skip_otp;
};
struct ov8856_lane_cfg {
@@ -1692,7 +1695,7 @@ static int ov8856_identify_module(struct ov8856 *ov8856)
{
struct i2c_client *client = v4l2_get_subdevdata(&ov8856->sd);
int ret;
- u32 val;
+ u32 val, width;
if (ov8856->identified)
return 0;
@@ -1708,6 +1711,10 @@ static int ov8856_identify_module(struct ov8856 *ov8856)
return -ENXIO;
}
+ width = ov8856->cur_mode->width;
+ if (ov8856->acpi_skip_otp & ((width == 3280) | (width == 1640)))
+ goto otp_skip;
+
ret = ov8856_write_reg(ov8856, OV8856_REG_MODE_SELECT,
OV8856_REG_VALUE_08BIT, OV8856_MODE_STREAMING);
if (ret)
@@ -1750,6 +1757,11 @@ static int ov8856_identify_module(struct ov8856 *ov8856)
ov8856->identified = true;
+ return 0;
+
+otp_skip:
+ ov8856->identified = true;
+
return 0;
}
@@ -2499,6 +2511,8 @@ static int ov8856_probe(struct i2c_client *client)
dev_err(&client->dev, "failed to find sensor: %d", ret);
goto probe_power_off;
}
+ } else {
+ ov8856->acpi_skip_otp = true;
}
mutex_init(&ov8856->mutex);
--
2.17.1
next reply other threads:[~2022-05-10 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 15:12 Jimmy Su [this message]
2022-05-16 11:30 ` [PATCH v2] UPSTREAM: media: ov8856: skip OTP read in non-zero ACPI D state Dan Carpenter
2022-05-18 17:15 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220510151241.12435-1-jimmy.su@intel.com \
--to=jimmy.su@intel.com \
--cc=akeem.chen@ovt.com \
--cc=andy.yeh@intel.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=yhuang@ovt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox