-
Notifications
You must be signed in to change notification settings - Fork 845
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
dbed104
to
6e2a7c7
Compare
Initial support... Signed-off-by: Nuno Sa <[email protected]>
Add dt-bindings for the Analog Devices ADF4030 Precision Synchronizer IC. Signed-off-by: Michael Hennerich <[email protected]>
Automatically imply ADF4030. Signed-off-by: Nuno Sa <[email protected]>
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?
return dev_err_probe(&spi->dev, ret, | ||
"Failed to start JESD204 FSM\n"); | ||
|
||
return devm_add_action_or_reset(&spi->dev, adf4030_stop_jesd204, |
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.
We now have devm_jesd204_fsm_start()
|
||
fwnode_property_read_u32(child, "adi,rcm", &st->channels[cnt].rcm); | ||
cnt++; | ||
} |
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.
We should validate the properties that have constrains in the bindings to make sure dt values that we get are sane...
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
dev_err(&st->spi->dev, | ||
"Failed to compute R and N dividers for Fref=%u Hz amd VCO=%u Hz\n", | ||
ref_input_freq_hz, vco_out_freq_hz); | ||
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.
dev_err_probe()
100, 1000); | ||
if (ret) { | ||
dev_err(&st->spi->dev, "PLL calibration failed\n"); | ||
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.
ditto
if (ret) | ||
return ret; | ||
|
||
regmap_read(st->regmap, ADF4030_REG(0x8F), ®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.
missing error handling....
dev_err(&st->spi->dev, "Autoalign failed FSM_BUSY\n"); | ||
return ret; | ||
} | ||
regmap_read(st->regmap, ADF4030_REG(0x90), ®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.
same...
vco_period_in_fs = DIV_U64_ROUND_CLOSEST(vco_period_in_fs, 512); | ||
tdc_offset = div64_s64(delay_in_fs, vco_period_in_fs); | ||
|
||
/* Check regmap_bulk_write() */ |
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.
Does it not work? Otherwise I guess we should remove the comment
.name = "duty_cycle", | ||
.read = adf4030_ext_info_read, | ||
.write = adf4030_ext_info_write, | ||
.shared = false, |
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 to use the proper IIO_ENUMS.... This is the reason for CI failures
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