-
Notifications
You must be signed in to change notification settings - Fork 19
motorola-nora: enable cameras and flashes #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: msm89x7/6.13
Are you sure you want to change the base?
motorola-nora: enable cameras and flashes #13
Conversation
|
I have converted to draft until todos are considered done. |
|
If some dependency not available in time everything will be down so maybe that is why flash led breaks everything. |
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]>
804965e to
5669ea2
Compare
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]>
5669ea2 to
93b2a18
Compare
|
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8953 have s3
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]>
93b2a18 to
2ef13e9
Compare
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]>
2ef13e9 to
6fb888e
Compare
| if (val != dw9719->model) | ||
| dev_warn(dw9719->dev, | ||
| "Model ID 0x%llx does not match declared model", val); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
| 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
There was a problem hiding this comment.
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…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULLcauses 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 } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { { 0 } } | |
| { } |
| @@ -0,0 +1,110 @@ | |||
| # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | |||
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MODULE_LICENSE("GPL v2"); | |
| MODULE_LICENSE("GPL"); |
There was a problem hiding this comment.
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. | |||
|
|
|||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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. | |||
|
|
|||
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
|
@valpackett Can you please rebase it on the 6.13.6 branch? |
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)
why does addingright, leds v1 doesn't integrate v4l2 yet, that's a todoflash-ledsbreak everything!? (subdevs silently don't get created)