-
Notifications
You must be signed in to change notification settings - Fork 853
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
Staging/adf4030 support #2651
base: main
Are you sure you want to change the base?
Staging/adf4030 support #2651
Conversation
0d2c2cd
to
dbed104
Compare
|
||
adi,extended-name: | ||
description: Extended name for the channel. | ||
$ref: /schemas/types.yaml#/definitions/string |
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 one is questionable..
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.
Well it's handy, and avoids possible mix up.
properties: | ||
reg: | ||
description: Channel number. | ||
$ref: /schemas/types.yaml#/definitions/uint32 |
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 needs some constrains. I guess some of the other properties also need 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.
ACK
|
||
adi,rcm: | ||
description: RCM value for the channel. | ||
$ref: /schemas/types.yaml#/definitions/uint32 |
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.
A lot of these properties need a better description. Right now, the description is more or less the same what one can infer from the name.
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.
You will always need the datasheet to properly set those and the naming follows the datasheet.
But I agree some more text doesn't harm. Will fix.
description: Number of iterations for auto alignment. | ||
|
||
adi,bsync-autoalign-threshold-fs: | ||
description: Threshold for auto alignment in femtoseconds. |
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.
I dunno the three above properties pass the binding check. They have no standard suffix and we're not defining a type for them.
Not sure why it does not fail in the check
.shared = true, | ||
.private = BSYNC_ALIGN_ITER, | ||
}, | ||
{}, |
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.
The above four (at least) need an ABI doc. But I guess we can do it when upstreaming...
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.
ABI documentation sysfs-bus-iio-frequency-adf4030
Yeah - the wiki page already has a link for it ...
https://wiki.analog.com/resources/tools-software/linux-drivers/iio-synchronizer/adf4030
6e2a7c7
to
ea7284a
Compare
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.
Looks mostly good to me...
Is there any strong reason to merge this right now or can we wait till we upstream this driver?
drivers/iio/frequency/adf4030.c
Outdated
st->clk_out_names, | ||
ARRAY_SIZE(st->clk_out_names)); | ||
if (ret < 0) | ||
return 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.
This is still treating it as mandatory because we error out in case the property is not there. I guess we could do it in the same way as here:
https://elixir.bootlin.com/linux/v6.13-rc3/source/drivers/iio/frequency/adf4350.c#L467
fe0fb1f
to
9b23d38
Compare
Initial support... Signed-off-by: Nuno Sa <nuno.sa@analog.com>
9b23d38
to
b0db36f
Compare
Pushed a new version which addresses the last review feedback |
Would be good to merge this now... |
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.
Minor comments that can be addressed later
/* | ||
* Driver for ADF4030 10-Channel Precision Synchronizer IC. | ||
* | ||
* Copyright 2024 Analog Devices Inc. |
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.
nit: 2025 by now :)
} | ||
|
||
static const struct spi_device_id adf4030_id[] = { | ||
{"adf4030", 4030}, |
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.
4030? It seems we should drop that
st->iio_channels[i].indexed = 1; | ||
st->iio_channels[i].channel = chan->num; | ||
st->iio_channels[i].address = i; | ||
st->iio_channels[i].extend_name = chan->extended_name; |
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.
extend_name should not be used in new devices. IIO will still make use of labels but that's only for backward compatibility. Can be fixed when upstreaming (though I still think that the devicetree property is questionable).
&st->channels[cnt].delay); | ||
|
||
fwnode_property_read_string(child, "adi,extended-name", | ||
&st->channels[cnt].extended_name); |
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.
adc have a 'label' property to accomplish the same as the above. It should also be acceptable to have the same for 'frequency' devices. I can take care of this afterwards...
Add dt-bindings for the Analog Devices ADF4030 Precision Synchronizer IC. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Automatically imply ADF4030. Signed-off-by: Nuno Sa <nuno.sa@analog.com>
b0db36f
to
55273ec
Compare
Last push (not sure which version we're in this 😅) should fix the bindings validation job |
PR Description
New Linux IIO driver for Analog Devices ADF4030 10-Channel Precision Synchronizer IC.
The ADF4030 provides for 10 bidirectional synchronized clock (BSYNC) channels and
accepts a reference clock input (REFIN) signal as a frequency reference for
generating an output clock on any BSYNC channels that are configured as an output.
The hallmark feature of the ADF4030 is the ability to time align the clock edges
of any one or more BSYNC channels to <5 ps (at the device pins) with respect to
the BSYNC channel selected as the reference BSYNC channel.
https://www.analog.com/en/products/adf4030.html
PR Type
PR Checklist