uwb: sr100: make clocks optional

We do not need the turn on the clocks for banks,
so do not turn them on if the field is missing from the
dt.

Change-Id: I00ceffb3772b655bc08217759b962b3d1dd4b20d
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1850012
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Ryan Lattrel 2021-01-12 17:03:45 -06:00
parent 319143e147
commit 010660d3d3

View file

@ -965,14 +965,16 @@ static int sr100_probe(struct spi_device* spi) {
sr100_dev->spi_handshake_gpio = platform_data->spi_handshake_gpio;
sr100_dev->rtc_sync_gpio = platform_data->rtc_sync_gpio;
rf_clk2 = devm_clk_get(&spi->dev,"rf_clk2");
if(rf_clk2 != NULL) {
rc = clk_prepare_enable(rf_clk2);
if(rc) {
SR100_ERR_MSG("failed to enable clk\n");
if (of_get_property(spi->dev.of_node, "clocks", NULL)) {
rf_clk2 = devm_clk_get(&spi->dev,"rf_clk2");
if(rf_clk2 != NULL) {
rc = clk_prepare_enable(rf_clk2);
if(rc) {
SR100_ERR_MSG("failed to enable clk\n");
}
} else {
SR100_ERR_MSG("failed to get clk\n");
}
} else {
SR100_ERR_MSG("failed to get clk\n");
}
#if HVH_VDD_ENABLE