12865bebbabe331983aba846099aa124e60c21eb
2 * Copyright (C) 2006, 2007 OpenWrt.org
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 struct vlynq_mapping
{
25 } __attribute__ ((packed
));
27 struct vlynq_device_id
{
58 enum vlynq_divisor divisor
;
59 u32 regs_start
, regs_end
;
60 u32 mem_start
, mem_end
;
61 u32 irq_start
, irq_end
;
63 struct vlynq_regs
*local
;
64 struct vlynq_regs
*remote
;
70 int (*probe
)(struct vlynq_device
*dev
);
71 int (*remove
)(struct vlynq_device
*dev
);
72 struct device_driver driver
;
75 #define to_vlynq_driver(drv) container_of(drv, struct vlynq_driver, driver)
77 struct plat_vlynq_ops
{
78 int (*on
)(struct vlynq_device
*dev
);
79 void (*off
)(struct vlynq_device
*dev
);
82 #define to_vlynq_device(device) container_of(device, struct vlynq_device, dev)
84 extern struct bus_type vlynq_bus_type
;
86 extern int __vlynq_register_driver(struct vlynq_driver
*driver
,
87 struct module
*owner
);
89 static inline int vlynq_register_driver(struct vlynq_driver
*driver
)
91 return __vlynq_register_driver(driver
, THIS_MODULE
);
94 extern void vlynq_unregister_driver(struct vlynq_driver
*driver
);
95 extern int vlynq_device_enable(struct vlynq_device
*dev
);
96 extern void vlynq_device_disable(struct vlynq_device
*dev
);
97 extern u32
vlynq_remote_id(struct vlynq_device
*dev
);
98 extern void vlynq_set_local_mapping(struct vlynq_device
*dev
,
100 struct vlynq_mapping
*mapping
);
101 extern void vlynq_set_remote_mapping(struct vlynq_device
*dev
,
103 struct vlynq_mapping
*mapping
);
104 extern int vlynq_virq_to_irq(struct vlynq_device
*dev
, int virq
);
105 extern int vlynq_irq_to_virq(struct vlynq_device
*dev
, int irq
);
106 extern int vlynq_set_local_irq(struct vlynq_device
*dev
, int virq
);
107 extern int vlynq_set_remote_irq(struct vlynq_device
*dev
, int virq
);
109 #endif /* __VLYNQ_H__ */