mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 23:25:54 +00:00
873e65bc09
Based on 1 normalized pattern(s): 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 version 2 of the license this program is distributed in the hope that 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 you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 83 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.021731668@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
90 lines
2.9 KiB
C
90 lines
2.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* PS3 virtual uart
|
|
*
|
|
* Copyright (C) 2006 Sony Computer Entertainment Inc.
|
|
* Copyright 2006 Sony Corp.
|
|
*/
|
|
|
|
#if !defined(_PS3_VUART_H)
|
|
#define _PS3_VUART_H
|
|
|
|
#include <asm/ps3.h>
|
|
|
|
struct ps3_vuart_stats {
|
|
unsigned long bytes_written;
|
|
unsigned long bytes_read;
|
|
unsigned long tx_interrupts;
|
|
unsigned long rx_interrupts;
|
|
unsigned long disconnect_interrupts;
|
|
};
|
|
|
|
struct ps3_vuart_work {
|
|
struct work_struct work;
|
|
unsigned long trigger;
|
|
struct ps3_system_bus_device *dev; /* to convert work to device */
|
|
};
|
|
|
|
/**
|
|
* struct ps3_vuart_port_driver - a driver for a device on a vuart port
|
|
*/
|
|
|
|
struct ps3_vuart_port_driver {
|
|
struct ps3_system_bus_driver core;
|
|
int (*probe)(struct ps3_system_bus_device *);
|
|
int (*remove)(struct ps3_system_bus_device *);
|
|
void (*shutdown)(struct ps3_system_bus_device *);
|
|
void (*work)(struct ps3_system_bus_device *);
|
|
/* int (*tx_event)(struct ps3_system_bus_device *dev); */
|
|
/* int (*rx_event)(struct ps3_system_bus_device *dev); */
|
|
/* int (*disconnect_event)(struct ps3_system_bus_device *dev); */
|
|
/* int (*suspend)(struct ps3_system_bus_device *, pm_message_t); */
|
|
/* int (*resume)(struct ps3_system_bus_device *); */
|
|
};
|
|
|
|
int ps3_vuart_port_driver_register(struct ps3_vuart_port_driver *drv);
|
|
void ps3_vuart_port_driver_unregister(struct ps3_vuart_port_driver *drv);
|
|
|
|
static inline struct ps3_vuart_port_driver *
|
|
ps3_system_bus_dev_to_vuart_drv(struct ps3_system_bus_device *_dev)
|
|
{
|
|
struct ps3_system_bus_driver *sbd =
|
|
ps3_system_bus_dev_to_system_bus_drv(_dev);
|
|
BUG_ON(!sbd);
|
|
return container_of(sbd, struct ps3_vuart_port_driver, core);
|
|
}
|
|
static inline struct ps3_system_bus_device *ps3_vuart_work_to_system_bus_dev(
|
|
struct work_struct *_work)
|
|
{
|
|
struct ps3_vuart_work *vw = container_of(_work, struct ps3_vuart_work,
|
|
work);
|
|
return vw->dev;
|
|
}
|
|
|
|
int ps3_vuart_write(struct ps3_system_bus_device *dev, const void *buf,
|
|
unsigned int bytes);
|
|
int ps3_vuart_read(struct ps3_system_bus_device *dev, void *buf,
|
|
unsigned int bytes);
|
|
int ps3_vuart_read_async(struct ps3_system_bus_device *dev, unsigned int bytes);
|
|
void ps3_vuart_cancel_async(struct ps3_system_bus_device *dev);
|
|
void ps3_vuart_clear_rx_bytes(struct ps3_system_bus_device *dev,
|
|
unsigned int bytes);
|
|
|
|
struct vuart_triggers {
|
|
unsigned long rx;
|
|
unsigned long tx;
|
|
};
|
|
|
|
int ps3_vuart_get_triggers(struct ps3_system_bus_device *dev,
|
|
struct vuart_triggers *trig);
|
|
int ps3_vuart_set_triggers(struct ps3_system_bus_device *dev, unsigned int tx,
|
|
unsigned int rx);
|
|
int ps3_vuart_enable_interrupt_tx(struct ps3_system_bus_device *dev);
|
|
int ps3_vuart_disable_interrupt_tx(struct ps3_system_bus_device *dev);
|
|
int ps3_vuart_enable_interrupt_rx(struct ps3_system_bus_device *dev);
|
|
int ps3_vuart_disable_interrupt_rx(struct ps3_system_bus_device *dev);
|
|
int ps3_vuart_enable_interrupt_disconnect(struct ps3_system_bus_device *dev);
|
|
int ps3_vuart_disable_interrupt_disconnect(struct ps3_system_bus_device *dev);
|
|
|
|
#endif
|