History log of /linux-master/drivers/media/rc/meson-ir-tx.c
Revision Date Author Comments
# 1865913d 25-Oct-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

media: meson-ir-tx: Drop usage of platform_driver_probe()

The benefit of platform_driver_probe() here is only that the probe
function can be discarded after the driver is loaded. For an ARCH=arm
allmodconfig that's 952 bytes, for an allnoconfig + IR_MESON_TX=y it's
only 452 bytes. The downside is that the driver isn't dynamically
bindable and unbindable.

There are considerations to drop platform_driver_probe() as a concept
that isn't relevant any more today. It comes with an added complexity
that makes many users hold it wrong. (E.g. this driver didn't benefit
as much as it could as of v6.6-rc1 as meson_irtx_remove() could have
been marked with __exit.)

The advantages are not that relevant any more today, so convert this
driver to an ordinary platform driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# 9af7c980 25-Oct-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

media: meson-ir-tx: Simplify and improve using dev_err_probe()

With dev_err_probe() the error paths can be implemented in a more
condensed way with the added benefit that the error code is added to the
error messages by name.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# 12be815f 25-Oct-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

media: meson-ir-tx: Convert to use devm_rc_register_device()

With that the remove callback can go away and also setting driver data
becomes superfluous.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# bd8bf77f 26-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

media: meson-ir-tx: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# 82b4737f 10-Mar-2022 Yihao Han <hanyihao@vivo.com>

media: meson-ir-tx: remove superfluous dev_err()

Remove dev_err() messages after platform_get_irq*() failures.
platform_get_irq() already prints an error.

Generated by: scripts/coccinelle/api/platform_get_irq.cocci

Signed-off-by: Yihao Han <hanyihao@vivo.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 201d6616 18-Nov-2021 Sean Young <sean@mess.org>

media: meson-ir-tx: remove incorrect doc comment

Do not use kernel-doc "/**" notation when the comment is not in
kernel-doc format. This fixes a sparse warning.

Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# dccdd92b 20-Aug-2021 jing yangyang <jing.yangyang@zte.com.cn>

media: meson-ir-tx: fix platform_no_drv_owner.cocci warnings

./drivers/media/rc/meson-ir-tx.c:398:3-8: No need to set .owner here. The core will do it.

Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 49be1c78 19-Jul-2021 Viktor Prutyanov <viktor.prutyanov@phystech.edu>

media: rc: introduce Meson IR TX driver

This patch adds the driver for Amlogic Meson IR transmitter.

Some Amlogic SoCs such as A311D and T950D4 have IR transmitter
(also called blaster) controller onboard. It is capable of sending
IR signals with arbitrary carrier frequency and duty cycle.

The driver supports 2 modulation clock sources:
- xtal3 clock (xtal divided by 3)
- 1us clock

Signed-off-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>