-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Changes to the ADV7180 driver. Added parameters to allow the user to set; input method, pattern sele… #3868
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: rpi-5.4.y
Are you sure you want to change the base?
Conversation
…ct, and free run. Added a generic i2c write parameter to give the user more functionality
@6by9 Setting aside the lack of adherence to coding standards and fact that this is a large change to mostly upstream file, what is your opinion of this PR? |
Sorry, most of this is the wrong way to do things. The Just rereading the 5.9 TI am437x vpfe driver (which parts of Unicam were based on), it does appear to manage to do a mapping from s_input to s_routing. I need to do a bit more digging to see if that is generic enough to be adapted or not. The davinci vpif_capture driver also has a mechanism to call s_routing, so it's one to investigate.
I can only see this being useful as an independent control if there is a valid use for test pattern synchronised to the incoming video. That's a small enough test case that I wouldn't consider it useful. Directly prodding I2C registers from a module parameter is a definite no-no. Implement This is a maintained upstream driver. We have 2 small patches over and above that which I really ought to get around to upstreaming. Certainly adding |
@@ -728,7 +808,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd, | |||
break; | |||
/* fall through */ | |||
default: | |||
format->format.field = V4L2_FIELD_ALTERNATE; | |||
format->format.field = V4L2_FIELD_INTERLACED; |
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 is a partial revert of 6457b62
Why?
The chip produces 2 independent frames rather than line by line interleaved.
https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/field-order.html#c.v4l2_field
@@ -1324,7 +1405,7 @@ static int adv7180_probe(struct i2c_client *client, | |||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | |||
return -EIO; | |||
|
|||
v4l_info(client, "chip found @ 0x%02x (%s)\n", | |||
v4l_info(client, "Init PEL ADV Driver:chip found @ 0x%02x (%s)\n", |
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 need to change the text here.
@@ -1469,7 +1550,8 @@ static int adv7180_resume(struct device *dev) | |||
struct v4l2_subdev *sd = i2c_get_clientdata(client); | |||
struct adv7180_state *state = to_state(sd); | |||
int ret; | |||
|
|||
|
|||
v4l_info(client,"Resuming ADV device"); |
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.
Nor add debug messages here.
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.
Sorry these three were for debug I forgot to revert them. I'm happy for this to not be pulled as I've clearly implemented it incorrectly.
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.
Thanks for trying - it's the way to learn.
It's only though years of watching upstream and working with the APIs that I know the "proper way" to implement these things - they aren't always obvious. Hacks are reserved for where there isn't a "proper way" (eg dbg_input
and I'm now looking to fix that properly).
Where drivers have the potential to be upstreamed, or are upstream drivers in the first place, we do try to keep to the coding standards and play by upstream's rules. It's a bit of a slog to start with, and you'll be swearing at checkpatch
for a while, but it allows others to make use of your work and try upstreaming it without ambiguity.
Thanks, @6by9. |
Starting from here is fine. It's not a driver that gets a huge amount of upstream development effort so the likelihood of conflicts is low, and it's easier to test on these branches compared to mainline. If they're done cleanly then you may persuade me to do battle with upstream on your behalf when I come to do my couple of patches. That's why I need you to have followed the mainline processes so that your contributions can be taken. |
g_register and s_register have just been discussed on the linux-media list for a different driver
My personally view is that as it's hidden behind CONFIG_VIDEO_ADV_DEBUG (which isn't normally defined) it's not really a big deal, but mainline seem to be taking a different view. |
Nothing specifically, it was just to avoid rebuilding the driver if I wanted to tweak a register later on. |
…ct, and free run. Added a generic i2c write parameter to give the user more functionality