Xiaomi MI A1 S5K5E8YX front camera support - #257
Conversation
Samsung S5K5E8YX is a 5MP CMOS image sensor that produces Bayer GRBG frames in RAW10 output format, the maximum supported output resolution is 2592x1944 at 30 frames per second. Signed-off-by: Andrii Cherniavskyi <chernyav.a@gmail.com>
Add device tree bindings documentation for Samsung S5K5E8YX sensor. Signed-off-by: Andrii Cherniavskyi <chernyav.a@gmail.com>
Signed-off-by: Andrii Cherniavskyi <chernyav.a@gmail.com>
Enable Qualcomm CAMSS subsystem device nodes and add its first connected device: s5k5e8yx camera sensor which is tissot's front camera. Signed-off-by: Andrii Cherniavskyi <chernyav.a@gmail.com>
|
Hi @obolon-svitle! The driver should be sent to upstream first. How do you know tissot have s5k5e8yx? |
The postmarketos wiki has figured this out already. And the i2c chip id that one can find in some leaked PDFs roaming in the Internet matches the "i2ctransfer -f -y 4 w2@0x2d 0x0 0x0 r2" output, which is "0x5e 0x80".
Ok. I was somehow under the impression that the tissot dts is not in the upstream, hence its unique sensor driver couldn't be upstreamed. Blunder... |
I mean how do you know it is yx variant.
I dont see why the driver cannot be upstreamed. dt changes are fine at downstream. |
| { CCI_REG8(0x3311), 0xa7 }, | ||
| { CCI_REG8(0x3312), 0x03 }, | ||
| { CCI_REG8(0x3313), 0x01 }, | ||
| { CCI_REG8(0x0000), 0x00 }, |
There was a problem hiding this comment.
This writes CHIP_ID. I don't think this should be a part of reg sequence.
| #define S5K5E8YX_REG_CHIP_ID CCI_REG16(0x0000) | ||
| #define S5K5E8YX_CHIP_ID 0x5e80 | ||
|
|
||
| #define S5K5E8YX_REG_CTRL_MODE CCI_REG8(0x0100) |
There was a problem hiding this comment.
Just for your information many of those mobile s5k* sensors are implementing CCS/SMIA standard. Not properly but you can reuse some register definitions from ccs/ccs-regs.h or ccs/smiapp-reg-defs.h (for documentation too). I've been working on more generic driver for such sensors and got s5k5e8 working on it (but by skipping clock configuration) relatively easy today.
There was a problem hiding this comment.
I've been working on more generic driver for such sensors and got s5k5e8 working on it (but by skipping clock configuration) relatively easy today.
Awesome. I was totally clueless that these sensors have that much in common (at least those existing s5k drivers in the upstream didn't look like this), and only wanted to get my phone camera work...
I'll try to play with mi a1 and your driver as well to see if this PR shall be abandoned right away.
| fmt->width = mode->width; | ||
| fmt->height = mode->height; | ||
| fmt->field = V4L2_FIELD_NONE; | ||
| fmt->colorspace = V4L2_COLORSPACE_SRGB; |
There was a problem hiding this comment.
I think this should be V4L2_COLORSPACE_RAW, isn't it?
| { | ||
| struct s5k5e8yx *s5k5e8yx = to_s5k5e8yx(sd); | ||
|
|
||
| if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE) |
Good question, that's another blunder, it shouldn't have been suffixed. It's a clumsiness due to starting this work on another phone and switching to tissot later on. |
The stuff was tested on my Xiaomi MI A1 with a fresh edge postmarketos. The picture quality seems to be alrightish as for a not tuned sensor.
With LIBCAMERA_SOFTISP_MODE=cpu, FPS with libcamera is far more stable (though not perfect) than with egl debayer. I'd blame freedreno but can't say for sure due to the lack of experience with it.
Below is the output of some typical camera tooling apps used to test the module and dts: