12 #include <linux/device.h>
13 #include <linux/slab.h>
17 static unsigned int tx_7segled_num;
18 static void (*tx_7segled_putc)(
unsigned int pos,
unsigned char val);
21 void (*
putc)(
unsigned int pos,
unsigned char val))
24 tx_7segled_putc =
putc;
31 if (pos >= tx_7segled_num)
33 c = map_to_seg7(&txx9_seg7map, c);
36 tx_7segled_putc(pos, c);
44 unsigned int ch = dev->
id;
53 unsigned int ch = dev->
id;
54 tx_7segled_putc(ch, buf[0]);
65 memcpy(buf, &txx9_seg7map,
sizeof(txx9_seg7map));
66 return sizeof(txx9_seg7map);
71 const char *buf,
size_t size)
73 if (size !=
sizeof(txx9_seg7map))
75 memcpy(&txx9_seg7map, buf, size);
79 static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
81 static struct bus_type tx_7segled_subsys = {
83 .dev_name =
"7segled",
86 static int __init tx_7segled_init_sysfs(
void)
97 for (i = 0; i < tx_7segled_num; i++) {
105 dev->
bus = &tx_7segled_subsys;