| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Core driver for WM8400. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2008 Wolfson Microelectronics PLC. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or |
|---|
| 9 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 10 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 11 | | - * License, or (at your option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | |
|---|
| 15 | | -#include <linux/module.h> |
|---|
| 10 | +#include <linux/init.h> |
|---|
| 16 | 11 | #include <linux/bug.h> |
|---|
| 17 | 12 | #include <linux/err.h> |
|---|
| 18 | 13 | #include <linux/i2c.h> |
|---|
| .. | .. |
|---|
| 34 | 29 | return false; |
|---|
| 35 | 30 | } |
|---|
| 36 | 31 | } |
|---|
| 37 | | - |
|---|
| 38 | | -int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data) |
|---|
| 39 | | -{ |
|---|
| 40 | | - return regmap_bulk_read(wm8400->regmap, reg, data, count); |
|---|
| 41 | | -} |
|---|
| 42 | | -EXPORT_SYMBOL_GPL(wm8400_block_read); |
|---|
| 43 | 32 | |
|---|
| 44 | 33 | static int wm8400_register_codec(struct wm8400 *wm8400) |
|---|
| 45 | 34 | { |
|---|
| .. | .. |
|---|
| 119 | 108 | /** |
|---|
| 120 | 109 | * wm8400_reset_codec_reg_cache - Reset cached codec registers to |
|---|
| 121 | 110 | * their default values. |
|---|
| 111 | + * |
|---|
| 112 | + * @wm8400: pointer to local driver data structure |
|---|
| 122 | 113 | */ |
|---|
| 123 | 114 | void wm8400_reset_codec_reg_cache(struct wm8400 *wm8400) |
|---|
| 124 | 115 | { |
|---|
| .. | .. |
|---|
| 150 | 141 | { "wm8400", 0 }, |
|---|
| 151 | 142 | { } |
|---|
| 152 | 143 | }; |
|---|
| 153 | | -MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id); |
|---|
| 154 | 144 | |
|---|
| 155 | 145 | static struct i2c_driver wm8400_i2c_driver = { |
|---|
| 156 | 146 | .driver = { |
|---|
| .. | .. |
|---|
| 161 | 151 | }; |
|---|
| 162 | 152 | #endif |
|---|
| 163 | 153 | |
|---|
| 164 | | -static int __init wm8400_module_init(void) |
|---|
| 154 | +static int __init wm8400_driver_init(void) |
|---|
| 165 | 155 | { |
|---|
| 166 | 156 | int ret = -ENODEV; |
|---|
| 167 | 157 | |
|---|
| .. | .. |
|---|
| 173 | 163 | |
|---|
| 174 | 164 | return ret; |
|---|
| 175 | 165 | } |
|---|
| 176 | | -subsys_initcall(wm8400_module_init); |
|---|
| 177 | | - |
|---|
| 178 | | -static void __exit wm8400_module_exit(void) |
|---|
| 179 | | -{ |
|---|
| 180 | | -#if IS_ENABLED(CONFIG_I2C) |
|---|
| 181 | | - i2c_del_driver(&wm8400_i2c_driver); |
|---|
| 182 | | -#endif |
|---|
| 183 | | -} |
|---|
| 184 | | -module_exit(wm8400_module_exit); |
|---|
| 185 | | - |
|---|
| 186 | | -MODULE_LICENSE("GPL"); |
|---|
| 187 | | -MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
|---|
| 166 | +subsys_initcall(wm8400_driver_init); |
|---|