aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/max2175.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-10-10media: i2c: Use div64_ul() for u64-by-unsigned-long divideGeert Uytterhoeven1-2/+2
div_u64() does a 64-by-32 division, while the divisor max2175.xtal_freq is unsigned long, thus 64-bit on 64-bit platforms. Hence the proper function to call is div64_ul(). Note that this change does not have any functional impact, as the crystal frequency must be much lower than the 32-bit limit anyway. On 32-bit platforms, the generated code is the same. But at least on arm64, this saves an AND-instruction to truncate xtal_freq to 32-bit. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-08-13media: i2c: Convert to new i2c device probe()Kieran Bingham1-3/+2
The I2C core framework provides a simplified probe framework from commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"). These drivers do not utilise the i2c_device_id table in the probe, so we can easily convert them to utilise the simplified i2c driver registration. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Acked-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-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>
2018-09-12media: i2c: max2175: convert to SPDX identifiersKuninori Morimoto1-9/+1
This patch updates license to use SPDX-License-Identifier instead of verbose license text. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-11media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab1-1/+1
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-06-15media: max2175: fix location of driver's companion documentationMauro Carvalho Chehab1-3/+3
There's a missing ".rst" at the doc's file name. Acked-by: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-02-26media: i2c: max2175: use 64-bit arithmetic instead of 32-bitGustavo A. R. Silva1-1/+1
Add suffix LL to constant 2 in order to give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type s64 (64 bits, signed). The expression 2 * (clock_rate - abs_nco_freq) is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1446589 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: max2175: don't clear V4L2_SUBDEV_FL_IS_I2CAkinobu Mita1-1/+1
The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the subdev->flags. But this driver overwrites subdev->flags immediately after calling v4l2_i2c_subdev_init(). So V4L2_SUBDEV_FL_IS_I2C is not set after all. This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C. Side note: According to the comment in v4l2_device_unregister(), this is problematic only if the device is platform bus device. Device tree or ACPI based devices are not affected. Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-08-27media: max2175: Propagate the real error on devm_clk_get() failureFabio Estevam1-1/+1
When devm_clk_get() fails we should return the real error code instead of always returning -ENODEV. This allows defer probe to happen in the case the clock provider has not been enabled by the time max2175 driver gets probed. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] max2175: remove an useless comparisionMauro Carvalho Chehab1-1/+1
load is an unsigned integer. So, it is always bigger or equal to zero, as reported by gcc: drivers/media/i2c/max2175.c: In function 'max2175_refout_load_to_bits': drivers/media/i2c/max2175.c:1272:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] if (load >= 0 && load <= 40) ^~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] media: i2c: max2175: Add MAX2175 supportRamesh Shanmugasundaram1-0/+1453
This patch adds driver support for the MAX2175 chip. This is Maxim Integrated's RF to Bits tuner front end chip designed for software-defined radio solutions. This driver exposes the tuner as a sub-device instance with standard and custom controls to configure the device. Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>