mirror of
https://github.com/tsukumijima/px4_drv.git
synced 2025-07-23 12:13:06 +02:00
driver: その他の変更
include順序とか
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Definitions for I2C communicators (i2c_comm.h)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __I2C_COMM_H__
|
||||
|
@@ -2,26 +2,20 @@
|
||||
/*
|
||||
* ITE IT930x driver (it930x.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#include "print_format.h"
|
||||
#include "it930x.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/firmware.h>
|
||||
#endif
|
||||
|
||||
#include "it930x.h"
|
||||
#include "itedtv_bus.h"
|
||||
|
||||
struct it930x_i2c_master_info {
|
||||
struct it930x_bridge *it930x;
|
||||
u8 bus;
|
||||
|
@@ -2,17 +2,17 @@
|
||||
/*
|
||||
* ITE IT930x driver definitions (it930x.h)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __IT930X_H__
|
||||
#define __IT930X_H__
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/types.h>
|
||||
#include <linux/device.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#endif
|
||||
|
||||
#include "itedtv_bus.h"
|
||||
|
@@ -2,26 +2,20 @@
|
||||
/*
|
||||
* ITE IT930x bus driver (itedtv_bus.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#include "print_format.h"
|
||||
#include "itedtv_bus.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#include "winusb_compat.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/version.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/usb.h>
|
||||
#endif
|
||||
|
||||
#include "itedtv_bus.h"
|
||||
|
||||
#if defined(ITEDTV_BUS_USE_WORKQUEUE) && !defined(__linux__)
|
||||
#undef ITEDTV_BUS_USE_WORKQUEUE
|
||||
#endif
|
||||
@@ -125,6 +119,8 @@ static void itedtv_usb_workqueue_handler(struct work_struct *work)
|
||||
dev_err(ctx->bus->dev,
|
||||
"itedtv_usb_workqueue_handler: usb_submit_urb() failed. (ret: %d)\n",
|
||||
ret);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -149,7 +145,7 @@ static void itedtv_usb_complete(struct urb *urb)
|
||||
dev_dbg(ctx->bus->dev,
|
||||
"itedtv_usb_complete: !urb->actual_length\n");
|
||||
|
||||
if (!ret && (atomic_read(&ctx->streaming) == 1)) {
|
||||
if (!ret && (atomic_read_acquire(&ctx->streaming) == 1)) {
|
||||
#ifdef ITEDTV_BUS_USE_WORKQUEUE
|
||||
ret = queue_work(ctx->wq, &w->work);
|
||||
if (ret)
|
||||
@@ -395,6 +391,8 @@ static void itedtv_usb_clean_context(struct itedtv_usb_context *ctx)
|
||||
#endif
|
||||
ctx->num_works = 0;
|
||||
ctx->works = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int itedtv_usb_start_streaming(struct itedtv_bus *bus,
|
||||
@@ -452,7 +450,7 @@ static int itedtv_usb_start_streaming(struct itedtv_bus *bus,
|
||||
#endif
|
||||
|
||||
usb_reset_endpoint(bus->usb.dev, 0x84);
|
||||
atomic_set(&ctx->streaming, 1);
|
||||
atomic_xchg(&ctx->streaming, 1);
|
||||
|
||||
num = ctx->num_urb;
|
||||
works = ctx->works;
|
||||
@@ -483,7 +481,7 @@ static int itedtv_usb_start_streaming(struct itedtv_bus *bus,
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
atomic_set(&ctx->streaming, 0);
|
||||
atomic_xchg(&ctx->streaming, 0);
|
||||
|
||||
#ifdef ITEDTV_BUS_USE_WORKQUEUE
|
||||
if (ctx->wq)
|
||||
@@ -506,7 +504,7 @@ static int itedtv_usb_stop_streaming(struct itedtv_bus *bus)
|
||||
|
||||
mutex_lock(&ctx->lock);
|
||||
|
||||
atomic_set(&ctx->streaming, 0);
|
||||
atomic_xchg(&ctx->streaming, 0);
|
||||
|
||||
#ifdef ITEDTV_BUS_USE_WORKQUEUE
|
||||
if (ctx->wq)
|
||||
@@ -608,7 +606,9 @@ int itedtv_bus_term(struct itedtv_bus *bus)
|
||||
struct itedtv_usb_context *ctx = bus->usb.priv;
|
||||
|
||||
if (ctx) {
|
||||
itedtv_usb_stop_streaming(bus);
|
||||
if (atomic_read_acquire(&ctx->streaming))
|
||||
itedtv_usb_stop_streaming(bus);
|
||||
|
||||
mutex_destroy(&ctx->lock);
|
||||
kfree(ctx);
|
||||
}
|
||||
|
@@ -2,18 +2,18 @@
|
||||
/*
|
||||
* ITE IT930x bus driver definitions (itedtv_bus.h)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __ITEDTV_BUS_H__
|
||||
#define __ITEDTV_BUS_H__
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#include "winusb_compat.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/device.h>
|
||||
#include <linux/usb.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#include "winusb_compat.h"
|
||||
#endif
|
||||
|
||||
enum itedtv_bus_type {
|
||||
|
@@ -2,27 +2,21 @@
|
||||
/*
|
||||
* RafaelMicro R850 driver (r850.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
// Some features are not implemented.
|
||||
|
||||
#include "print_format.h"
|
||||
#include "r850.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#endif
|
||||
|
||||
#include "r850.h"
|
||||
|
||||
enum r850_imr_direction {
|
||||
R850_IMR_DIRECTION_GAIN = 0,
|
||||
R850_IMR_DIRECTION_PHASE = 1,
|
||||
|
@@ -2,18 +2,18 @@
|
||||
/*
|
||||
* RafaelMicro R850 driver definitions (r850.h)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __R850_H__
|
||||
#define __R850_H__
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/types.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#endif
|
||||
|
||||
#include "i2c_comm.h"
|
||||
|
@@ -2,26 +2,19 @@
|
||||
/*
|
||||
* RafaelMicro RT710 driver (rt710.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#include "print_format.h"
|
||||
#include "rt710.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#endif
|
||||
|
||||
#include "i2c_comm.h"
|
||||
#include "rt710.h"
|
||||
|
||||
#define NUM_REGS 0x10
|
||||
|
||||
struct rt710_bandwidth_param {
|
||||
|
@@ -2,18 +2,18 @@
|
||||
/*
|
||||
* RafaelMicro RT710 driver definitions (rt710.h)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __RT710_H__
|
||||
#define __RT710_H__
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/types.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#endif
|
||||
|
||||
#include "i2c_comm.h"
|
||||
|
@@ -2,26 +2,19 @@
|
||||
/*
|
||||
* Toshiba TC90522 driver (tc90522.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#include "print_format.h"
|
||||
#include "tc90522.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#include <linux/types.h>
|
||||
#ifdef __linux__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/device.h>
|
||||
#endif
|
||||
|
||||
#include "i2c_comm.h"
|
||||
#include "tc90522.h"
|
||||
|
||||
static int _tc90522_read_regs(struct tc90522_demod *demod,
|
||||
u8 reg,
|
||||
u8 *buf, u8 len)
|
||||
|
@@ -2,18 +2,18 @@
|
||||
/*
|
||||
* Toshiba TC90522 driver definitions (tc90522.c)
|
||||
*
|
||||
* Copyright (c) 2018-2019 nns779
|
||||
* Copyright (c) 2018-2020 nns779
|
||||
*/
|
||||
|
||||
#ifndef __TC90522_H__
|
||||
#define __TC90522_H__
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#include <linux/types.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#include "misc_win.h"
|
||||
#endif
|
||||
|
||||
#include "i2c_comm.h"
|
||||
|
Reference in New Issue
Block a user