aiu.c (8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17) | aiu.c (2ff4e003e8e105fb65c682c876a5cb0e00f854bf) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2// 3// Copyright (c) 2020 BayLibre, SAS. 4// Author: Jerome Brunet <jbrunet@baylibre.com> 5 6#include <linux/bitfield.h> 7#include <linux/clk.h> 8#include <linux/module.h> --- 204 unchanged lines hidden (view full) --- 213}; 214 215static int aiu_clk_get(struct device *dev) 216{ 217 struct aiu *aiu = dev_get_drvdata(dev); 218 int ret; 219 220 aiu->pclk = devm_clk_get(dev, "pclk"); | 1// SPDX-License-Identifier: GPL-2.0 2// 3// Copyright (c) 2020 BayLibre, SAS. 4// Author: Jerome Brunet <jbrunet@baylibre.com> 5 6#include <linux/bitfield.h> 7#include <linux/clk.h> 8#include <linux/module.h> --- 204 unchanged lines hidden (view full) --- 213}; 214 215static int aiu_clk_get(struct device *dev) 216{ 217 struct aiu *aiu = dev_get_drvdata(dev); 218 int ret; 219 220 aiu->pclk = devm_clk_get(dev, "pclk"); |
221 if (IS_ERR(aiu->pclk)) { 222 if (PTR_ERR(aiu->pclk) != -EPROBE_DEFER) 223 dev_err(dev, "Can't get the aiu pclk\n"); 224 return PTR_ERR(aiu->pclk); 225 } | 221 if (IS_ERR(aiu->pclk)) 222 return dev_err_probe(dev, PTR_ERR(aiu->pclk), "Can't get the aiu pclk\n"); |
226 227 aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); | 223 224 aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); |
228 if (IS_ERR(aiu->spdif_mclk)) { 229 if (PTR_ERR(aiu->spdif_mclk) != -EPROBE_DEFER) 230 dev_err(dev, "Can't get the aiu spdif master clock\n"); 231 return PTR_ERR(aiu->spdif_mclk); 232 } | 225 if (IS_ERR(aiu->spdif_mclk)) 226 return dev_err_probe(dev, PTR_ERR(aiu->spdif_mclk), 227 "Can't get the aiu spdif master clock\n"); |
233 234 ret = aiu_clk_bulk_get(dev, aiu_i2s_ids, ARRAY_SIZE(aiu_i2s_ids), 235 &aiu->i2s); | 228 229 ret = aiu_clk_bulk_get(dev, aiu_i2s_ids, ARRAY_SIZE(aiu_i2s_ids), 230 &aiu->i2s); |
236 if (ret) { 237 if (ret != -EPROBE_DEFER) 238 dev_err(dev, "Can't get the i2s clocks\n"); 239 return ret; 240 } | 231 if (ret) 232 return dev_err_probe(dev, ret, "Can't get the i2s clocks\n"); |
241 242 ret = aiu_clk_bulk_get(dev, aiu_spdif_ids, ARRAY_SIZE(aiu_spdif_ids), 243 &aiu->spdif); | 233 234 ret = aiu_clk_bulk_get(dev, aiu_spdif_ids, ARRAY_SIZE(aiu_spdif_ids), 235 &aiu->spdif); |
244 if (ret) { 245 if (ret != -EPROBE_DEFER) 246 dev_err(dev, "Can't get the spdif clocks\n"); 247 return ret; 248 } | 236 if (ret) 237 return dev_err_probe(dev, ret, "Can't get the spdif clocks\n"); |
249 250 ret = clk_prepare_enable(aiu->pclk); 251 if (ret) { 252 dev_err(dev, "peripheral clock enable failed\n"); 253 return ret; 254 } 255 256 ret = devm_add_action_or_reset(dev, --- 19 unchanged lines hidden (view full) --- 276 277 aiu->platform = device_get_match_data(dev); 278 if (!aiu->platform) 279 return -ENODEV; 280 281 platform_set_drvdata(pdev, aiu); 282 283 ret = device_reset(dev); | 238 239 ret = clk_prepare_enable(aiu->pclk); 240 if (ret) { 241 dev_err(dev, "peripheral clock enable failed\n"); 242 return ret; 243 } 244 245 ret = devm_add_action_or_reset(dev, --- 19 unchanged lines hidden (view full) --- 265 266 aiu->platform = device_get_match_data(dev); 267 if (!aiu->platform) 268 return -ENODEV; 269 270 platform_set_drvdata(pdev, aiu); 271 272 ret = device_reset(dev); |
284 if (ret) { 285 if (ret != -EPROBE_DEFER) 286 dev_err(dev, "Failed to reset device\n"); 287 return ret; 288 } | 273 if (ret) 274 return dev_err_probe(dev, ret, "Failed to reset device\n"); |
289 290 regs = devm_platform_ioremap_resource(pdev, 0); 291 if (IS_ERR(regs)) 292 return PTR_ERR(regs); 293 294 map = devm_regmap_init_mmio(dev, regs, &aiu_regmap_cfg); 295 if (IS_ERR(map)) { 296 dev_err(dev, "failed to init regmap: %ld\n", --- 92 unchanged lines hidden --- | 275 276 regs = devm_platform_ioremap_resource(pdev, 0); 277 if (IS_ERR(regs)) 278 return PTR_ERR(regs); 279 280 map = devm_regmap_init_mmio(dev, regs, &aiu_regmap_cfg); 281 if (IS_ERR(map)) { 282 dev_err(dev, "failed to init regmap: %ld\n", --- 92 unchanged lines hidden --- |