Skip to contentSkip to conversation

Driver for ON Semi AR0521 camera sensor

PATCH Superseded Krzysztof Hałasa 1 participant 1 message Jul 21, 2021

Subsystems (3)

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Krzysztof Hałasa

author maintainer
#0 lore raw

PATCH v3 1/1 Driver for ON Semi AR0521 camera sensor

The driver has been extensively tested in an i.MX6-based system.

---
Changes from v2:
- updated for v5.14 (struct v4l2_subdev_pad_config -> v4l2_subdev_state)
- fixes needed by DTS changes (xclk -> extclk and power regulators)
- now comes with the SOB. Hope nothing bad will happen.
- UTF-8 experiments :-)
- cosmetics
- checkpatch still complains:

WARNING: Unnecessary ftrace-like logging - prefer using ftrace (multiple cases) #238: FILE: drivers/media/i2c/ar0521.c:238:
+ v4l2_dbg(2, debug, &sensor->sd, "%s()\n", __func__);

I'm leaving this as is for consistency with other debugging.

WARNING: Block comments use * on subsequent lines
#271: FILE: drivers/media/i2c/ar0521.c:271:

+               /* 0x300 */ be(4), // vt_pix_clk_div = number of bits / 2
+               /* 0x302 */ be(1), // vt_sys_clk_div
+               /* 0x304 */ be((sensor->pll_pre2 << 8) | sensor->pll_pre),

...
+ /* 0x308 */ be(8), // op_pix_clk_div = 2 * vt_pix_clk_div
+ /* 0x30A */ be(1) // op_sys_clk_div

These aren't block comments :-)

Fire away.

MAINTAINERS +6 -0
index a61f4f3b78a9..f92b56487fc6 100644
@@ -1331,6 +1331,12 @@ S:	Supported
 W:	http://www.aquantia.com
 F:	drivers/net/ethernet/aquantia/atlantic/aq_ptp*
 
+AR0521 ON SEMICONDUCTOR CAMERA SENSOR DRIVER
+M:	Krzysztof Hałasa <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/media/i2c/ar0521.c
+
 ARASAN NAND CONTROLLER DRIVER
 M:	Miquel Raynal <[email protected]>
 M:	Naga Sureshkumar Relli <[email protected]>
drivers/media/i2c/Kconfig +10 -0
index 588f8eb95984..0c41a3c18671 100644
@@ -729,6 +729,16 @@ config VIDEO_APTINA_PLL
 config VIDEO_CCS_PLL
 	tristate
 
+config VIDEO_AR0521
+	tristate "ON Semiconductor AR0521 sensor support"
+	depends on I2C && VIDEO_V4L2
+	help
+	  This is a Video4Linux2 sensor driver for the ON Semiconductor
+	  AR0521 camera.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ar0521.
+
 config VIDEO_HI556
 	tristate "Hynix Hi-556 sensor support"
 	depends on I2C && VIDEO_V4L2
drivers/media/i2c/Makefile +1 -0
index 1168fa6b84ed..3351deeb741b 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_VIDEO_CX25840) += cx25840/
 obj-$(CONFIG_VIDEO_M5MOLS)	+= m5mols/
 
 obj-$(CONFIG_VIDEO_APTINA_PLL) += aptina-pll.o
+obj-$(CONFIG_VIDEO_AR0521) += ar0521.o
 obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o
 obj-$(CONFIG_VIDEO_TDA7432) += tda7432.o
 obj-$(CONFIG_VIDEO_SAA6588) += saa6588.o
drivers/media/i2c/ar0521.c new file +1065 -0

1,065 lines not on this page · raw message

Signature · 5 lines
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa