summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/adv748x
Commit message (Collapse)AuthorAgeFilesLines
* media: i2c: adv748x: Fix pixel rate valuesLaurent Pinchart2018-05-252-13/+7
| | | | | | | | | | | | | | | | | | | | | | The pixel rate, as reported by the V4L2_CID_PIXEL_RATE control, must include both horizontal and vertical blanking. Both the AFE and HDMI receiver program it incorrectly: - The HDMI receiver goes to the trouble of removing blanking to compute the rate of active pixels. This is easy to fix by removing the computation and returning the incoming pixel clock rate directly. - The AFE performs similar calculation, while it should simply return the fixed pixel rate for analog sources, mandated by the ADV748x to be 14.3180180 MHz. [Niklas: Update AFE fixed pixel rate] Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: adv748x: afe: fix sparse warningNiklas Söderlund2018-04-051-1/+2
| | | | | | | | | | | | This fixes the following sparse warning: drivers/media/i2c/adv748x/adv748x-afe.c:294:34: expected unsigned int [usertype] *signal drivers/media/i2c/adv748x/adv748x-afe.c:294:34: got int *<noident> drivers/media/i2c/adv748x/adv748x-afe.c:294:34: warning: incorrect type in argument 2 (different signedness) Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Add support for i2c_new_secondary_deviceKieran Bingham2018-03-212-55/+36
| | | | | | | | | | | | | | | The ADV748x has twelve 256-byte maps that can be accessed via the main I2C ports. Each map has it own I2C address and acts as a standard slave device on the I2C bus. Allow a device tree node to override the default addresses so that address conflicts with other devices on the same bus may be resolved at the board description level. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Add missing CBUS pageKieran Bingham2018-03-212-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | The ADV748x has 12 pages mapped onto I2C addresses. In the existing implementation only 11 are mapped correctly in the page enumerations, which causes an off-by-one fault on pages above the infoframe definition due to a missing 'CBUS' page. This causes the address for the CEC, SDP, TXA, and TXB to be incorrectly programmed during the iterations in adv748x_initialise_clients(). Until now this has gone un-noticed due to the fact that following the creation of the clients - the device is reset and the addresses are reprogrammed in manually by the call to "adv748x_write_regs(state, adv748x_set_slave_address);" As part of moving to dynamic i2c address allocations repair this by providing the missing CBUS page definition. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Simplify regmap configurationKieran Bingham2018-03-211-89/+20
| | | | | | | | | | | | | The ADV748x has identical map configurations for each register map. The duplication of each map can be simplified using a helper macro such that each map is represented on a single line. Define ADV748X_REGMAP_CONF for this purpose use it to create the tables. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Fix cleanup jump on chip identificationKieran Bingham2018-02-261-1/+1
| | | | | | | | | | | | | | | | The error handling for the adv748x_identify_chip() call erroneously jumps to the err_cleanup_clients label before the clients have been established. Correct this by jumping to the next (and correct) label in the cleanup code: err_cleanup_dt. Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: fix HDMI field heightsKieran Bingham2018-02-261-0/+3
| | | | | | | | | | | | | | | | | | | The ADV748x handles interlaced media using V4L2_FIELD_ALTERNATE field types. The correct specification for the height on the mbus is the image height, in this instance, the field height. The AFE component already correctly adjusts the height on the mbus, but the HDMI component got left behind. Adjust the mbus height to correctly describe the image height of the fields when processing interlaced video for HDMI pipelines. Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Restore full DT paths in kernel messagesGeert Uytterhoeven2017-12-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | As of_node_full_name() now returns only the basename, the endpoint information printed became useless: adv748x 4-0070: Endpoint endpoint on port 7 adv748x 4-0070: Endpoint endpoint on port 8 adv748x 4-0070: Endpoint endpoint on port 10 adv748x 4-0070: Endpoint endpoint on port 11 Restore the old behavior by using "%pOF" instead: adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@7/endpoint on port 7 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@8/endpoint on port 8 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@10/endpoint on port 10 adv748x 4-0070: Endpoint /soc/i2c@e66d8000/video-receiver@70/port@11/endpoint on port 11 Fixes: a7e4cfb0a7ca4773 ("of/fdt: only store the device node basename in full_name") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Remove duplicate NULL checkAndy Shevchenko2017-12-081-4/+2
| | | | | | | | | | Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: Store the pixel rate ctrl on CSI objectsKieran Bingham2017-12-083-6/+9
| | | | | | | | | | | | | | | | The current implementation has to search the list of controls for the pixel rate control, each time it is set. This can be optimised easily by storing the ctrl pointer in the CSI/TX object, and referencing that directly. While at it, fix up a missing blank line also highlighted in review comments. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: i2c: adv748x: Map v4l2_std_id to the internal reg valueSimon Yuan2017-10-041-1/+6
| | | | | | | | | | | | | | The video standard was not mapped to the corresponding value of the internal video standard in adv748x_afe_querystd, causing the wrong video standard to be selected. Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") [Kieran: Obtain the std from the afe->curr_norm] Signed-off-by: Simon Yuan <simon.yuan@navico.com> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* media: i2c: adv748x: Export I2C device table entries as module aliasesJavier Martinez Canillas2017-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The I2C core always reports a MODALIAS of the form i2c:<foo> even if the device was registered via OF, and the driver is only exporting the OF ID table entries as module aliases. So if the driver is built as module, autoload won't work since udev/kmod won't be able to match the registered OF device with its driver module. Before this patch: $ modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias alias: of:N*T*Cadi,adv7482C* alias: of:N*T*Cadi,adv7482 alias: of:N*T*Cadi,adv7481C* alias: of:N*T*Cadi,adv7481 After this patch: modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias alias: of:N*T*Cadi,adv7482C* alias: of:N*T*Cadi,adv7482 alias: of:N*T*Cadi,adv7481C* alias: of:N*T*Cadi,adv7481 alias: i2c:adv7482 alias: i2c:adv7481 Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: adv748x: get rid of unused varMauro Carvalho Chehab2017-07-191-3/+2
| | | | | | | | | drivers/media/i2c/adv748x/adv748x-csi2.c: In function 'adv748x_csi2_init_controls': drivers/media/i2c/adv748x/adv748x-csi2.c:251:20: warning: variable 'ctrl' set but not used [-Wunused-but-set-variable] struct v4l2_ctrl *ctrl; ^~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: i2c: adv748x: add adv748x driverKieran Bingham2017-07-196-0/+2911
Provide support for the ADV7481 and ADV7482. The driver is modelled with 4 subdevices to allow simultaneous streaming from the AFE (Analog front end) and HDMI inputs though two CSI TX entities. The HDMI entity is linked to the TXA CSI bus, whilst the AFE is linked to the TXB CSI bus. The driver is based on a prototype by Koji Matsuoka in the Renesas BSP, and an earlier rework by Niklas Söderlund. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
OpenPOWER on IntegriCloud