-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BACKPORT: ipts: Cleanup public headers to pass checkpatch
Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io> (cherry-picked from commit 1fb6e17)
- Loading branch information
1 parent
79d32d1
commit 47b71b6
Showing
4 changed files
with
146 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
#ifndef _INTEL_IPTS_COMPANION_H_ | ||
#define _INTEL_IPTS_COMPANION_H_ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* | ||
* Intel Precise Touch & Stylus | ||
* Copyright (c) 2016 Intel Corporation | ||
* Copyright (c) 2019 Dorian Stoll | ||
* | ||
*/ | ||
|
||
#ifndef IPTS_COMPANION_H | ||
#define IPTS_COMPANION_H | ||
|
||
#include <linux/firmware.h> | ||
#include <linux/ipts-binary.h> | ||
|
||
typedef struct ipts_companion ipts_companion_t; | ||
|
||
typedef int (*ipts_fw_handler_t)(ipts_companion_t *, const struct firmware **, | ||
const char *, struct device *); | ||
|
||
struct ipts_companion { | ||
ipts_fw_handler_t firmware_request; | ||
ipts_bin_fw_info_t **firmware_config; | ||
int (*firmware_request)(struct ipts_companion *companion, | ||
const struct firmware **fw, | ||
const char *name, struct device *device); | ||
|
||
struct ipts_bin_fw_info **firmware_config; | ||
void *data; | ||
const char *name; | ||
}; | ||
|
||
int ipts_add_companion(ipts_companion_t *companion); | ||
int ipts_remove_companion(ipts_companion_t *companion); | ||
int ipts_add_companion(struct ipts_companion *companion); | ||
int ipts_remove_companion(struct ipts_companion *companion); | ||
|
||
#endif // _INTEL_IPTS_COMPANION_H_ | ||
#endif // IPTS_COMPANION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,86 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* | ||
* GFX interface to support Intel Precise Touch & Stylus | ||
* Copyright (c) 2016 Intel Corporation. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* Intel Precise Touch & Stylus | ||
* Copyright (c) 2016 Intel Corporation | ||
* | ||
*/ | ||
|
||
#ifndef _INTEL_IPTS_GFX_H_ | ||
#define _INTEL_IPTS_GFX_H_ | ||
#ifndef IPTS_GFX_H | ||
#define IPTS_GFX_H | ||
|
||
enum { | ||
IPTS_INTERFACE_V1 = 1, | ||
}; | ||
|
||
#define IPTS_BUF_FLAG_CONTIGUOUS 0x01 | ||
#define IPTS_BUF_FLAG_CONTIGUOUS 0x01 | ||
|
||
#define IPTS_NOTIFY_STA_BACKLIGHT_OFF 0x00 | ||
#define IPTS_NOTIFY_STA_BACKLIGHT_ON 0x01 | ||
#define IPTS_NOTIFY_STA_BACKLIGHT_OFF 0x00 | ||
#define IPTS_NOTIFY_STA_BACKLIGHT_ON 0x01 | ||
|
||
typedef struct intel_ipts_mapbuffer { | ||
u32 size; | ||
u32 flags; | ||
void *gfx_addr; | ||
void *cpu_addr; | ||
u64 buf_handle; | ||
u64 phy_addr; | ||
} intel_ipts_mapbuffer_t; | ||
struct ipts_mapbuffer { | ||
u32 size; | ||
u32 flags; | ||
void *gfx_addr; | ||
void *cpu_addr; | ||
u64 buf_handle; | ||
u64 phy_addr; | ||
}; | ||
|
||
typedef struct intel_ipts_wq_info { | ||
struct ipts_wq_info { | ||
u64 db_addr; | ||
u64 db_phy_addr; | ||
u32 db_cookie_offset; | ||
u32 wq_size; | ||
u64 wq_addr; | ||
u64 wq_phy_addr; | ||
u64 wq_head_addr; // head of wq is managed by GPU | ||
u64 wq_head_phy_addr; // head of wq is managed by GPU | ||
u64 wq_tail_addr; // tail of wq is managed by CSME | ||
u64 wq_tail_phy_addr; // tail of wq is managed by CSME | ||
} intel_ipts_wq_info_t; | ||
|
||
typedef struct intel_ipts_ops { | ||
int (*get_wq_info)(uint64_t gfx_handle, intel_ipts_wq_info_t *wq_info); | ||
int (*map_buffer)(uint64_t gfx_handle, intel_ipts_mapbuffer_t *mapbuffer); | ||
|
||
// head of wq is managed by GPU | ||
u64 wq_head_addr; | ||
u64 wq_head_phy_addr; | ||
|
||
// tail of wq is managed by CSME | ||
u64 wq_tail_addr; | ||
u64 wq_tail_phy_addr; | ||
}; | ||
|
||
struct ipts_ops { | ||
int (*get_wq_info)(uint64_t gfx_handle, | ||
struct ipts_wq_info *wq_info); | ||
int (*map_buffer)(uint64_t gfx_handle, | ||
struct ipts_mapbuffer *mapbuffer); | ||
int (*unmap_buffer)(uint64_t gfx_handle, uint64_t buf_handle); | ||
} intel_ipts_ops_t; | ||
|
||
typedef struct intel_ipts_callback { | ||
void (*workload_complete)(void *data); | ||
void (*notify_gfx_status)(u32 status, void *data); | ||
} intel_ipts_callback_t; | ||
|
||
typedef struct intel_ipts_connect { | ||
struct device *client; // input : client device for PM setup | ||
intel_ipts_callback_t ipts_cb; // input : callback addresses | ||
void *data; // input : callback data | ||
u32 if_version; // input : interface version | ||
u32 gfx_version; // output : gfx version | ||
u64 gfx_handle; // output : gfx handle | ||
intel_ipts_ops_t ipts_ops; // output : gfx ops for IPTS | ||
} intel_ipts_connect_t; | ||
|
||
int intel_ipts_connect(intel_ipts_connect_t *ipts_connect); | ||
void intel_ipts_disconnect(uint64_t gfx_handle); | ||
|
||
#endif // _INTEL_IPTS_GFX_H_ | ||
}; | ||
|
||
struct ipts_callback { | ||
void (*workload_complete)(void *data); | ||
void (*notify_gfx_status)(u32 status, void *data); | ||
}; | ||
|
||
struct ipts_connect { | ||
// input: Client device for PM setup | ||
struct device *client; | ||
|
||
// input: Callback addresses | ||
struct ipts_callback ipts_cb; | ||
|
||
// input: Callback data | ||
void *data; | ||
|
||
// input: interface version | ||
u32 if_version; | ||
|
||
// output: GFX version | ||
u32 gfx_version; | ||
|
||
// output: GFX handle | ||
u64 gfx_handle; | ||
|
||
// output: GFX ops for IPTS | ||
struct ipts_ops ipts_ops; | ||
}; | ||
|
||
int ipts_connect(struct ipts_connect *ipts_connect); | ||
void ipts_disconnect(uint64_t gfx_handle); | ||
|
||
#endif // IPTS_GFX_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
#ifndef _INTEL_IPTS_IPTS_H_ | ||
#define _INTEL_IPTS_IPTS_H_ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* | ||
* Intel Precise Touch & Stylus | ||
* Copyright (c) 2016 Intel Corporation | ||
* | ||
*/ | ||
|
||
#ifndef IPTS_H | ||
#define IPTS_H | ||
|
||
#define MAX_IOCL_FILE_NAME_LEN 80 | ||
#define MAX_IOCL_FILE_PATH_LEN 256 | ||
|
||
#endif // _INTEL_IPTS_IPTS_H_ | ||
#endif // IPTS_H |