Re: [PATCH v6 4/5] clk: RK808: Add clkout driver for RK808

From: Heiko Stübner
Date: Wed Aug 27 2014 - 14:31:16 EST


Am Mittwoch, 27. August 2014, 12:22:01 schrieb Ben Dooks:
> >> diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
> >> new file mode 100644
> >> index 0000000..21f8b54
> >> --- /dev/null
> >> +++ b/drivers/clk/clk-rk808.c
> >> @@ -0,0 +1,163 @@
> >> +/*
> >> + * Clkout driver for Rockchip RK808
> >> + *
> >> + * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
> >> + *
> >> + * Author: Chris Zhong <zyw@xxxxxxxxxxxxxx>
> >
> > I probably would have removed "Author" here (like in other patches)
> > since it's below in MODULE_AUTHOR. ...but I'm not a huge stickler for
> > it.
> >
> >> + *
> >> + * This program is free software; you can redistribute it and/or modify
> >> it
> >> + * under the terms and conditions of the GNU General Public License,
> >> + * version 2, as published by the Free Software Foundation.
> >> + *
> >> + * This program is distributed in the hope it will be useful, but
> >> WITHOUT
> >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
> >> for + * more details.
> >> + */
> >> +
> >> +#include <linux/clk.h>
> >> +#include <linux/clk-provider.h>
> >> +#include <linux/module.h>
> >> +#include <linux/slab.h>
> >> +#include <linux/platform_device.h>
> >> +#include <linux/mfd/rk808.h>
> >> +#include <linux/i2c.h>
> >> +
> >> +struct rk808_clkout {
> >> + struct rk808 *rk808;
> >> + struct clk_onecell_data clk_data;
> >> + struct clk_hw clkout1_hw;
> >> + struct clk_hw clkout2_hw;
> >> +};
> >> +
> >> +static unsigned long rk808_clkout_recalc_rate(struct clk_hw *hw,
> >> + unsigned long parent_rate)
> >> +{
> >> + return 32768;
> >> +}
> >> +
>
> Given one of these is a fixed, ungatable clock then surely it would
> be easier to use a separate fixed clock node for that and then just
> have a none for the gated clock?

Hmm, with the devicetree being supposed to describe the hardware, I guess this
is debatable. As both clocks are provided by the rk808 chip, I guess the clock
references for both also should point there and not some arbitary fixed clock
somewhere else in the dt?

But this view could also be to pendantic :-) .

Maybe the dt maintainers can shed some light on this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/