linux ps3手柄驱动,ps3 DS3 手柄驱动

也许是当年ps3 可以安装yellow dog 的原因,现在kernel包直接包含了ds3(sixaxis)的驱动。

如果要让ds3 在linux 下工作需要两个部分:

1. HID    –人体工程学接口设备, 鼠标,键盘及其他控制器都需要它。它遵循HID驱动构架。仅处理模块初始化和设备的探测(probe)

具体位置在: drivers/hid/hid-sony.c / *  HID driver for some sony “special” devices

*

*  Copyright (c) 1999 Andreas Gal

*  Copyright (c) 2000-2005 Vojtech Pavlik

*  Copyright (c) 2005 Michael Haboustak for Concept2, Inc

*  Copyright (c) 2007 Paul Walmsley

*  Copyright (c) 2008 Jiri Slaby

*  Copyright (c) 2006-2008 Jiri Kosina

*/

/*

* This program is free software; you can redistribute it and/or modify it

* under the terms of the GNU General Public License as published by the Free

* Software Foundation; either version 2 of the License, or (at your option)

* any later version.

*/

#include

#include

#include

#include

#include

#include “hid-ids.h”

static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)

{

int ret;

unsigned long quirks = id->driver_data;

struct sony_sc *sc;

switch (hdev->bus) {

case BUS_USB:

ret = sony_set_operational_usb(hdev);

break;

case BUS_BLUETOOTH:

ret = sony_set_operational_bt(hdev);

break;

default:

ret = 0;

hid-ids.h 包含ds3 的vid ,pid

#define USB_VENDOR_ID_SONY                      0x054c

#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE       0x024b

#define USB_DEVICE_ID_SONY_PS3_CONTROLLER       0x0268

kernel 默认把这个hid-sony 包含进内核,而不是模块形式。 CONFIG_HID_SONY=y

2. input –这个是kernel 2.6以后抽象出来的,专门处理具体输入输出外设事件。input作为设备作业流的最后一个环节他将I/O外设分为这几类:

obj-$(CONFIG_INPUT_KEYBOARD)    += keyboard/

obj-$(CONFIG_INPUT_MOUSE)       += mouse/

obj-$(CONFIG_INPUT_JOYSTICK)    += joystick/

obj-$(CONFIG_INPUT_TABLET)      += tablet/

obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/

obj-$(CONFIG_INPUT_MISC)        += misc/

手柄控制器就属于 joystick 。然后在joystick 有专门处理一种手柄/摇杆的驱动。对应DS3的就是gamecon.c

/*

* NES, SNES, N64, MultiSystem, PSX gamepad driver for Linux

*

*  Copyright (c) 1999-2004     Vojtech Pavlik

*  Copyright (c) 2004          Peter Nelson

*

*  Based on the work of:

*      Andree Borrmann         John Dahlstrom

*      David Kuder             Nathan Hand

*      Raphael Assenat

*/

看注释不知道像NES这样的古老非usb手柄怎么在linux上面用~ 作者还有文档呢:

/*

* PSX support

*

* See documentation at:

*      http://www.geocities.co.jp/Playtown/2004/psx/ps_eng.txt

*      http://www.gamesx.com/controldata/psxcont/psxcont.htm

*

*/

赞过:

赞 正在加载……

相关

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值