Krzysztof Kozlowski | 94047d9 | 2018-08-07 18:17:12 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // |
| 3 | // clk-s2mps11.c - Clock driver for S2MPS11. |
| 4 | // |
| 5 | // Copyright (C) 2013,2014 Samsung Electornics |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 6 | |
| 7 | #include <linux/module.h> |
| 8 | #include <linux/err.h> |
| 9 | #include <linux/of.h> |
| 10 | #include <linux/clkdev.h> |
| 11 | #include <linux/regmap.h> |
| 12 | #include <linux/clk-provider.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/mfd/samsung/s2mps11.h> |
Chanwoo Choi | f928b53 | 2014-11-18 17:59:41 +0900 | [diff] [blame] | 15 | #include <linux/mfd/samsung/s2mps13.h> |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 16 | #include <linux/mfd/samsung/s2mps14.h> |
Tushar Behera | e8e6b84 | 2013-12-26 15:48:59 +0530 | [diff] [blame] | 17 | #include <linux/mfd/samsung/s5m8767.h> |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 18 | #include <linux/mfd/samsung/core.h> |
| 19 | |
Krzysztof Kozlowski | 8748b4a | 2018-08-07 18:17:13 +0200 | [diff] [blame] | 20 | #include <dt-bindings/clock/samsung,s2mps11.h> |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 21 | |
| 22 | struct s2mps11_clk { |
| 23 | struct sec_pmic_dev *iodev; |
Krzysztof Kozlowski | bf416bd | 2014-05-21 13:22:59 +0200 | [diff] [blame] | 24 | struct device_node *clk_np; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 25 | struct clk_hw hw; |
| 26 | struct clk *clk; |
| 27 | struct clk_lookup *lookup; |
| 28 | u32 mask; |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 29 | unsigned int reg; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw) |
| 33 | { |
| 34 | return container_of(hw, struct s2mps11_clk, hw); |
| 35 | } |
| 36 | |
| 37 | static int s2mps11_clk_prepare(struct clk_hw *hw) |
| 38 | { |
| 39 | struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 40 | |
Vaibhav Hiremath | 7764d0c | 2015-07-22 15:04:53 +0530 | [diff] [blame] | 41 | return regmap_update_bits(s2mps11->iodev->regmap_pmic, |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 42 | s2mps11->reg, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 43 | s2mps11->mask, s2mps11->mask); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | static void s2mps11_clk_unprepare(struct clk_hw *hw) |
| 47 | { |
| 48 | struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 49 | |
Vaibhav Hiremath | 7764d0c | 2015-07-22 15:04:53 +0530 | [diff] [blame] | 50 | regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 51 | s2mps11->mask, ~s2mps11->mask); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 52 | } |
| 53 | |
Karol Wrona | 89ed7e6 | 2014-07-01 19:13:59 +0200 | [diff] [blame] | 54 | static int s2mps11_clk_is_prepared(struct clk_hw *hw) |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 55 | { |
Karol Wrona | 89ed7e6 | 2014-07-01 19:13:59 +0200 | [diff] [blame] | 56 | int ret; |
| 57 | u32 val; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 58 | struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw); |
| 59 | |
Karol Wrona | 89ed7e6 | 2014-07-01 19:13:59 +0200 | [diff] [blame] | 60 | ret = regmap_read(s2mps11->iodev->regmap_pmic, |
| 61 | s2mps11->reg, &val); |
| 62 | if (ret < 0) |
| 63 | return -EINVAL; |
| 64 | |
| 65 | return val & s2mps11->mask; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | static unsigned long s2mps11_clk_recalc_rate(struct clk_hw *hw, |
| 69 | unsigned long parent_rate) |
| 70 | { |
Karol Wrona | 89ed7e6 | 2014-07-01 19:13:59 +0200 | [diff] [blame] | 71 | return 32768; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 72 | } |
| 73 | |
Julia Lawall | 56950ff | 2018-10-27 07:47:40 +0200 | [diff] [blame] | 74 | static const struct clk_ops s2mps11_clk_ops = { |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 75 | .prepare = s2mps11_clk_prepare, |
| 76 | .unprepare = s2mps11_clk_unprepare, |
Karol Wrona | 89ed7e6 | 2014-07-01 19:13:59 +0200 | [diff] [blame] | 77 | .is_prepared = s2mps11_clk_is_prepared, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 78 | .recalc_rate = s2mps11_clk_recalc_rate, |
| 79 | }; |
| 80 | |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 81 | /* This s2mps11_clks_init tructure is common to s2mps11, s2mps13 and s2mps14 */ |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 82 | static struct clk_init_data s2mps11_clks_init[S2MPS11_CLKS_NUM] = { |
| 83 | [S2MPS11_CLK_AP] = { |
| 84 | .name = "s2mps11_ap", |
| 85 | .ops = &s2mps11_clk_ops, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 86 | }, |
| 87 | [S2MPS11_CLK_CP] = { |
| 88 | .name = "s2mps11_cp", |
| 89 | .ops = &s2mps11_clk_ops, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 90 | }, |
| 91 | [S2MPS11_CLK_BT] = { |
| 92 | .name = "s2mps11_bt", |
| 93 | .ops = &s2mps11_clk_ops, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 94 | }, |
| 95 | }; |
| 96 | |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 97 | static struct device_node *s2mps11_clk_parse_dt(struct platform_device *pdev, |
| 98 | struct clk_init_data *clks_init) |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 99 | { |
| 100 | struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); |
| 101 | struct device_node *clk_np; |
| 102 | int i; |
| 103 | |
| 104 | if (!iodev->dev->of_node) |
Krzysztof Kozlowski | 238e140 | 2014-03-21 13:18:17 +0100 | [diff] [blame] | 105 | return ERR_PTR(-EINVAL); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 106 | |
Krzysztof Kozlowski | afbd1a0 | 2014-03-21 13:39:20 +0100 | [diff] [blame] | 107 | clk_np = of_get_child_by_name(iodev->dev->of_node, "clocks"); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 108 | if (!clk_np) { |
| 109 | dev_err(&pdev->dev, "could not find clock sub-node\n"); |
| 110 | return ERR_PTR(-EINVAL); |
| 111 | } |
| 112 | |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 113 | for (i = 0; i < S2MPS11_CLKS_NUM; i++) |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 114 | of_property_read_string_index(clk_np, "clock-output-names", i, |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 115 | &clks_init[i].name); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 116 | |
| 117 | return clk_np; |
| 118 | } |
| 119 | |
| 120 | static int s2mps11_clk_probe(struct platform_device *pdev) |
| 121 | { |
| 122 | struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 123 | struct s2mps11_clk *s2mps11_clks; |
Stephen Boyd | b228fad | 2016-06-01 16:15:24 -0700 | [diff] [blame] | 124 | struct clk_hw_onecell_data *clk_data; |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 125 | unsigned int s2mps11_reg; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 126 | int i, ret = 0; |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 127 | enum sec_device_type hwid = platform_get_device_id(pdev)->driver_data; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 128 | |
Vaibhav Hiremath | 7764d0c | 2015-07-22 15:04:53 +0530 | [diff] [blame] | 129 | s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM, |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 130 | sizeof(*s2mps11_clks), GFP_KERNEL); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 131 | if (!s2mps11_clks) |
| 132 | return -ENOMEM; |
| 133 | |
Kees Cook | 0ed2dd0 | 2018-05-08 16:08:53 -0700 | [diff] [blame] | 134 | clk_data = devm_kzalloc(&pdev->dev, |
| 135 | struct_size(clk_data, hws, S2MPS11_CLKS_NUM), |
Stephen Boyd | b228fad | 2016-06-01 16:15:24 -0700 | [diff] [blame] | 136 | GFP_KERNEL); |
Andi Shyti | 36da4de | 2016-01-20 19:14:23 +0900 | [diff] [blame] | 137 | if (!clk_data) |
| 138 | return -ENOMEM; |
| 139 | |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 140 | switch (hwid) { |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 141 | case S2MPS11X: |
| 142 | s2mps11_reg = S2MPS11_REG_RTC_CTRL; |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 143 | break; |
Chanwoo Choi | f928b53 | 2014-11-18 17:59:41 +0900 | [diff] [blame] | 144 | case S2MPS13X: |
| 145 | s2mps11_reg = S2MPS13_REG_RTCCTRL; |
Chanwoo Choi | f928b53 | 2014-11-18 17:59:41 +0900 | [diff] [blame] | 146 | break; |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 147 | case S2MPS14X: |
| 148 | s2mps11_reg = S2MPS14_REG_RTCCTRL; |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 149 | break; |
Tushar Behera | e8e6b84 | 2013-12-26 15:48:59 +0530 | [diff] [blame] | 150 | case S5M8767X: |
| 151 | s2mps11_reg = S5M8767_REG_CTRL1; |
| 152 | break; |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 153 | default: |
| 154 | dev_err(&pdev->dev, "Invalid device type\n"); |
| 155 | return -EINVAL; |
kbuild test robot | 250d07d | 2014-11-26 07:45:12 +0800 | [diff] [blame] | 156 | } |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 157 | |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 158 | /* Store clocks of_node in first element of s2mps11_clks array */ |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 159 | s2mps11_clks->clk_np = s2mps11_clk_parse_dt(pdev, s2mps11_clks_init); |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 160 | if (IS_ERR(s2mps11_clks->clk_np)) |
| 161 | return PTR_ERR(s2mps11_clks->clk_np); |
| 162 | |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 163 | for (i = 0; i < S2MPS11_CLKS_NUM; i++) { |
Andi Shyti | 31ad0e2a | 2016-01-20 19:14:22 +0900 | [diff] [blame] | 164 | if (i == S2MPS11_CLK_CP && hwid == S2MPS14X) |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 165 | continue; /* Skip clocks not present in some devices */ |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 166 | s2mps11_clks[i].iodev = iodev; |
| 167 | s2mps11_clks[i].hw.init = &s2mps11_clks_init[i]; |
| 168 | s2mps11_clks[i].mask = 1 << i; |
| 169 | s2mps11_clks[i].reg = s2mps11_reg; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 170 | |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 171 | s2mps11_clks[i].clk = devm_clk_register(&pdev->dev, |
| 172 | &s2mps11_clks[i].hw); |
| 173 | if (IS_ERR(s2mps11_clks[i].clk)) { |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 174 | dev_err(&pdev->dev, "Fail to register : %s\n", |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 175 | s2mps11_clks_init[i].name); |
| 176 | ret = PTR_ERR(s2mps11_clks[i].clk); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 177 | goto err_reg; |
| 178 | } |
| 179 | |
Stephen Boyd | b228fad | 2016-06-01 16:15:24 -0700 | [diff] [blame] | 180 | s2mps11_clks[i].lookup = clkdev_hw_create(&s2mps11_clks[i].hw, |
Andi Shyti | dedbb27 | 2016-01-20 19:14:24 +0900 | [diff] [blame] | 181 | s2mps11_clks_init[i].name, NULL); |
| 182 | if (!s2mps11_clks[i].lookup) { |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 183 | ret = -ENOMEM; |
Axel Lin | 264e3b7 | 2015-07-16 21:59:43 +0800 | [diff] [blame] | 184 | goto err_reg; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 185 | } |
Stephen Boyd | b228fad | 2016-06-01 16:15:24 -0700 | [diff] [blame] | 186 | clk_data->hws[i] = &s2mps11_clks[i].hw; |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 187 | } |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 188 | |
Stephen Boyd | b228fad | 2016-06-01 16:15:24 -0700 | [diff] [blame] | 189 | clk_data->num = S2MPS11_CLKS_NUM; |
| 190 | of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get, |
| 191 | clk_data); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 192 | |
| 193 | platform_set_drvdata(pdev, s2mps11_clks); |
| 194 | |
| 195 | return ret; |
Axel Lin | 264e3b7 | 2015-07-16 21:59:43 +0800 | [diff] [blame] | 196 | |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 197 | err_reg: |
Axel Lin | 264e3b7 | 2015-07-16 21:59:43 +0800 | [diff] [blame] | 198 | while (--i >= 0) |
| 199 | clkdev_drop(s2mps11_clks[i].lookup); |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 200 | |
| 201 | return ret; |
| 202 | } |
| 203 | |
| 204 | static int s2mps11_clk_remove(struct platform_device *pdev) |
| 205 | { |
| 206 | struct s2mps11_clk *s2mps11_clks = platform_get_drvdata(pdev); |
| 207 | int i; |
| 208 | |
Krzysztof Kozlowski | bf416bd | 2014-05-21 13:22:59 +0200 | [diff] [blame] | 209 | of_clk_del_provider(s2mps11_clks[0].clk_np); |
| 210 | /* Drop the reference obtained in s2mps11_clk_parse_dt */ |
| 211 | of_node_put(s2mps11_clks[0].clk_np); |
| 212 | |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 213 | for (i = 0; i < S2MPS11_CLKS_NUM; i++) { |
| 214 | /* Skip clocks not present on S2MPS14 */ |
| 215 | if (!s2mps11_clks[i].lookup) |
| 216 | continue; |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 217 | clkdev_drop(s2mps11_clks[i].lookup); |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 218 | } |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 219 | |
| 220 | return 0; |
| 221 | } |
| 222 | |
| 223 | static const struct platform_device_id s2mps11_clk_id[] = { |
Tushar Behera | 64d64c3 | 2013-12-26 15:48:58 +0530 | [diff] [blame] | 224 | { "s2mps11-clk", S2MPS11X}, |
Chanwoo Choi | f928b53 | 2014-11-18 17:59:41 +0900 | [diff] [blame] | 225 | { "s2mps13-clk", S2MPS13X}, |
Krzysztof Kozlowski | e8b60a4 | 2014-05-21 13:23:01 +0200 | [diff] [blame] | 226 | { "s2mps14-clk", S2MPS14X}, |
Tushar Behera | e8e6b84 | 2013-12-26 15:48:59 +0530 | [diff] [blame] | 227 | { "s5m8767-clk", S5M8767X}, |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 228 | { }, |
| 229 | }; |
| 230 | MODULE_DEVICE_TABLE(platform, s2mps11_clk_id); |
| 231 | |
Krzysztof Kozlowski | 8985167 | 2018-08-29 21:20:10 +0200 | [diff] [blame] | 232 | #ifdef CONFIG_OF |
| 233 | /* |
| 234 | * Device is instantiated through parent MFD device and device matching is done |
| 235 | * through platform_device_id. |
| 236 | * |
| 237 | * However if device's DT node contains proper clock compatible and driver is |
| 238 | * built as a module, then the *module* matching will be done trough DT aliases. |
| 239 | * This requires of_device_id table. In the same time this will not change the |
| 240 | * actual *device* matching so do not add .of_match_table. |
| 241 | */ |
Nathan Chancellor | 9c940bb | 2018-10-18 12:13:40 -0700 | [diff] [blame] | 242 | static const struct of_device_id s2mps11_dt_match[] __used = { |
Krzysztof Kozlowski | 8985167 | 2018-08-29 21:20:10 +0200 | [diff] [blame] | 243 | { |
| 244 | .compatible = "samsung,s2mps11-clk", |
| 245 | .data = (void *)S2MPS11X, |
| 246 | }, { |
| 247 | .compatible = "samsung,s2mps13-clk", |
| 248 | .data = (void *)S2MPS13X, |
| 249 | }, { |
| 250 | .compatible = "samsung,s2mps14-clk", |
| 251 | .data = (void *)S2MPS14X, |
| 252 | }, { |
| 253 | .compatible = "samsung,s5m8767-clk", |
| 254 | .data = (void *)S5M8767X, |
| 255 | }, { |
| 256 | /* Sentinel */ |
| 257 | }, |
| 258 | }; |
| 259 | MODULE_DEVICE_TABLE(of, s2mps11_dt_match); |
| 260 | #endif |
| 261 | |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 262 | static struct platform_driver s2mps11_clk_driver = { |
| 263 | .driver = { |
| 264 | .name = "s2mps11-clk", |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 265 | }, |
| 266 | .probe = s2mps11_clk_probe, |
| 267 | .remove = s2mps11_clk_remove, |
| 268 | .id_table = s2mps11_clk_id, |
| 269 | }; |
| 270 | |
| 271 | static int __init s2mps11_clk_init(void) |
| 272 | { |
| 273 | return platform_driver_register(&s2mps11_clk_driver); |
| 274 | } |
| 275 | subsys_initcall(s2mps11_clk_init); |
| 276 | |
Vaibhav Hiremath | 7764d0c | 2015-07-22 15:04:53 +0530 | [diff] [blame] | 277 | static void __exit s2mps11_clk_cleanup(void) |
Yadwinder Singh Brar | 7cc560d | 2013-07-07 17:14:20 +0530 | [diff] [blame] | 278 | { |
| 279 | platform_driver_unregister(&s2mps11_clk_driver); |
| 280 | } |
| 281 | module_exit(s2mps11_clk_cleanup); |
| 282 | |
| 283 | MODULE_DESCRIPTION("S2MPS11 Clock Driver"); |
| 284 | MODULE_AUTHOR("Yadwinder Singh Brar <yadi.brar@samsung.com>"); |
| 285 | MODULE_LICENSE("GPL"); |