-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.h
59 lines (48 loc) · 1.47 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Device probe and register.
*
* Copyright (c) 2017-2020, Silicon Laboratories, Inc.
* Copyright (c) 2010, ST-Ericsson
* Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
* Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
*/
#ifndef WFX_MAIN_H
#define WFX_MAIN_H
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include "hif_api_general.h"
#if (KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE)
static inline int devm_add_action_or_reset(struct device *dev,
void (*action)(void *), void *data)
{
int ret;
ret = devm_add_action(dev, action, data);
if (ret)
action(data);
return ret;
}
#endif
struct wfx_dev;
struct wfx_hwbus_ops;
struct wfx_platform_data {
/* Keyset and ".sec" extension will be appended to this string */
const char *file_fw;
const char *file_pds;
struct gpio_desc *gpio_wakeup;
bool reset_inverted;
/* if true HIF D_out is sampled on the rising edge of the clock (intended to be used in
* 50Mhz SDIO)
*/
bool use_rising_clk;
#ifdef CONFIG_WFX_SECURE_LINK
u8 slk_key[API_KEY_VALUE_SIZE];
#endif
};
struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_data *pdata,
const struct wfx_hwbus_ops *hwbus_ops, void *hwbus_priv);
int wfx_probe(struct wfx_dev *wdev);
void wfx_release(struct wfx_dev *wdev);
bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor);
int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len);
#endif