aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/spi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-01-16media: cxd2880-spi: fix two memory leaks of dvb_spiColin Ian King1-3/+5
There are two return paths that do not kfree dvb_spi. Fix the memory leaks by returning via the exit label fail_adapter that will free dvi_spi. Detected by CoverityScan, CID#1475991 ("Resource Leak") Fixes: cb496cd472af ("media: cxd2880-spi: Add optional vcc regulator") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>? Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: Add optional vcc regulatorNeil Armstrong1-0/+16
This patchset adds an optional VCC regulator to the driver probe function to make sure power is enabled to the module before starting attaching to the device. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: fix probe when dvb_attach failsNeil Armstrong1-0/+1
When dvb_attach fails, probe returns 0, and remove crashes afterwards. This patch sets the return value to -ENODEV when attach fails. Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-05media: cxd2880-spi: Modified how to declare structureYasunari Takiguchi1-5/+3
This is the modification of structure declaration for spi_transfer. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04media: cxd2880-spi: avoid out-of-bounds access warningArnd Bergmann1-17/+7
The -Warray-bounds warning in gcc-8 triggers for a newly added file: drivers/media/spi/cxd2880-spi.c: In function 'cxd2880_write_reg': drivers/media/spi/cxd2880-spi.c:111:3: error: 'memcpy' forming offset [133, 258] is out of the bounds [0, 132] of object 'send_data' with type 'u8[132]' {aka 'unsigned char[132]'} [-Werror=array-bounds] The problem appears to be that we have two range checks in this function, first comparing against BURST_WRITE_MAX (128) and then comparing against a literal '255'. The logic checking the buffer size looks at the second one and decides that this might be the actual maximum data length. This is understandable behavior from the compiler, but the code is actually safe. Since the first check is already shorter, we can remove the loop and only leave that. To be on the safe side in case BURST_WRITE_MAX might be increased, I'm leaving the check against U8_MAX. Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface") Cc: Martin Sebor <msebor@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-03-07media: cxd2880: Add all Makefile, Kconfig files and Update MAINTAINERS file for the driverYasunari Takiguchi2-0/+19
This is the Makefile, Kconfig files of driver and MAINTAINERS file update about the driver for the Sony CXD2880 DVB-T2/T tuner + demodulator. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-07media: cxd2880: Fix location of DVB headersMauro Carvalho Chehab1-3/+3
Fix a trivial conflict, where the location of DVB headers got moved. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-07media: cxd2880-spi: Add support for CXD2880 SPI interfaceYasunari Takiguchi1-0/+670
This is the SPI adapter part of the driver for the Sony CXD2880 DVB-T2/T tuner + demodulator. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24[media] gs1662: drop kfree for memory allocated with devm_kzallocWei Yongjun1-2/+1
It's not necessary to free memory allocated with devm_kzalloc and using kfree leads to a double free. Fixes: 7aae6e2df127 ("[media] Add GS1662 driver, a video serializer") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-24[media] gs1662: remove .owner field for driverWei Yongjun1-1/+0
Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19[media] gs1662: make checkpatch happyMauro Carvalho Chehab1-10/+16
WARNING: line over 80 characters + GS_HEIGHT_MAX, GS_PIXELCLOCK_MIN, GS_PIXELCLOCK_MAX, WARNING: line over 80 characters + if (v4l2_match_dv_timings(timings, &reg_fmt[i].format, 0, false)) WARNING: Block comments use a trailing */ on a separate line + * which looks like a video signal activity.*/ WARNING: else is not generally useful after a break or return + return gs_write_register(gs->pdev, REG_FORCE_FMT, reg_value); + } else { WARNING: Block comments use a trailing */ on a separate line + * which looks like a video signal activity.*/ ERROR: spaces required around that '=' (ctx:VxW) + .enum_dv_timings= gs_enum_dv_timings, ^ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19[media] media Kconfig: improve the spi integrationHans Verkuil1-0/+5
The SPI driver looked a bit lonely in the config menu, and it didn't support the autoselect. Shift things around a bit so it looks more logical. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-19[media] Add GS1662 driver, a video serializerCharles-Antoine Couret3-0/+482
You can read datasheet here: http://www.c-dis.net/media/871/GS1662_Datasheet.pdf It's a component which supports HD and SD CEA or SDI formats to SDI output. It's configured through SPI bus. GS1662 driver is implemented as v4l2 subdev. Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@nexvision.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>