Skip to content

Conversation

@valpackett
Copy link

@valpackett valpackett commented Feb 3, 2025

s5k3l8 (back) + ov5675 (front), both work.. when camss itself isn't being stupid

apparently alternatives would be s5k4h7 front and s5k4h8 back (that one "for ashelby lite" according to commit messages)

  • xxx: bleh, adding more stuff to a very specific dts, before extracting a common nora+jeter one
  • todo: DW9718S VCM, should be easy
  • why does adding flash-leds break everything!? (subdevs silently don't get created) right, leds v1 doesn't integrate v4l2 yet, that's a todo

@barni2000 barni2000 marked this pull request as draft February 5, 2025 23:17
@barni2000
Copy link
Collaborator

I have converted to draft until todos are considered done.

@barni2000
Copy link
Collaborator

If some dependency not available in time everything will be down so maybe that is why flash led breaks everything.

vldly and others added 5 commits February 9, 2025 19:48
v5:
- add test patterns
- reduce init sequences
- switch to regmap
v6:
- implement link_frequency
Fix NULL pointer check before device_link_del
is called.

Unable to handle kernel NULL pointer dereference at virtual address 000000000000032c
Call trace:
 device_link_put_kref+0xc/0xb8
 device_link_del+0x30/0x48
 vfe_pm_domain_off+0x24/0x38 [qcom_camss]
 vfe_put+0x9c/0xd0 [qcom_camss]
 vfe_set_power+0x48/0x58 [qcom_camss]
 pipeline_pm_power_one+0x154/0x158 [videodev]
 pipeline_pm_power+0x74/0xfc [videodev]
 v4l2_pipeline_pm_use+0x54/0x90 [videodev]
 v4l2_pipeline_pm_put+0x14/0x34 [videodev]
 video_release+0x2c/0x44 [qcom_camss]
 v4l2_release+0xe4/0xec [videodev]

Fixes: eb73fac ("media: qcom: camss: Use common VFE pm_domain_on/pm_domain_off where applicable")
Tested-by: Yassine Oudjana <[email protected]>
Reviewed-by: Bryan O'Donoghue <[email protected]>
Signed-off-by: Barnabás Czémán <[email protected]>
Both rear and front flashes work.

Signed-off-by: Val Packett <[email protected]>
These are common to all devices, make it easy to configure pinctrl for
camera clocks (MCLK) like it is on msm8953.

Signed-off-by: Val Packett <[email protected]>
Add DT bindings for the dw9719 voice coil motor driver, which is getting
devicetree compatibles added along with DW9718S support.

Also mention the binding file in the corresponding MAINTAINERS entry.

Signed-off-by: Val Packett <[email protected]>
@valpackett
Copy link
Author

Added DW9718S VCM, submitted it upstream

The spmi v1 flash driver does not integrate with v4l2 at all currently, we'll need to tackle that before upstreaming it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this is s3 and not l2?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. actually not sure where I got s3 from at all, lol. it should be l2

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8953 have s3

jwrdegoede and others added 5 commits February 17, 2025 16:43
Add support for the DW9761 VCM controller, which is very similar to
the DW9719.

The new support is based on
drivers/external_drivers/camera/drivers/media/i2c/micam/dw9761.c
from the Xiaomi kernel sources for the Mi Pad 2.

The DW9761 support has been tested on a Xiaomi Mi Pad 2 tablet and
DW9719 support has been tested (to avoid regressions) on a Microsoft
Surface Go tablet.

Link: https://github.com/MiCode/Xiaomi_Kernel_OpenSource/
Signed-off-by: Hans de Goede <[email protected]>
Tested-by: André Apitzsch <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Val Packett <[email protected]>
In preparation for adding models with different register sets, start
assigning the model based on the i2c match data.

Signed-off-by: Val Packett <[email protected]>
The DW9718S is a similar part that uses a different register set but
follows the same method of operation otherwise. Add support for it
to the existing dw9719 driver.

Tested on the Moto E5 (motorola-nora) smartphone.

Signed-off-by: Val Packett <[email protected]>
Update the close callback to match other similar drivers like dw9768.

Signed-off-by: Val Packett <[email protected]>
Allow the dw9719 driver to be attached via FDT.

Signed-off-by: Val Packett <[email protected]>
The "jiggle" code was not actually expecting failure, which it should
because that's what actually happens when the device wasn't already woken
up by the regulator power-on (i.e. in the case of a shared regulator).

Also, do actually enter the internal suspend mode on shutdown, to save
power in the case of a shared regulator.

Also, wait a bit longer (2x tOPR) on waking up, 1x is not enough at least
on the DW9718S as found on the motorola-nora smartphone.

Signed-off-by: Val Packett <[email protected]>
The Moto G5 includes front and back camera sensors.

Signed-off-by: Val Packett <[email protected]>
Comment on lines +140 to +142
if (val != dw9719->model)
dev_warn(dw9719->dev,
"Model ID 0x%llx does not match declared model", val);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? Shouldn't the following switch handle this?

BTW val will probably never match dw9719->model, because val is one of {DW9719_ID, DW9761_ID} and dw9719->model is an enum entry mapped to an integer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's just "to be helpful"; and yes, I've realized that when you messaged me on matrix :D

* Jiggle the SCL pin to wake up the device (even when the regulator
* is shared) and wait double the time to be sure, then retry the write.
*/
cci_write(dw9719->regmap, reg_pwr, DW9719_STANDBY, &ret);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't care about the return value, no need to set it.

Suggested change
cci_write(dw9719->regmap, reg_pwr, DW9719_STANDBY, &ret);
cci_write(dw9719->regmap, reg_pwr, DW9719_STANDBY, NULL);

The following comment can then be moved before this cci_write() line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL causes an error message to be printed in case of a failure. In this case we're fully expecting failure, so no need to bother/scare the users :)

(I thought the comments would make this obvious enough…)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL causes an error message to be printed in case of a failure.

Didn't know that.

{ .compatible = "dongwoon,dw9718s", .data = (const void*)DW9718S },
{ .compatible = "dongwoon,dw9719", .data = (const void*)DW9719 },
{ .compatible = "dongwoon,dw9761", .data = (const void*)DW9761 },
{ { 0 } }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ { 0 } }
{ }

@@ -0,0 +1,110 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPL-2.0 should be replaced by GPL-2.0-only (or GPL-2.0-or-later)

@@ -0,0 +1,1468 @@
// SPDX-License-Identifier: GPL-2.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPL-2.0 should be replaced by GPL-2.0-only

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be modified in the source repo (msm8953-mainline/linux)

module_i2c_driver(s5k2xx_i2c_driver);

MODULE_DESCRIPTION("Samsung S5K2xx sensor driver");
MODULE_LICENSE("GPL v2");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MODULE_LICENSE("GPL v2");
MODULE_LICENSE("GPL");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same it should be modified in the source repo.

@@ -0,0 +1,1468 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2019 Intel Corporation.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For upstream the driver should probably be converted to CCI register access helpers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly it will be not upstreamed, there is a chance it will be replaced with ccs in the future.

};

&cci {
pinctrl-names = "default";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pinctrl-names comes after pinctrls-0

@@ -0,0 +1,1468 @@
// SPDX-License-Identifier: GPL-2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be modified in the source repo (msm8953-mainline/linux)

@@ -0,0 +1,1468 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2019 Intel Corporation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly it will be not upstreamed, there is a chance it will be replaced with ccs in the future.

module_i2c_driver(s5k2xx_i2c_driver);

MODULE_DESCRIPTION("Samsung S5K2xx sensor driver");
MODULE_LICENSE("GPL v2");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same it should be modified in the source repo.

@barni2000
Copy link
Collaborator

@valpackett Can you please rebase it on the 6.13.6 branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants