diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-05 13:33:09 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-05 13:33:09 +0200 |
commit | cdfca5dccb21258eccd549604a8481020d5f3e9f (patch) | |
tree | 504faa1faa36ba0bc189cb5d9e1beda924dead56 /include | |
parent | 845f765b6e7f5830b14c7910203d271c43e6af6a (diff) | |
parent | 903b1d430904588ef9f6b2f897b46e3e3cc4516a (diff) | |
download | barebox-cdfca5dccb21258eccd549604a8481020d5f3e9f.tar.gz barebox-cdfca5dccb21258eccd549604a8481020d5f3e9f.tar.xz |
Merge branch 'for-next/rockchip'
Diffstat (limited to 'include')
-rw-r--r-- | include/dt-bindings/pinctrl/rockchip.h | 32 | ||||
-rw-r--r-- | include/linux/clk.h | 9 | ||||
-rw-r--r-- | include/mfd/act8846.h | 56 |
3 files changed, 95 insertions, 2 deletions
diff --git a/include/dt-bindings/pinctrl/rockchip.h b/include/dt-bindings/pinctrl/rockchip.h new file mode 100644 index 0000000000..cd5788be82 --- /dev/null +++ b/include/dt-bindings/pinctrl/rockchip.h @@ -0,0 +1,32 @@ +/* + * Header providing constants for Rockchip pinctrl bindings. + * + * Copyright (c) 2013 MundoReader S.L. + * Author: Heiko Stuebner <heiko@sntech.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that 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. + */ + +#ifndef __DT_BINDINGS_ROCKCHIP_PINCTRL_H__ +#define __DT_BINDINGS_ROCKCHIP_PINCTRL_H__ + +#define RK_GPIO0 0 +#define RK_GPIO1 1 +#define RK_GPIO2 2 +#define RK_GPIO3 3 +#define RK_GPIO4 4 +#define RK_GPIO6 6 + +#define RK_FUNC_GPIO 0 +#define RK_FUNC_1 1 +#define RK_FUNC_2 2 + +#endif diff --git a/include/linux/clk.h b/include/linux/clk.h index 07b27cf148..49cb5a272b 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -199,6 +199,9 @@ static inline int clk_set_rate(struct clk *clk, unsigned long rate) #define CLK_SET_RATE_PARENT (1 << 0) /* propagate rate change up one level */ +#define CLK_GATE_INVERTED (1 << 0) +#define CLK_GATE_HIWORD_MASK (1 << 1) + struct clk_ops { int (*enable)(struct clk *clk); void (*disable)(struct clk *clk); @@ -267,10 +270,11 @@ struct clk *clk_mux(const char *name, void __iomem *reg, unsigned flags); struct clk *clk_gate_alloc(const char *name, const char *parent, - void __iomem *reg, u8 shift, unsigned flags); + void __iomem *reg, u8 shift, unsigned flags, + u8 clk_gate_flags); void clk_gate_free(struct clk *clk_gate); struct clk *clk_gate(const char *name, const char *parent, void __iomem *reg, - u8 shift, unsigned flags); + u8 shift, unsigned flags, u8 clk_gate_flags); struct clk *clk_gate_inverted(const char *name, const char *parent, void __iomem *reg, u8 shift, unsigned flags); int clk_is_enabled(struct clk *clk); @@ -316,6 +320,7 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, void *data); struct clk *of_clk_get(struct device_node *np, int index); struct clk *of_clk_get_by_name(struct device_node *np, const char *name); struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec); +char *of_clk_get_parent_name(struct device_node *np, unsigned int index); int of_clk_init(struct device_node *root, const struct of_device_id *matches); #else static inline struct clk *of_clk_get(struct device_node *np, int index) diff --git a/include/mfd/act8846.h b/include/mfd/act8846.h new file mode 100644 index 0000000000..011fe20030 --- /dev/null +++ b/include/mfd/act8846.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2009 Marc Kleine-Budde <mkl@pengutronix.de> + * + * This file is released under the GPLv2 + * + * Derived from mc9sdz60.h + */ + +#ifndef _ACT8846_H +#define _ACT8846_H + +enum act8846_reg { + ACT8846_SYS_MODE = 0x00, + ACT8846_SYS_CTRL = 0x01, + ACT8846_DCDC1_VSET1 = 0x10, + ACT8846_DCDC1_CTRL = 0x12, + ACT8846_DCDC2_VSET1 = 0x20, + ACT8846_DCDC2_VSET2 = 0x21, + ACT8846_DCDC2_CTRL = 0x22, + ACT8846_DCDC3_VSET1 = 0x30, + ACT8846_DCDC3_VSET2 = 0x31, + ACT8846_DCDC3_CTRL = 0x32, + ACT8846_DCDC4_VSET1 = 0x40, + ACT8846_DCDC4_VSET2 = 0x41, + ACT8846_DCDC4_CTRL = 0x42, + ACT8846_LDO5_VSET = 0x50, + ACT8846_LDO5_CTRL = 0x51, + ACT8846_LDO6_VSET = 0x58, + ACT8846_LDO6_CTRL = 0x59, + ACT8846_LDO7_VSET = 0x60, + ACT8846_LDO7_CTRL = 0x61, + ACT8846_LDO8_VSET = 0x68, + ACT8846_LDO8_CTRL = 0x69, + ACT8846_LDO9_VSET = 0x70, + ACT8846_LDO9_CTRL = 0x71, + ACT8846_LDO10_VSET = 0x80, + ACT8846_LDO10_CTRL = 0x81, + ACT8846_LDO11_VSET = 0x90, + ACT8846_LDO11_CTRL = 0x91, + ACT8846_LDO12_VSET = 0xA0, + ACT8846_LDO12_CTRL = 0xA1, +}; + +struct act8846 { + struct cdev cdev; + struct i2c_client *client; +}; + +struct act8846 *act8846_get(void); + +int act8846_reg_read(struct act8846 *priv, enum act8846_reg reg, u8 *val); +int act8846_reg_write(struct act8846 *priv, enum act8846_reg reg, u8 val); +int act8846_set_bits(struct act8846 *priv, enum act8846_reg reg, + u8 mask, u8 val); + +#endif /* _ACT8846_H */ |