| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8350-core.c -- Device access for Wolfson WM8350 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2007, 2008 Wolfson Microelectronics PLC. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Liam Girdwood, Mark Brown |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 10 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 11 | | - * option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | |
|---|
| 15 | 10 | #include <linux/kernel.h> |
|---|
| 16 | | -#include <linux/module.h> |
|---|
| 11 | +#include <linux/init.h> |
|---|
| 12 | +#include <linux/export.h> |
|---|
| 17 | 13 | #include <linux/slab.h> |
|---|
| 18 | 14 | #include <linux/bug.h> |
|---|
| 19 | 15 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 135 | 131 | * The WM8350 has a hardware lock which can be used to prevent writes to |
|---|
| 136 | 132 | * some registers (generally those which can cause particularly serious |
|---|
| 137 | 133 | * problems if misused). This function enables that lock. |
|---|
| 134 | + * |
|---|
| 135 | + * @wm8350: pointer to local driver data structure |
|---|
| 138 | 136 | */ |
|---|
| 139 | 137 | int wm8350_reg_lock(struct wm8350 *wm8350) |
|---|
| 140 | 138 | { |
|---|
| .. | .. |
|---|
| 164 | 162 | * problems if misused). This function disables that lock so updates |
|---|
| 165 | 163 | * can be performed. For maximum safety this should be done only when |
|---|
| 166 | 164 | * required. |
|---|
| 165 | + * |
|---|
| 166 | + * @wm8350: pointer to local driver data structure |
|---|
| 167 | 167 | */ |
|---|
| 168 | 168 | int wm8350_reg_unlock(struct wm8350 *wm8350) |
|---|
| 169 | 169 | { |
|---|
| .. | .. |
|---|
| 442 | 442 | return ret; |
|---|
| 443 | 443 | } |
|---|
| 444 | 444 | EXPORT_SYMBOL_GPL(wm8350_device_init); |
|---|
| 445 | | - |
|---|
| 446 | | -void wm8350_device_exit(struct wm8350 *wm8350) |
|---|
| 447 | | -{ |
|---|
| 448 | | - int i; |
|---|
| 449 | | - |
|---|
| 450 | | - for (i = 0; i < ARRAY_SIZE(wm8350->pmic.led); i++) |
|---|
| 451 | | - platform_device_unregister(wm8350->pmic.led[i].pdev); |
|---|
| 452 | | - |
|---|
| 453 | | - for (i = 0; i < ARRAY_SIZE(wm8350->pmic.pdev); i++) |
|---|
| 454 | | - platform_device_unregister(wm8350->pmic.pdev[i]); |
|---|
| 455 | | - |
|---|
| 456 | | - platform_device_unregister(wm8350->wdt.pdev); |
|---|
| 457 | | - platform_device_unregister(wm8350->rtc.pdev); |
|---|
| 458 | | - platform_device_unregister(wm8350->power.pdev); |
|---|
| 459 | | - platform_device_unregister(wm8350->hwmon.pdev); |
|---|
| 460 | | - platform_device_unregister(wm8350->gpio.pdev); |
|---|
| 461 | | - platform_device_unregister(wm8350->codec.pdev); |
|---|
| 462 | | - |
|---|
| 463 | | - if (wm8350->irq_base) |
|---|
| 464 | | - free_irq(wm8350->irq_base + WM8350_IRQ_AUXADC_DATARDY, wm8350); |
|---|
| 465 | | - |
|---|
| 466 | | - wm8350_irq_exit(wm8350); |
|---|
| 467 | | -} |
|---|
| 468 | | -EXPORT_SYMBOL_GPL(wm8350_device_exit); |
|---|
| 469 | | - |
|---|
| 470 | | -MODULE_DESCRIPTION("WM8350 AudioPlus PMIC core driver"); |
|---|
| 471 | | -MODULE_LICENSE("GPL"); |
|---|