diff options
Diffstat (limited to 'drivers/staging/gpib/include')
-rw-r--r-- | drivers/staging/gpib/include/gpibP.h | 14 | ||||
-rw-r--r-- | drivers/staging/gpib/include/gpib_proto.h | 31 | ||||
-rw-r--r-- | drivers/staging/gpib/include/gpib_types.h | 162 | ||||
-rw-r--r-- | drivers/staging/gpib/include/nec7210.h | 40 | ||||
-rw-r--r-- | drivers/staging/gpib/include/nec7210_registers.h | 3 | ||||
-rw-r--r-- | drivers/staging/gpib/include/tms9914.h | 37 |
6 files changed, 155 insertions, 132 deletions
diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h index 0c71a038e444..0af72934ce24 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -11,23 +11,23 @@ #include "gpib_types.h" #include "gpib_proto.h" -#include "gpib_user.h" +#include "gpib.h" #include "gpib_ioctl.h" #include <linux/fs.h> #include <linux/interrupt.h> #include <linux/io.h> -int gpib_register_driver(gpib_interface_t *interface, struct module *mod); -void gpib_unregister_driver(gpib_interface_t *interface); -struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned int vendor_id, +int gpib_register_driver(struct gpib_interface *interface, struct module *mod); +void gpib_unregister_driver(struct gpib_interface *interface); +struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, struct pci_dev *from); -struct pci_dev *gpib_pci_get_subsys(const gpib_board_config_t *config, unsigned int vendor_id, +struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from); -unsigned int num_gpib_events(const gpib_event_queue_t *queue); +unsigned int num_gpib_events(const struct gpib_event_queue *queue); int push_gpib_event(struct gpib_board *board, short event_type); -int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type); +int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type); int gpib_request_pseudo_irq(struct gpib_board *board, irqreturn_t (*handler)(int, void *)); void gpib_free_pseudo_irq(struct gpib_board *board); int gpib_match_device_path(struct device *dev, const char *device_path_in); diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 2c7dfc02f517..42e736e3b7cd 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -8,12 +8,8 @@ int ibopen(struct inode *inode, struct file *filep); int ibclose(struct inode *inode, struct file *file); long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg); -int osInit(void); -void osReset(void); void os_start_timer(struct gpib_board *board, unsigned int usec_timeout); void os_remove_timer(struct gpib_board *board); -void osSendEOI(void); -void osSendEOI(void); void init_gpib_board(struct gpib_board *board); static inline unsigned long usec_to_jiffies(unsigned int usec) { @@ -23,34 +19,31 @@ static inline unsigned long usec_to_jiffies(unsigned int usec) }; int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); -void init_gpib_descriptor(gpib_descriptor_t *desc); +void init_gpib_descriptor(struct gpib_descriptor *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *result); -int ibAPWait(struct gpib_board *board, int pad); -int ibAPrsp(struct gpib_board *board, int padsad, char *spb); -void ibAPE(struct gpib_board *board, int pad, int v); + unsigned int usec_timeout, u8 *result); int ibcac(struct gpib_board *board, int sync, int fallback_to_async); -int ibcmd(struct gpib_board *board, uint8_t *buf, size_t length, size_t *bytes_written); +int ibcmd(struct gpib_board *board, u8 *buf, size_t length, size_t *bytes_written); int ibgts(struct gpib_board *board); int ibonline(struct gpib_board *board); int iboffline(struct gpib_board *board); int iblines(const struct gpib_board *board, short *lines); -int ibrd(struct gpib_board *board, uint8_t *buf, size_t length, int *end_flag, size_t *bytes_read); -int ibrpp(struct gpib_board *board, uint8_t *buf); -int ibrsv2(struct gpib_board *board, uint8_t status_byte, int new_reason_for_service); -void ibrsc(struct gpib_board *board, int request_control); +int ibrd(struct gpib_board *board, u8 *buf, size_t length, int *end_flag, size_t *bytes_read); +int ibrpp(struct gpib_board *board, u8 *buf); +int ibrsv2(struct gpib_board *board, u8 status_byte, int new_reason_for_service); +int ibrsc(struct gpib_board *board, int request_control); int ibsic(struct gpib_board *board, unsigned int usec_duration); int ibsre(struct gpib_board *board, int enable); int ibpad(struct gpib_board *board, unsigned int addr); int ibsad(struct gpib_board *board, int addr); int ibeos(struct gpib_board *board, int eos, int eosflags); int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask, - int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); -int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written); + int *status, unsigned long usec_timeout, struct gpib_descriptor *desc); +int ibwrt(struct gpib_board *board, u8 *buf, size_t cnt, int send_eoi, size_t *bytes_written); int ibstatus(struct gpib_board *board); -int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *device, - int clear_mask, int set_mask, gpib_descriptor_t *desc); +int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, + int clear_mask, int set_mask, struct gpib_descriptor *desc); int io_timed_out(struct gpib_board *board); -int ibppc(struct gpib_board *board, uint8_t configuration); +int ibppc(struct gpib_board *board, u8 configuration); #endif /* GPIB_PROTO_INCLUDED */ diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 2d9b9be683f8..db040c80d778 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -8,12 +8,7 @@ #define _GPIB_TYPES_H #ifdef __KERNEL__ -/* gpib_interface_t defines the interface - * between the board-specific details dealt with in the drivers - * and generic interface provided by gpib-common. - * This really should be in a different header file. - */ -#include "gpib_user.h" +#include "gpib.h" #include <linux/atomic.h> #include <linux/device.h> #include <linux/mutex.h> @@ -22,11 +17,10 @@ #include <linux/timer.h> #include <linux/interrupt.h> -typedef struct gpib_interface_struct gpib_interface_t; struct gpib_board; /* config parameters that are only used by driver attach functions */ -typedef struct { +struct gpib_board_config { /* firmware blob */ void *init_data; int init_data_length; @@ -37,11 +31,13 @@ typedef struct { unsigned int ibirq; /* dma channel to use for non-pnp cards (set by core, driver should make local copy) */ unsigned int ibdma; - /* pci bus of card, useful for distinguishing multiple identical pci cards + /* + * pci bus of card, useful for distinguishing multiple identical pci cards * (negative means don't care) */ int pci_bus; - /* pci slot of card, useful for distinguishing multiple identical pci cards + /* + * pci slot of card, useful for distinguishing multiple identical pci cards * (negative means don't care) */ int pci_slot; @@ -49,16 +45,23 @@ typedef struct { char *device_path; /* serial number of hardware to attach */ char *serial_number; -} gpib_board_config_t; +}; -struct gpib_interface_struct { +/* + * struct gpib_interface defines the interface + * between the board-specific details dealt with in the drivers + * and generic interface provided by gpib-common. + * This really should be in a different header file. + */ +struct gpib_interface { /* name of board */ char *name; /* attach() initializes board and allocates resources */ - int (*attach)(struct gpib_board *board, const gpib_board_config_t *config); + int (*attach)(struct gpib_board *board, const struct gpib_board_config *config); /* detach() shuts down board and frees resources */ void (*detach)(struct gpib_board *board); - /* read() should read at most 'length' bytes from the bus into + /* + * read() should read at most 'length' bytes from the bus into * 'buffer'. It should return when it fills the buffer or * encounters an END (EOI and or EOS if appropriate). It should set 'end' * to be nonzero if the read was terminated by an END, otherwise 'end' @@ -68,76 +71,88 @@ struct gpib_interface_struct { * return indicates error. * nbytes returns number of bytes read */ - int (*read)(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, + int (*read)(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read); - /* write() should write 'length' bytes from buffer to the bus. + /* + * write() should write 'length' bytes from buffer to the bus. * If the boolean value send_eoi is nonzero, then EOI should * be sent along with the last byte. Returns number of bytes * written or negative value on error. */ - int (*write)(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, + int (*write)(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); - /* command() writes the command bytes in 'buffer' to the bus + /* + * command() writes the command bytes in 'buffer' to the bus * Returns zero on success or negative value on error. */ - int (*command)(struct gpib_board *board, uint8_t *buffer, size_t length, + int (*command)(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); - /* Take control (assert ATN). If 'asyncronous' is nonzero, take + /* + * Take control (assert ATN). If 'asyncronous' is nonzero, take * control asyncronously (assert ATN immediately without waiting * for other processes to complete first). Should not return * until board becomes controller in charge. Returns zero no success, * nonzero on error. */ int (*take_control)(struct gpib_board *board, int asyncronous); - /* De-assert ATN. Returns zero on success, nonzer on error. + /* + * De-assert ATN. Returns zero on success, nonzer on error. */ int (*go_to_standby)(struct gpib_board *board); /* request/release control of the IFC and REN lines (system controller) */ - void (*request_system_control)(struct gpib_board *board, int request_control); - /* Asserts or de-asserts 'interface clear' (IFC) depending on + int (*request_system_control)(struct gpib_board *board, int request_control); + /* + * Asserts or de-asserts 'interface clear' (IFC) depending on * boolean value of 'assert' */ void (*interface_clear)(struct gpib_board *board, int assert); - /* Sends remote enable command if 'enable' is nonzero, disables remote mode + /* + * Sends remote enable command if 'enable' is nonzero, disables remote mode * if 'enable' is zero */ void (*remote_enable)(struct gpib_board *board, int enable); - /* enable END for reads, when byte 'eos' is received. If + /* + * enable END for reads, when byte 'eos' is received. If * 'compare_8_bits' is nonzero, then all 8 bits are compared * with the eos bytes. Otherwise only the 7 least significant * bits are compared. */ - int (*enable_eos)(struct gpib_board *board, uint8_t eos, int compare_8_bits); + int (*enable_eos)(struct gpib_board *board, u8 eos, int compare_8_bits); /* disable END on eos byte (END on EOI only)*/ void (*disable_eos)(struct gpib_board *board); /* configure parallel poll */ - void (*parallel_poll_configure)(struct gpib_board *board, uint8_t configuration); + void (*parallel_poll_configure)(struct gpib_board *board, u8 configuration); /* conduct parallel poll */ - int (*parallel_poll)(struct gpib_board *board, uint8_t *result); + int (*parallel_poll)(struct gpib_board *board, u8 *result); /* set/clear ist (individual status bit) */ void (*parallel_poll_response)(struct gpib_board *board, int ist); /* select local parallel poll configuration mode PP2 versus remote PP1 */ void (*local_parallel_poll_mode)(struct gpib_board *board, int local); - /* Returns current status of the bus lines. Should be set to + /* + * Returns current status of the bus lines. Should be set to * NULL if your board does not have the ability to query the * state of the bus lines. */ int (*line_status)(const struct gpib_board *board); - /* updates and returns the board's current status. + /* + * updates and returns the board's current status. * The meaning of the bits are specified in gpib_user.h * in the IBSTA section. The driver does not need to * worry about setting the CMPL, END, TIMO, or ERR bits. */ unsigned int (*update_status)(struct gpib_board *board, unsigned int clear_mask); - /* Sets primary address 0-30 for gpib interface card. + /* + * Sets primary address 0-30 for gpib interface card. */ int (*primary_address)(struct gpib_board *board, unsigned int address); - /* Sets and enables, or disables secondary address 0-30 + /* + * Sets and enables, or disables secondary address 0-30 * for gpib interface card. */ int (*secondary_address)(struct gpib_board *board, unsigned int address, int enable); - /* Sets the byte the board should send in response to a serial poll. + /* + * Sets the byte the board should send in response to a serial poll. * This function should also start or stop requests for service via * IEEE 488.2 reqt/reqf, based on MSS (bit 6 of the status_byte). * If the more flexible serial_poll_response2 is implemented by the @@ -149,8 +164,9 @@ struct gpib_interface_struct { * by IEEE 488.2 section 11.3.3.4.3 "Allowed Coupled Control of * STB, reqt, and reqf". */ - void (*serial_poll_response)(struct gpib_board *board, uint8_t status_byte); - /* Sets the byte the board should send in response to a serial poll. + void (*serial_poll_response)(struct gpib_board *board, u8 status_byte); + /* + * Sets the byte the board should send in response to a serial poll. * This function should also request service via IEEE 488.2 reqt/reqf * based on MSS (bit 6 of the status_byte) and new_reason_for_service. * reqt should be set true if new_reason_for_service is true, @@ -164,11 +180,12 @@ struct gpib_interface_struct { * If this method is left NULL by the driver, then the user library * function ibrsv2 will not work. */ - void (*serial_poll_response2)(struct gpib_board *board, uint8_t status_byte, + void (*serial_poll_response2)(struct gpib_board *board, u8 status_byte, int new_reason_for_service); - /* returns the byte the board will send in response to a serial poll. + /* + * returns the byte the board will send in response to a serial poll. */ - uint8_t (*serial_poll_status)(struct gpib_board *board); + u8 (*serial_poll_status)(struct gpib_board *board); /* adjust T1 delay */ int (*t1_delay)(struct gpib_board *board, unsigned int nano_sec); /* go to local mode */ @@ -179,14 +196,14 @@ struct gpib_interface_struct { unsigned skip_check_for_command_acceptors : 1; }; -typedef struct { +struct gpib_event_queue { struct list_head event_head; spinlock_t lock; // for access to event list unsigned int num_events; unsigned dropped_event : 1; -} gpib_event_queue_t; +}; -static inline void init_event_queue(gpib_event_queue_t *queue) +static inline void init_event_queue(struct gpib_event_queue *queue) { INIT_LIST_HEAD(&queue->event_head); queue->num_events = 0; @@ -210,20 +227,22 @@ static inline void init_gpib_pseudo_irq(struct gpib_pseudo_irq *pseudo_irq) } /* list so we can make a linked list of drivers */ -typedef struct gpib_interface_list_struct { +struct gpib_interface_list { struct list_head list; - gpib_interface_t *interface; + struct gpib_interface *interface; struct module *module; -} gpib_interface_list_t; +}; -/* One struct gpib_board is allocated for each physical board in the computer. +/* + * One struct gpib_board is allocated for each physical board in the computer. * It provides storage for variables local to each board, and interface * functions for performing operations on the board */ struct gpib_board { /* functions used by this board */ - gpib_interface_t *interface; - /* Pointer to module whose use count we should increment when + struct gpib_interface *interface; + /* + * Pointer to module whose use count we should increment when * interface is in use */ struct module *provider_module; @@ -231,20 +250,24 @@ struct gpib_board { u8 *buffer; /* length of buffer */ unsigned int buffer_length; - /* Used to hold the board's current status (see update_status() above) + /* + * Used to hold the board's current status (see update_status() above) */ unsigned long status; - /* Driver should only sleep on this wait queue. It is special in that the + /* + * Driver should only sleep on this wait queue. It is special in that the * core will wake this queue and set the TIMO bit in 'status' when the * watchdog timer times out. */ wait_queue_head_t wait; - /* Lock that only allows one process to access this board at a time. + /* + * Lock that only allows one process to access this board at a time. * Has to be first in any locking order, since it can be locked over * multiple ioctls. */ struct mutex user_mutex; - /* Mutex which compensates for removal of "big kernel lock" from kernel. + /* + * Mutex which compensates for removal of "big kernel lock" from kernel. * Should not be held for extended waits. */ struct mutex big_gpib_mutex; @@ -259,7 +282,8 @@ struct gpib_board { struct device *dev; /* gpib_common device gpibN */ struct device *gpib_dev; - /* 'private_data' can be used as seen fit by the driver to + /* + * 'private_data' can be used as seen fit by the driver to * store additional variables for this board */ void *private_data; @@ -284,34 +308,36 @@ struct gpib_board { /* autospoll kernel thread */ struct task_struct *autospoll_task; /* queue for recording received trigger/clear/ifc events */ - gpib_event_queue_t event_queue; + struct gpib_event_queue event_queue; /* minor number for this board's device file */ int minor; /* struct to deal with polling mode*/ struct gpib_pseudo_irq pseudo_irq; /* error dong autopoll */ atomic_t stuck_srq; - gpib_board_config_t config; + struct gpib_board_config config; /* Flag that indicates whether board is system controller of the bus */ unsigned master : 1; /* individual status bit */ unsigned ist : 1; - /* one means local parallel poll mode ieee 488.1 PP2 (or no parallel poll PP0), + /* + * one means local parallel poll mode ieee 488.1 PP2 (or no parallel poll PP0), * zero means remote parallel poll configuration mode ieee 488.1 PP1 */ unsigned local_ppoll_mode : 1; }; /* element of event queue */ -typedef struct { +struct gpib_event { struct list_head list; short event_type; -} gpib_event_t; +}; -/* Each board has a list of gpib_status_queue_t to keep track of all open devices +/* + * Each board has a list of gpib_status_queue to keep track of all open devices * on the bus, so we know what address to poll when we get a service request */ -typedef struct { +struct gpib_status_queue { /* list_head so we can make a linked list of devices */ struct list_head list; unsigned int pad; /* primary gpib address */ @@ -323,31 +349,31 @@ typedef struct { unsigned int reference_count; /* flags loss of status byte error due to limit on size of queue */ unsigned dropped_byte : 1; -} gpib_status_queue_t; +}; -typedef struct { +struct gpib_status_byte { struct list_head list; u8 poll_byte; -} status_byte_t; +}; -void init_gpib_status_queue(gpib_status_queue_t *device); +void init_gpib_status_queue(struct gpib_status_queue *device); /* Used to store device-descriptor-specific information */ -typedef struct { +struct gpib_descriptor { unsigned int pad; /* primary gpib address */ int sad; /* secondary gpib address (negative means disabled) */ atomic_t io_in_progress; unsigned is_board : 1; unsigned autopoll_enabled : 1; -} gpib_descriptor_t; +}; -typedef struct { +struct gpib_file_private { atomic_t holding_mutex; - gpib_descriptor_t *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; + struct gpib_descriptor *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; /* locked while descriptors are being allocated/deallocated */ struct mutex descriptors_mutex; unsigned got_module : 1; -} gpib_file_private_t; +}; #endif /* __KERNEL__ */ diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/include/nec7210.h index 069896456230..312217b4580e 100644 --- a/drivers/staging/gpib/include/nec7210.h +++ b/drivers/staging/gpib/include/nec7210.h @@ -1,4 +1,4 @@ -//* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 */ /*************************************************************************** * copyright : (C) 2002 by Frank Mori Hess @@ -78,19 +78,19 @@ enum { }; // interface functions -int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, size_t *bytes_written); int nec7210_take_control(struct gpib_board *board, struct nec7210_priv *priv, int syncronous); int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *priv); -void nec7210_request_system_control(struct gpib_board *board, - struct nec7210_priv *priv, int request_control); +int nec7210_request_system_control(struct gpib_board *board, + struct nec7210_priv *priv, int request_control); void nec7210_interface_clear(struct gpib_board *board, struct nec7210_priv *priv, int assert); void nec7210_remote_enable(struct gpib_board *board, struct nec7210_priv *priv, int enable); -int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv, uint8_t eos_bytes, +int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv, u8 eos_bytes, int compare_8_bits); void nec7210_disable_eos(struct gpib_board *board, struct nec7210_priv *priv); unsigned int nec7210_update_status(struct gpib_board *board, struct nec7210_priv *priv, @@ -100,14 +100,14 @@ int nec7210_primary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address); int nec7210_secondary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address, int enable); -int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *result); -void nec7210_serial_poll_response(struct gpib_board *board, struct nec7210_priv *priv, uint8_t status); +int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, u8 *result); +void nec7210_serial_poll_response(struct gpib_board *board, + struct nec7210_priv *priv, u8 status); void nec7210_parallel_poll_configure(struct gpib_board *board, struct nec7210_priv *priv, unsigned int configuration); void nec7210_parallel_poll_response(struct gpib_board *board, struct nec7210_priv *priv, int ist); -uint8_t nec7210_serial_poll_status(struct gpib_board *board, - struct nec7210_priv *priv); +u8 nec7210_serial_poll_status(struct gpib_board *board, struct nec7210_priv *priv); int nec7210_t1_delay(struct gpib_board *board, struct nec7210_priv *priv, unsigned int nano_sec); void nec7210_return_to_local(const struct gpib_board *board, struct nec7210_priv *priv); @@ -119,18 +119,18 @@ unsigned int nec7210_set_reg_bits(struct nec7210_priv *priv, unsigned int reg, unsigned int mask, unsigned int bits); void nec7210_set_handshake_mode(struct gpib_board *board, struct nec7210_priv *priv, int mode); void nec7210_release_rfd_holdoff(struct gpib_board *board, struct nec7210_priv *priv); -uint8_t nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv *priv, int *end); +u8 nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv *priv, int *end); // wrappers for io functions -uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num); -uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num); -uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, +u8 nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); +u8 nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); +u8 nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); -uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, +u8 nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); // interrupt service routine diff --git a/drivers/staging/gpib/include/nec7210_registers.h b/drivers/staging/gpib/include/nec7210_registers.h index 888803dd97f9..97c53ac8e805 100644 --- a/drivers/staging/gpib/include/nec7210_registers.h +++ b/drivers/staging/gpib/include/nec7210_registers.h @@ -17,7 +17,8 @@ enum nec7210_chipset { TNT5004, // NI (minor differences to TNT4882) }; -/* nec7210 register numbers (might need to be multiplied by +/* + * nec7210 register numbers (might need to be multiplied by * a board-dependent offset to get actually io address offset) */ // write registers diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index 424c95ad85c6..50a9d3b22619 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -1,4 +1,4 @@ -//* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0 */ /*************************************************************************** * copyright : (C) 2002 by Frank Mori Hess @@ -79,24 +79,25 @@ enum { }; // interface functions -int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, size_t *bytes_written); int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, int syncronous); -/* alternate version of tms9914_take_control which works around buggy tcs +/* + * alternate version of tms9914_take_control which works around buggy tcs * implementation. */ int tms9914_take_control_workaround(struct gpib_board *board, struct tms9914_priv *priv, int syncronous); int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *priv); -void tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, - int request_control); +int tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, + int request_control); void tms9914_interface_clear(struct gpib_board *board, struct tms9914_priv *priv, int assert); void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *priv, int enable); -int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, uint8_t eos_bytes, +int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, u8 eos_bytes, int compare_8_bits); void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *priv); unsigned int tms9914_update_status(struct gpib_board *board, struct tms9914_priv *priv, @@ -105,13 +106,14 @@ int tms9914_primary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address); int tms9914_secondary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address, int enable); -int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *result); +int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, u8 *result); void tms9914_parallel_poll_configure(struct gpib_board *board, - struct tms9914_priv *priv, uint8_t config); + struct tms9914_priv *priv, u8 config); void tms9914_parallel_poll_response(struct gpib_board *board, struct tms9914_priv *priv, int ist); -void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914_priv *priv, uint8_t status); -uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv); +void tms9914_serial_poll_response(struct gpib_board *board, + struct tms9914_priv *priv, u8 status); +u8 tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv); int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *priv); unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_priv *priv, unsigned int nano_sec); @@ -124,10 +126,10 @@ void tms9914_release_holdoff(struct tms9914_priv *priv); void tms9914_set_holdoff_mode(struct tms9914_priv *priv, enum tms9914_holdoff_mode mode); // wrappers for io functions -uint8_t tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num); -void tms9914_ioport_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num); -uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num); -void tms9914_iomem_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num); +u8 tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num); +void tms9914_ioport_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num); +u8 tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num); +void tms9914_iomem_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num); // interrupt service routine irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_priv *priv); @@ -139,7 +141,8 @@ enum { ms9914_num_registers = 8, }; -/* tms9914 register numbers (might need to be multiplied by +/* + * tms9914 register numbers (might need to be multiplied by * a board-dependent offset to get actually io address offset) */ // write registers |