android_kernel_oneplus_msm8998/drivers/media
Jacopo Mondi 0f83a55ca0 media: v4l2: i2c: ov7670: Fix PLL bypass register values
commit 61da76beef1e4f0b6ba7be4f8d0cf0dac7ce1f55 upstream.

The following commits:
commit f6dd927f34 ("[media] media: ov7670: calculate framerate properly for ov7675")
commit 04ee6d9204 ("[media] media: ov7670: add possibility to bypass pll for ov7675")
introduced the ability to bypass PLL multiplier and use input clock (xvclk)
as pixel clock output frequency for ov7675 sensor.

PLL is bypassed using register DBLV[7:6], according to ov7670 and ov7675
sensor manuals. Macros used to set DBLV register seem wrong in the
driver, as their values do not match what reported in the datasheet.

Fix by changing DBLV_* macros to use bits [7:6] and set bits [3:0] to
default 0x0a reserved value (according to datasheets).

While at there, remove a write to DBLV register in
"ov7675_set_framerate()" that over-writes the previous one to the same
register that takes "info->pll_bypass" flag into account instead of setting PLL
multiplier to 4x unconditionally.

And, while at there, since "info->pll_bypass" is only used in
set/get_framerate() functions used by ov7675 only, it is not necessary
to check for the device id at probe time to make sure that when using
ov7670 "info->pll_bypass" is set to false.

Fixes: f6dd927f34 ("[media] media: ov7670: calculate framerate properly for ov7675")

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-16 19:45:03 +02:00
..
common media: siano: get rid of __le32/__le16 cast warnings 2018-08-06 16:24:37 +02:00
dvb-core media: dvb_frontend: fix locking issues at dvb_frontend_get_event() 2018-07-03 11:21:33 +02:00
dvb-frontends media: dvb-frontends: fix i2c access helpers for KASAN 2018-12-17 21:55:17 +01:00
firewire media: firewire: Fix app_info parameter type in avc_ca{,_app}_info 2019-01-26 09:42:53 +01:00
i2c media: v4l2: i2c: ov7670: Fix PLL bypass register values 2019-05-16 19:45:03 +02:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci mm: replace get_user_pages_unlocked() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
platform media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumeration 2019-04-27 09:33:53 +02:00
radio media: si470x: fix __be16 annotations 2018-08-06 16:24:39 +02:00
rc mceusb: sporadic RX truncation corruption fix 2018-04-13 19:50:18 +02:00
tuners media: r820t: fix r820t_write_reg for KASAN 2018-02-22 15:45:02 +01:00
usb media: v4l2-ctrls.c/uvc: zero v4l2_event 2019-04-03 06:23:16 +02:00
v4l2-core media: v4l2-ctrls.c/uvc: zero v4l2_event 2019-04-03 06:23:16 +02:00
Kconfig media updates for v4.2-rc1 2015-06-25 17:55:48 -07:00
Makefile [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c [media] media-devnode: just return 0 instead of using a var 2014-09-03 17:59:28 -03:00
media-entity.c [media] media-entity.c: get rid of var length arrays 2015-10-01 18:10:05 -03:00