Commit Graph

15 Commits

Author SHA1 Message Date
Krzysztof Hałasa 53d02b0409 media: TDA1997x: fix tda1997x_query_dv_timings() return value
[ Upstream commit 7dee1030871a48d4f3c5a74227a4b4188463479a ]

Correctly propagate the tda1997x_detect_std error value.

Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 12:26:31 +02:00
Krzysztof Hałasa b928930530 media: TDA1997x: enable EDID support
[ Upstream commit ea3e1c36e38810427485f06c2becc1f29e54521d ]

Without this patch, the TDA19971 chip's EDID is inactive.
EDID never worked with this driver, it was all tested with HDMI signal
sources which don't need EDID support.

Signed-off-by: Krzysztof Halasa <khalasa@piap.pl>
Fixes: 9ac0038db9 ("media: i2c: Add TDA1997x HDMI receiver driver")
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-15 09:47:30 +02:00
Yang Yingliang f6b9747605 media: i2c: tda1997: Fix possible use-after-free in tda1997x_remove()
[ Upstream commit 7f820ab5d4eebfe2d970d32a76ae496a6c286f0f ]

This driver's remove path calls cancel_delayed_work(). However, that
function does not wait until the work function finishes. This means
that the callback function may still be running after the driver's
remove function has finished, which would result in a use-after-free.

Fix by calling cancel_delayed_work_sync(), which ensures that
the work is properly cancelled, no longer running, and unable
to re-schedule itself.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-11 14:04:11 +02:00
Wolfram Sang 2f822f1da0 media: i2c: tda1997x: prevent potential NULL pointer access
i2c_new_dummy() can fail returning a NULL pointer. This is not checked
and the returned pointer is blindly used. Convert to
devm_i2c_new_dummy_client() which returns an ERR_PTR and also add a
validity check. Using devm_* here also fixes a leak because the dummy
client was not released in the probe error path.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-08-13 11:46:32 -03:00
Tim Harvey 0806bc0afb media: tda1997x: fix get_edid
set_edid never wrote the new EDID to state->edid.edid, it was only
written to the hardware. Since get_edid returned state->edid.edid,
it was never returning the right EDID.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: added missing commit log]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-18 15:27:35 -05:00
Dave Airlie d7563c55ef drm-misc-next for v4.21, part 1:
UAPI Changes:
 - Add syncobj timeline support to drm.
 
 Cross-subsystem Changes:
 - Remove shared fence staging in dma-buf's fence object, and allow
   reserving more than 1 fence and add more paranoia when debugging.
 - Constify infoframe functions in video/hdmi.
 
 Core Changes:
 - Add vkms todo, and a lot of assorted doc fixes.
 - Drop transitional helpers and convert drivers to use drm_atomic_helper_shutdown().
 - Move atomic state helper functions to drm_atomic_state_helper.[ch]
 - Refactor drm selftests, and add new tests.
 - DP MST atomic state cleanups.
 - Drop EXPORT_SYMBOL from drm leases.
 - Lease cleanups and fixes.
 - Create render node for vgem.
 
 Driver Changes:
 - Fix build failure in imx without fbdev emulation.
 - Add rotation quirk for GPD win2 panel.
 - Add support for various CDTech panels, Banana Pi Panel, DLC1010GIG,
   Olimex LCD-O-LinuXino, Samsung S6D16D0, Truly NT35597 WQXGA,
   Himax HX8357D, simulated RTSM AEMv8.
 - Add dw_hdmi support to rockchip driver.
 - Fix YUV support in vc4.
 - Fix resource id handling in virtio.
 - Make rockchip use dw-mipi-dsi bridge driver, and add dual dsi support.
 - Advertise that tinydrm only supports DRM_FORMAT_MOD_LINEAR.
 - Convert many drivers to use atomic helpers, and drm_fbdev_generic_setup().
 - Add Mali linear tiled formats, and enable them in the Mali-DP driver.
 - Add support for H6 DE3 mixer 0, DW HDMI, HDMI PHY and TCON TOP.
 - Assorted driver cleanups and fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlvi0eAACgkQ/lWMcqZw
 E8PI3g//TIlMmbrUc6BrWCNnz4YpJ+mC2dq7HMYB4yf5QeXTYrRDqK6syakbGcbe
 FGYxt+21REfyQ9IQPdQslmVIUqJZuMBFSvLjXnZvybJSllE23CAXG0hEwHTuPYiF
 yzxmYwlYOxVlW0nnB3fEDM8BfbWyMYR03c4sobPgiAGoBd+CJif/BtKEwranYrRx
 7rZh8PnrCPGAnewmYux6U4zkOpWyjUp5t3kqpNRJDxPfxpa991yvUJX3DxTFFr9b
 nqYNp3F3fkdowYuJj2eH/uBNd17TouzITGQxIZWEsJfFvB+2Awp7KgRCT8nUAt0I
 vELbADsy3QwZlQp1F2FaVwfGbmHr41F+Vsq9coUt4vPaiyT3vCW0KGCeal1dKyYf
 +S8UXIijkoGXm0RqxkbkJsG7AYSIzG+NQm6W+9tnQg6CwpQb2wqU3YCPQWqtFHqM
 Tz/EW+JqG5Wl1aHXVEbnSajtqT2ooskwHfy81iwNqaGwVy+ZSLIZpqC91Hk9SyZ9
 HBDuKWSzqEqXWf7nwbOTm0umQ9mk8+I41k+dyqc2fq9z/gySqKd32eC3aLa0/p3y
 6bngvu1TT6jNhRdduwxgl/Y5cnQp/Zg9wYRKmAjViZtooaWj8p2o45AufGz1rplR
 BdYVUOPofVVD9ShwxayWzuocFW/HbgYc7FHHgKUFgFBO5iC/A2s=
 =UV0m
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-11-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v4.21, part 1:

UAPI Changes:
- Add syncobj timeline support to drm.

Cross-subsystem Changes:
- Remove shared fence staging in dma-buf's fence object, and allow
  reserving more than 1 fence and add more paranoia when debugging.
- Constify infoframe functions in video/hdmi.

Core Changes:
- Add vkms todo, and a lot of assorted doc fixes.
- Drop transitional helpers and convert drivers to use drm_atomic_helper_shutdown().
- Move atomic state helper functions to drm_atomic_state_helper.[ch]
- Refactor drm selftests, and add new tests.
- DP MST atomic state cleanups.
- Drop EXPORT_SYMBOL from drm leases.
- Lease cleanups and fixes.
- Create render node for vgem.

Driver Changes:
- Fix build failure in imx without fbdev emulation.
- Add rotation quirk for GPD win2 panel.
- Add support for various CDTech panels, Banana Pi Panel, DLC1010GIG,
  Olimex LCD-O-LinuXino, Samsung S6D16D0, Truly NT35597 WQXGA,
  Himax HX8357D, simulated RTSM AEMv8.
- Add dw_hdmi support to rockchip driver.
- Fix YUV support in vc4.
- Fix resource id handling in virtio.
- Make rockchip use dw-mipi-dsi bridge driver, and add dual dsi support.
- Advertise that tinydrm only supports DRM_FORMAT_MOD_LINEAR.
- Convert many drivers to use atomic helpers, and drm_fbdev_generic_setup().
- Add Mali linear tiled formats, and enable them in the Mali-DP driver.
- Add support for H6 DE3 mixer 0, DW HDMI, HDMI PHY and TCON TOP.
- Assorted driver cleanups and fixes.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/be7ebd91-edd9-8fa4-4286-1c57e3165113@linux.intel.com
2018-11-19 10:40:33 +10:00
Sakari Ailus 60359a28d5 media: v4l: fwnode: Initialise the V4L2 fwnode endpoints to zero
Initialise the V4L2 fwnode endpoints to zero in all drivers using
v4l2_fwnode_endpoint_parse(). This prepares for setting default endpoint
flags as well as the bus type. Setting bus type to zero will continue to
guess the bus among the guessable set (parallel, Bt.656 and CSI-2 D-PHY).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-04 16:21:02 -04:00
Ville Syrjälä 480b8b3e42 video/hdmi: Pass buffer size to infoframe unpack functions
To make sure the infoframe unpack functions don't end up examining
stack garbage or oopsing, let's pass in the size of the buffer.

v2: Convert tda1997x.c as well (kbuild test robot)

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: linux-media@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180920185145.1912-3-ville.syrjala@linux.intel.com
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-10-01 21:56:14 +03:00
Hans Verkuil d272bc92c4 media: rename MEDIA_ENT_F_DTV_DECODER to MEDIA_ENT_F_DV_DECODER
The use of 'DTV' is very confusing since it normally refers to Digital
TV e.g. DVB etc.

Instead use 'DV' (Digital Video), which nicely corresponds to the
DV Timings API used to configure such receivers and transmitters.

We keep an alias to avoid breaking userspace applications.

Since this alias is only available if __KERNEL__ is *not* defined
(i.e. it is only available for userspace, not kernelspace), any
drivers that use it also have to be converted to the new define.
These drivers are adv7604, adv7842 and tda1997x.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-25 07:49:28 -04:00
Linus Torvalds 3036bc4536 media updates for v4.18-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJbGDjcAAoJEAhfPr2O5OEV1KwP/Am2n5Ehc2W0/DLD3K7LlwgN
 8JnMPWNQTCreLRgJD0/KX+HH1M+yBJ05KF/Glm7fcOKpOhWqrUbPgtiQT0GyHHBB
 uvmQfGJrRvCrP+1S1SeWtNhItsyWvCfDaorzsTWJYEF/F9Wtj/Sj92DC1y/BKQaR
 Rcs4yeCqlFEp3rjbXExanFhA3/XeMzK2sby8c51cILTZPkWI64qrHcZRWOW7+zZ6
 fKEVDNOKxa7sfg8I9yaI73lBGXBpCJxLROloJ3jEtuH5gY3nR6PZdXunBC5K0+pX
 UH1vUeBcS/3ExQWL0zmCqHz1aYb6kzTSbIPs+NktxyzTTb8FDjT9JhV/9AxhEQfK
 iIxv81LRBdbEoPxbvx88sj5VVvlRla/NRv03WsXhhVDqx2SZJuNgSXw3XJtGDx3j
 AuUur0AQH4KMNNmwxmyn6wbhm7N63AaGbmYE2sRmaL7lk6b48BSbsUpOM5AMWzZe
 ZsESSsoqjRR86zFtVVzI7ZImCk16D6mNRP94Z0DQReWAJ6zS57/EYfKZ+pEQ6mww
 IyoJalD+pBe160fqsSo59F4k2fqzsqP4p8m29OQWFvyl7+UboMBz7FscWfyT98+R
 MbJolZ8QJNlOVaOusxPYLfdfjVmkHCt4E0cBZVFYIvliTGd5QiKqHAW+kTYQH0No
 Y0nHm4bShsUY8I9YCgsk
 =r/WP
 -----END PGP SIGNATURE-----

Merge tag 'media/v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - remove of atomisp driver from staging, as nobody would have time to
   dedicate huge efforts to fix all the problems there. Also, we have a
   feeling that the driver may not even run the way it is.

 - move Zoran driver to staging, in order to be either fixed to use VB2
   and the proper media kAPIs or to be removed

 - remove videobuf-dvb driver, with is unused for a while

 - some V4L2 documentation fixes/improvements

 - new sensor drivers: imx258 and ov7251

 - a new driver was added to allow using I2C transparent drivers

 - several improvements at the ddbridge driver

 - several improvements at the ISDB pt1 driver, making it more coherent
   with the DVB framework

 - added a new platform driver for MIPI CSI-2 RX: cadence

 - now, all media drivers can be compiled on x86 with COMPILE_TEST

 - almost all media drivers now build on non-x86 architectures with
   COMPILE_TEST

 - lots of other random stuff: cleanups, support for new board models,
   bug fixes, etc

* tag 'media/v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (464 commits)
  media: omap2: fix compile-testing with FB_OMAP2=m
  media: media/radio/Kconfig: add back RADIO_ISA
  media: v4l2-ioctl.c: fix missing unlock in __video_do_ioctl()
  media: pxa_camera: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power
  media: arch: sh: migor: Fix TW9910 PDN gpio
  media: staging: tegra-vde: Reset VDE regardless of memory client resetting failure
  media: marvel-ccic: mmp: select VIDEOBUF2_VMALLOC/DMA_CONTIG
  media: marvel-ccic: allow ccic and mmp drivers to coexist
  media: uvcvideo: Prevent setting unavailable flags
  media: ddbridge: conditionally enable fast TS for stv0910-equipped bridges
  media: dvb-frontends/stv0910: make TS speed configurable
  media: ddbridge/mci: add identifiers to function definition arguments
  media: ddbridge/mci: protect against out-of-bounds array access in stop()
  media: rc: ensure input/lirc device can be opened after register
  media: rc: nuvoton: Keep device enabled during reg init
  media: rc: nuvoton: Keep track of users on CIR enable/disable
  media: rc: nuvoton: Tweak the interrupt enabling dance
  media: uvcvideo: Support realtek's UVC 1.5 device
  media: uvcvideo: Fix driver reference counting
  media: gspca_zc3xx: Enable short exposure times for OV7648
  ...
2018-06-07 12:34:37 -07:00
Christophe JAILLET 50a0efae27 media: i2c: tda1997: Fix an error handling path 'tda1997x_probe()'
If 'media_entity_pads_init()' fails, we must free the resources allocated
by 'v4l2_ctrl_handler_init()', as already done in the previous error
handling path.

'goto' the right label to fix it.

Fixes: 9ac0038db9 ("media: i2c: Add TDA1997x HDMI receiver driver")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-11 11:36:09 -04:00
Kuninori Morimoto 2d8102cc9a
media: i2c: tda1997: replace codec to component
Now we can replace Codec to Component. Let's do it.

Note:
	xxx_codec_xxx()		->	xxx_component_xxx()
	.idle_bias_off = 0	->	.idle_bias_on = 1
	.ignore_pmdown_time = 0	->	.use_pmdown_time = 1
	-			->	.endianness = 1
	-			->	.non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-05-05 10:49:36 +09:00
Sakari Ailus 5cd770f68a media: tda1997x: Use bitwise or for setting subdev flags
Assigning subdev flags in probe() after v4l2_i2c_subdev_init() clears the
I2C flag set by that function. Fix this by using bitwise or instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-04-23 13:58:56 -04:00
Mauro Carvalho Chehab 4395fb475a tda1997x: get rid of an unused var
1 warning regressions:
  + drivers/media/i2c/tda1997x.c: warning: variable 'last_irq_status' set but not used [-Wunused-but-set-variable]:  => 1421:17

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-22 12:54:28 -05:00
Tim Harvey 9ac0038db9 media: i2c: Add TDA1997x HDMI receiver driver
Add support for the TDA1997x HDMI receivers.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix type 'testin' -> 'testing']
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-02-22 12:53:32 -05:00