Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / linux / ssbi.h
blob61007afba0cc806051737180ef07d9cc8f898974
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2010 Google, Inc.
3 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
4 * Author: Dima Zavin <dima@android.com>
5 */
7 #ifndef _LINUX_SSBI_H
8 #define _LINUX_SSBI_H
10 #include <linux/types.h>
12 int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len);
13 int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
15 static inline int
16 ssbi_reg_read(void *context, unsigned int reg, unsigned int *val)
18 int ret;
19 u8 v;
21 ret = ssbi_read(context, reg, &v, 1);
22 if (!ret)
23 *val = v;
25 return ret;
28 static inline int
29 ssbi_reg_write(void *context, unsigned int reg, unsigned int val)
31 u8 v = val;
32 return ssbi_write(context, reg, &v, 1);
35 #endif