| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for the ICST307 VCO clock found in the ARM Reference designs. |
|---|
| 3 | 4 | * We wrap the custom interface from <asm/hardware/icst.h> into the generic |
|---|
| 4 | 5 | * clock framework. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (C) 2012-2015 Linus Walleij |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | * |
|---|
| 12 | 9 | * TODO: when all ARM reference designs are migrated to generic clocks, the |
|---|
| 13 | 10 | * ICST clock code from the ARM tree should probably be merged into this |
|---|
| .. | .. |
|---|
| 35 | 32 | #define INTEGRATOR_CP_CM_MEM_BITS 0x7FF000 |
|---|
| 36 | 33 | |
|---|
| 37 | 34 | #define INTEGRATOR_AP_PCI_25_33_MHZ BIT(8) |
|---|
| 38 | | - |
|---|
| 39 | | -/** |
|---|
| 40 | | - * enum icst_control_type - the type of ICST control register |
|---|
| 41 | | - */ |
|---|
| 42 | | -enum icst_control_type { |
|---|
| 43 | | - ICST_VERSATILE, /* The standard type, all control bits available */ |
|---|
| 44 | | - ICST_INTEGRATOR_AP_CM, /* Only 8 bits of VDW available */ |
|---|
| 45 | | - ICST_INTEGRATOR_AP_SYS, /* Only 8 bits of VDW available */ |
|---|
| 46 | | - ICST_INTEGRATOR_AP_PCI, /* Odd bit pattern storage */ |
|---|
| 47 | | - ICST_INTEGRATOR_CP_CM_CORE, /* Only 8 bits of VDW and 3 bits of OD */ |
|---|
| 48 | | - ICST_INTEGRATOR_CP_CM_MEM, /* Only 8 bits of VDW and 3 bits of OD */ |
|---|
| 49 | | -}; |
|---|
| 50 | 35 | |
|---|
| 51 | 36 | /** |
|---|
| 52 | 37 | * struct clk_icst - ICST VCO clock wrapper |
|---|
| .. | .. |
|---|
| 347 | 332 | .set_rate = icst_set_rate, |
|---|
| 348 | 333 | }; |
|---|
| 349 | 334 | |
|---|
| 350 | | -static struct clk *icst_clk_setup(struct device *dev, |
|---|
| 351 | | - const struct clk_icst_desc *desc, |
|---|
| 352 | | - const char *name, |
|---|
| 353 | | - const char *parent_name, |
|---|
| 354 | | - struct regmap *map, |
|---|
| 355 | | - enum icst_control_type ctype) |
|---|
| 335 | +struct clk *icst_clk_setup(struct device *dev, |
|---|
| 336 | + const struct clk_icst_desc *desc, |
|---|
| 337 | + const char *name, |
|---|
| 338 | + const char *parent_name, |
|---|
| 339 | + struct regmap *map, |
|---|
| 340 | + enum icst_control_type ctype) |
|---|
| 356 | 341 | { |
|---|
| 357 | 342 | struct clk *clk; |
|---|
| 358 | 343 | struct clk_icst *icst; |
|---|
| 359 | | - struct clk_init_data init = {}; |
|---|
| 344 | + struct clk_init_data init; |
|---|
| 360 | 345 | struct icst_params *pclone; |
|---|
| 361 | 346 | |
|---|
| 362 | 347 | icst = kzalloc(sizeof(*icst), GFP_KERNEL); |
|---|
| .. | .. |
|---|
| 389 | 374 | |
|---|
| 390 | 375 | return clk; |
|---|
| 391 | 376 | } |
|---|
| 377 | +EXPORT_SYMBOL_GPL(icst_clk_setup); |
|---|
| 392 | 378 | |
|---|
| 393 | 379 | struct clk *icst_clk_register(struct device *dev, |
|---|
| 394 | 380 | const struct clk_icst_desc *desc, |
|---|