more separation
This commit is contained in:
@ -3,21 +3,21 @@
|
|||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
|
|
||||||
|
#include "ls7366r.h"
|
||||||
|
#include "trigger.h"
|
||||||
|
#include "leds.h"
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_AUTHOR("Wolfgang Hottgenroth");
|
MODULE_AUTHOR("Wolfgang Hottgenroth");
|
||||||
MODULE_DESCRIPTION("Driver for the MainsCnt measurement hat");
|
MODULE_DESCRIPTION("Driver for the MainsCnt measurement hat");
|
||||||
|
|
||||||
|
|
||||||
extern struct platform_driver leds_driver;
|
|
||||||
extern struct spi_driver ls7366r_driver;
|
|
||||||
extern struct platform_driver interrupt_driver;
|
|
||||||
|
|
||||||
/* module loading and unloading */
|
/* module loading and unloading */
|
||||||
static int __init my_init(void) {
|
static int __init my_init(void) {
|
||||||
printk("counter - Loading the leds driver...\n");
|
printk("counter - Loading the leds driver...\n");
|
||||||
if(platform_driver_register(&leds_driver)) {
|
if(platform_driver_register(&leds_driver)) {
|
||||||
printk("dt_gpio - Error! Could not load leds driver\n");
|
printk("counter - Error! Could not load leds driver\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ static int __init my_init(void) {
|
|||||||
|
|
||||||
printk("counter - Loading the interrupt driver...\n");
|
printk("counter - Loading the interrupt driver...\n");
|
||||||
if(platform_driver_register(&interrupt_driver)) {
|
if(platform_driver_register(&interrupt_driver)) {
|
||||||
printk("dt_gpio - Error! Could not load interrupt driver\n");
|
printk("counter - Error! Could not load interrupt driver\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _LEDS_H_
|
||||||
|
#define _LEDS_H_
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
extern struct platform_driver leds_driver;
|
||||||
|
|
||||||
|
#endif /* _LEDS_H_ */
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/interrupt.h>
|
|
||||||
#include <linux/of_irq.h>
|
|
||||||
#include <linux/workqueue.h>
|
|
||||||
|
|
||||||
#include "ls7366r_registers.h"
|
#include "ls7366r_registers.h"
|
||||||
#include "ls7366r.h"
|
#include "ls7366r.h"
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#ifndef _LS7366R_H_
|
#ifndef _LS7366R_H_
|
||||||
#define _LS7366R_H_
|
#define _LS7366R_H_
|
||||||
|
|
||||||
|
#include <linux/spi/spi.h>
|
||||||
|
|
||||||
|
extern struct spi_driver ls7366r_driver;
|
||||||
|
extern struct spi_device *ls7366r_spi_client;
|
||||||
|
|
||||||
int read_otr(struct spi_device *client, u32 *r);
|
int read_otr(struct spi_device *client, u32 *r);
|
||||||
|
|
||||||
#endif /* _LS7366R_H_ */
|
#endif /* _LS7366R_H_ */
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern struct spi_device *ls7366r_spi_client;
|
|
||||||
|
|
||||||
|
|
||||||
/* interrupt stuff */
|
/* interrupt stuff */
|
||||||
|
8
driver/trigger.h
Normal file
8
driver/trigger.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _TRIGGER_H_
|
||||||
|
#define _TRIGGER_H_
|
||||||
|
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
extern struct platform_driver interrupt_driver;
|
||||||
|
|
||||||
|
#endif /* _TRIGGER_H_ */
|
Reference in New Issue
Block a user