| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2015 MediaTek Inc. |
|---|
| 3 | 4 | * Author: Andrew-CT Chen <andrew-ct.chen@mediatek.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | |
|---|
| 15 | 7 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 36 | 28 | return 0; |
|---|
| 37 | 29 | } |
|---|
| 38 | 30 | |
|---|
| 39 | | -static int mtk_reg_write(void *context, |
|---|
| 40 | | - unsigned int reg, void *_val, size_t bytes) |
|---|
| 41 | | -{ |
|---|
| 42 | | - struct mtk_efuse_priv *priv = context; |
|---|
| 43 | | - u32 *val = _val; |
|---|
| 44 | | - int i = 0, words = bytes / 4; |
|---|
| 45 | | - |
|---|
| 46 | | - while (words--) |
|---|
| 47 | | - writel(*val++, priv->base + reg + (i++ * 4)); |
|---|
| 48 | | - |
|---|
| 49 | | - return 0; |
|---|
| 50 | | -} |
|---|
| 51 | | - |
|---|
| 52 | 31 | static int mtk_efuse_probe(struct platform_device *pdev) |
|---|
| 53 | 32 | { |
|---|
| 54 | 33 | struct device *dev = &pdev->dev; |
|---|
| .. | .. |
|---|
| 69 | 48 | econfig.stride = 4; |
|---|
| 70 | 49 | econfig.word_size = 4; |
|---|
| 71 | 50 | econfig.reg_read = mtk_reg_read; |
|---|
| 72 | | - econfig.reg_write = mtk_reg_write; |
|---|
| 73 | 51 | econfig.size = resource_size(res); |
|---|
| 74 | 52 | econfig.priv = priv; |
|---|
| 75 | 53 | econfig.dev = dev; |
|---|