Linux Audio

Check our new training course

Loading...
v4.6
 
 1/*
 2 * Driver for the NXP ISP1760 chip
 3 *
 4 * Copyright 2014 Laurent Pinchart
 5 * Copyright 2007 Sebastian Siewior
 6 *
 7 * Contacts:
 8 *	Sebastian Siewior <bigeasy@linutronix.de>
 9 *	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * version 2 as published by the Free Software Foundation.
14 */
15
16#ifndef _ISP1760_CORE_H_
17#define _ISP1760_CORE_H_
18
19#include <linux/ioport.h>
20
21#include "isp1760-hcd.h"
22#include "isp1760-udc.h"
23
24struct device;
25struct gpio_desc;
26
27/*
28 * Device flags that can vary from board to board.  All of these
29 * indicate the most "atypical" case, so that a devflags of 0 is
30 * a sane default configuration.
31 */
32#define ISP1760_FLAG_BUS_WIDTH_16	0x00000002 /* 16-bit data bus width */
33#define ISP1760_FLAG_OTG_EN		0x00000004 /* Port 1 supports OTG */
34#define ISP1760_FLAG_ANALOG_OC		0x00000008 /* Analog overcurrent */
35#define ISP1760_FLAG_DACK_POL_HIGH	0x00000010 /* DACK active high */
36#define ISP1760_FLAG_DREQ_POL_HIGH	0x00000020 /* DREQ active high */
37#define ISP1760_FLAG_ISP1761		0x00000040 /* Chip is ISP1761 */
38#define ISP1760_FLAG_INTR_POL_HIGH	0x00000080 /* Interrupt polarity active high */
39#define ISP1760_FLAG_INTR_EDGE_TRIG	0x00000100 /* Interrupt edge triggered */
40
41struct isp1760_device {
42	struct device *dev;
43
44	void __iomem *regs;
45	unsigned int devflags;
46	struct gpio_desc *rst_gpio;
47
48	struct isp1760_hcd hcd;
49	struct isp1760_udc udc;
50};
51
52int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
53		     struct device *dev, unsigned int devflags);
54void isp1760_unregister(struct device *dev);
55
56void isp1760_set_pullup(struct isp1760_device *isp, bool enable);
57
58static inline u32 isp1760_read32(void __iomem *base, u32 reg)
59{
60	return readl(base + reg);
61}
62
63static inline void isp1760_write32(void __iomem *base, u32 reg, u32 val)
64{
65	writel(val, base + reg);
66}
67
68#endif
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * Driver for the NXP ISP1760 chip
 4 *
 5 * Copyright 2014 Laurent Pinchart
 6 * Copyright 2007 Sebastian Siewior
 7 *
 8 * Contacts:
 9 *	Sebastian Siewior <bigeasy@linutronix.de>
10 *	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 
 
 
 
11 */
12
13#ifndef _ISP1760_CORE_H_
14#define _ISP1760_CORE_H_
15
16#include <linux/ioport.h>
17
18#include "isp1760-hcd.h"
19#include "isp1760-udc.h"
20
21struct device;
22struct gpio_desc;
23
24/*
25 * Device flags that can vary from board to board.  All of these
26 * indicate the most "atypical" case, so that a devflags of 0 is
27 * a sane default configuration.
28 */
29#define ISP1760_FLAG_BUS_WIDTH_16	0x00000002 /* 16-bit data bus width */
30#define ISP1760_FLAG_OTG_EN		0x00000004 /* Port 1 supports OTG */
31#define ISP1760_FLAG_ANALOG_OC		0x00000008 /* Analog overcurrent */
32#define ISP1760_FLAG_DACK_POL_HIGH	0x00000010 /* DACK active high */
33#define ISP1760_FLAG_DREQ_POL_HIGH	0x00000020 /* DREQ active high */
34#define ISP1760_FLAG_ISP1761		0x00000040 /* Chip is ISP1761 */
35#define ISP1760_FLAG_INTR_POL_HIGH	0x00000080 /* Interrupt polarity active high */
36#define ISP1760_FLAG_INTR_EDGE_TRIG	0x00000100 /* Interrupt edge triggered */
37
38struct isp1760_device {
39	struct device *dev;
40
41	void __iomem *regs;
42	unsigned int devflags;
43	struct gpio_desc *rst_gpio;
44
45	struct isp1760_hcd hcd;
46	struct isp1760_udc udc;
47};
48
49int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
50		     struct device *dev, unsigned int devflags);
51void isp1760_unregister(struct device *dev);
52
53void isp1760_set_pullup(struct isp1760_device *isp, bool enable);
54
55static inline u32 isp1760_read32(void __iomem *base, u32 reg)
56{
57	return readl(base + reg);
58}
59
60static inline void isp1760_write32(void __iomem *base, u32 reg, u32 val)
61{
62	writel(val, base + reg);
63}
64
65#endif