Skip to content

Commit a6e11bb

Browse files
zonquebebarino
authored andcommitted
clk: cs2000-cp: Make aux output function controllable
The aux output pin can be configured to output either of the two clock inputs, the generated clock or the pll lock status. Allow access to this feature through a new optional device-tree property. Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20220125093336.226787-6-daniel@zonque.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 519ba32 commit a6e11bb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/clk/clk-cs2000-cp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
/* DEVICE_CFG1 */
4040
#define RSEL(x) (((x) & 0x3) << 3)
4141
#define RSEL_MASK RSEL(0x3)
42+
#define AUXOUTSRC(x) (((x) & 0x3) << 1)
43+
#define AUXOUTSRC_MASK AUXOUTSRC(0x3)
4244
#define ENDEV1 (0x1)
4345

4446
/* DEVICE_CFG2 */
@@ -421,12 +423,19 @@ static int cs2000_clk_register(struct cs2000_priv *priv)
421423
struct clk_init_data init;
422424
const char *name = np->name;
423425
static const char *parent_names[CLK_MAX];
426+
u32 aux_out = 0;
424427
int ch = 0; /* it uses ch0 only at this point */
425428
int rate;
426429
int ret;
427430

428431
of_property_read_string(np, "clock-output-names", &name);
429432

433+
of_property_read_u32(np, "cirrus,aux-output-source", &aux_out);
434+
ret = cs2000_bset(priv, DEVICE_CFG1,
435+
AUXOUTSRC_MASK, AUXOUTSRC(aux_out));
436+
if (ret < 0)
437+
return ret;
438+
430439
/*
431440
* set default rate as 1/1.
432441
* otherwise .set_rate which setup ratio

0 commit comments

Comments
 (0)