summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/nwztools/plattools/Makefile2
-rw-r--r--utils/nwztools/plattools/nwz_lib.c10
-rw-r--r--utils/nwztools/plattools/nwz_lib.h8
-rw-r--r--utils/nwztools/plattools/nwz_lib_devlist.c192
4 files changed, 211 insertions, 1 deletions
diff --git a/utils/nwztools/plattools/Makefile b/utils/nwztools/plattools/Makefile
index d3efdb74a3..31633294ee 100644
--- a/utils/nwztools/plattools/Makefile
+++ b/utils/nwztools/plattools/Makefile
@@ -4,7 +4,7 @@ LD=$(PREFIX)gcc
4CFLAGS=-std=gnu99 -Wall -O2 4CFLAGS=-std=gnu99 -Wall -O2
5INCLUDES=-I. 5INCLUDES=-I.
6 6
7LIB_FILES=nwz_lib.c 7LIB_FILES=nwz_lib.c nwz_lib_devlist.c
8ALL_BUT_LIB=$(patsubst %.c,%.elf,$(filter-out $(LIB_FILES),$(wildcard *.c))) 8ALL_BUT_LIB=$(patsubst %.c,%.elf,$(filter-out $(LIB_FILES),$(wildcard *.c)))
9 9
10all: $(ALL_BUT_LIB) 10all: $(ALL_BUT_LIB)
diff --git a/utils/nwztools/plattools/nwz_lib.c b/utils/nwztools/plattools/nwz_lib.c
index 4ea1edee19..ebfe488a7d 100644
--- a/utils/nwztools/plattools/nwz_lib.c
+++ b/utils/nwztools/plattools/nwz_lib.c
@@ -20,6 +20,16 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "nwz_lib.h" 21#include "nwz_lib.h"
22 22
23extern struct nwz_dev_info_t g_nwz_dev_list[];
24
25const char *nwz_get_model_name(unsigned long model_id)
26{
27 for(int i = 0; g_nwz_dev_list[i].name; i++)
28 if(g_nwz_dev_list[i].model_id == model_id)
29 return g_nwz_dev_list[i].name;
30 return NULL;
31}
32
23void nwz_run(const char *file, const char *args[], bool wait) 33void nwz_run(const char *file, const char *args[], bool wait)
24{ 34{
25 pid_t child_pid = fork(); 35 pid_t child_pid = fork();
diff --git a/utils/nwztools/plattools/nwz_lib.h b/utils/nwztools/plattools/nwz_lib.h
index 1dd7b4c85b..5e1640a70e 100644
--- a/utils/nwztools/plattools/nwz_lib.h
+++ b/utils/nwztools/plattools/nwz_lib.h
@@ -37,6 +37,14 @@
37#include "nwz_ts.h" 37#include "nwz_ts.h"
38#include "nwz_power.h" 38#include "nwz_power.h"
39 39
40struct nwz_dev_info_t
41{
42 unsigned long model_id;
43 const char *name;
44};
45
46const char *nwz_get_model_name(unsigned long model_id);
47
40/* run a program and exit with nonzero status in case of error 48/* run a program and exit with nonzero status in case of error
41 * argument list must be NULL terminated */ 49 * argument list must be NULL terminated */
42void nwz_run(const char *file, const char *args[], bool wait); 50void nwz_run(const char *file, const char *args[], bool wait);
diff --git a/utils/nwztools/plattools/nwz_lib_devlist.c b/utils/nwztools/plattools/nwz_lib_devlist.c
new file mode 100644
index 0000000000..1631a0cbc5
--- /dev/null
+++ b/utils/nwztools/plattools/nwz_lib_devlist.c
@@ -0,0 +1,192 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2016 Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22/* NOTE: this file was automatically generated */
23#include "nwz_lib.h"
24
25struct nwz_dev_info_t g_nwz_dev_list[] =
26{
27 { 0x10000, "NWZ-A815" },
28 { 0x10001, "NWZ-A816" },
29 { 0x10002, "NWZ-A818" },
30 { 0x1000000, "NW-S615F" },
31 { 0x1000001, "NW-S616F" },
32 { 0x1010000, "NW-S715F" },
33 { 0x1010001, "NW-S716F" },
34 { 0x1010002, "NW-S718F" },
35 { 0x1020000, "NWZ-S615F" },
36 { 0x1020001, "NWZ-S616F" },
37 { 0x1020002, "NWZ-S618F" },
38 { 0x1030000, "NWZ-S515" },
39 { 0x1030001, "NWZ-S516" },
40 { 0x1040000, "NWZ-S715F" },
41 { 0x1040001, "NWZ-S716F" },
42 { 0x1040002, "NWZ-S718F" },
43 { 0x2000001, "NW-A916" },
44 { 0x2000002, "NW-A918" },
45 { 0x2000004, "NW-A919" },
46 { 0x3000001, "NWZ-A826" },
47 { 0x3000002, "NWZ-A828" },
48 { 0x3000004, "NWZ-A829" },
49 { 0x3010001, "NW-A826" },
50 { 0x3010002, "NW-A828" },
51 { 0x3010004, "NW-A829" },
52 { 0x3020001, "NWZ-A726B" },
53 { 0x3020002, "NWZ-A728B" },
54 { 0x3020004, "NWZ-A729B" },
55 { 0x3030001, "NWZ-A726" },
56 { 0x3030002, "NWZ-A728" },
57 { 0x3030004, "NWZ-A729" },
58 { 0x4000001, "NW-S636F" },
59 { 0x4000002, "NW-S638F" },
60 { 0x4000004, "NW-S639F" },
61 { 0x4010001, "NW-S736F" },
62 { 0x4010002, "NW-S738F" },
63 { 0x4010004, "NW-S739F" },
64 { 0x4020001, "NWZ-S636F" },
65 { 0x4020002, "NWZ-S638F" },
66 { 0x4020004, "NWZ-S639F" },
67 { 0x4030001, "NWZ-S736F" },
68 { 0x4030002, "NWZ-S738F" },
69 { 0x4030004, "NWZ-S739F" },
70 { 0x5000002, "NW-X1040" },
71 { 0x5000004, "NW-X1050" },
72 { 0x5000005, "NW-X1060" },
73 { 0x5010002, "NWZ-NONAME" },
74 { 0x5010004, "NWZ-NONAME" },
75 { 0x5010005, "NWZ-NONAME" },
76 { 0x5020002, "NWZ-X1040" },
77 { 0x5020004, "NWZ-X1050" },
78 { 0x5020005, "NWZ-X1060" },
79 { 0x5040002, "NWZ-X1041" },
80 { 0x5040004, "NWZ-X1051" },
81 { 0x5040005, "NWZ-X1061" },
82 { 0x6010002, "NW-S644" },
83 { 0x6010004, "NW-S645" },
84 { 0x6010005, "NW-S646" },
85 { 0x6020002, "NWZ-S744" },
86 { 0x6020004, "NWZ-S745" },
87 { 0x6020005, "NWZ-S746" },
88 { 0x6030002, "NW-S744" },
89 { 0x6030004, "NW-S745" },
90 { 0x6030005, "NW-S746" },
91 { 0x7000004, "NWZ-A845" },
92 { 0x7000005, "NWZ-A846" },
93 { 0x7000006, "NWZ-A847" },
94 { 0x7010004, "NW-A845" },
95 { 0x7010005, "NW-A846" },
96 { 0x7010006, "NW-A847" },
97 { 0x9000002, "NW-S754" },
98 { 0x9000004, "NW-S755" },
99 { 0x9000005, "NW-S756" },
100 { 0x8000000, "NW-E052" },
101 { 0x8000001, "NW-E053" },
102 { 0x8000002, "NW-E054" },
103 { 0xb000001, "NWZ-E453" },
104 { 0xb000002, "NWZ-E454" },
105 { 0xb000004, "NWZ-E455" },
106 { 0xc000001, "NWZ-E353" },
107 { 0xc000002, "NWZ-E354" },
108 { 0xc000004, "NWZ-E355" },
109 { 0xd000001, "NWZ-E553" },
110 { 0xd000002, "NWZ-E554" },
111 { 0xd000004, "NWZ-E555" },
112 { 0xd000005, "NWZ-E556" },
113 { 0xe000004, "NWZ-A855" },
114 { 0xe000005, "NWZ-A856" },
115 { 0xe000006, "NWZ-A857" },
116 { 0xf000002, "NWZ-S754" },
117 { 0xf000004, "NWZ-S755" },
118 { 0x10000000, "NWZ-E052" },
119 { 0x10000001, "NWZ-E053" },
120 { 0x11000001, "NW-A863" },
121 { 0x11000002, "NW-A864" },
122 { 0x11000004, "NW-A865" },
123 { 0x11000005, "NW-A866" },
124 { 0x11000006, "NW-A867" },
125 { 0x11010001, "NWZ-A863" },
126 { 0x11010002, "NWZ-A864" },
127 { 0x11010004, "NWZ-A865" },
128 { 0x11010005, "NWZ-A866" },
129 { 0x11010006, "NWZ-A867" },
130 { 0x11020001, "NWZ-A863" },
131 { 0x11020002, "NWZ-A864" },
132 { 0x11020004, "NWZ-A865" },
133 { 0x11020005, "NWZ-A866" },
134 { 0x11020006, "NWZ-A867" },
135 { 0x12000001, "NW-S763" },
136 { 0x12000002, "NW-S764" },
137 { 0x12000004, "NW-S765" },
138 { 0x12000005, "NW-S766" },
139 { 0x12000006, "NW-S767" },
140 { 0x12010001, "NWZ-S763" },
141 { 0x12010002, "NWZ-S764" },
142 { 0x12010004, "NWZ-S765" },
143 { 0x12010005, "NWZ-S766" },
144 { 0x12010006, "NWZ-S767" },
145 { 0x13000001, "NWZ-E463" },
146 { 0x13000002, "NWZ-E464" },
147 { 0x13000004, "NWZ-E465" },
148 { 0x14000000, "NW-E062" },
149 { 0x14000001, "NW-E063" },
150 { 0x14000002, "NW-E064" },
151 { 0x14000004, "NW-E065" },
152 { 0x14000005, "NW-E066" },
153 { 0x15000001, "NWZ-E473" },
154 { 0x15000002, "NWZ-E474" },
155 { 0x15000004, "NWZ-E475" },
156 { 0x15000005, "NWZ-E476" },
157 { 0x15010001, "NWZ-E573" },
158 { 0x15010002, "NWZ-E574" },
159 { 0x15010004, "NWZ-E575" },
160 { 0x15010005, "NWZ-E576" },
161 { 0x16000001, "NW-S773" },
162 { 0x16000002, "NW-S774" },
163 { 0x16000004, "NW-S775" },
164 { 0x16000005, "NW-S776" },
165 { 0x16010001, "NWZ-S773" },
166 { 0x16010002, "NWZ-S774" },
167 { 0x16010004, "NWZ-S775" },
168 { 0x16010005, "NWZ-S776" },
169 { 0x19000001, "NW-S783" },
170 { 0x19000002, "NW-S784" },
171 { 0x19000004, "NW-S785" },
172 { 0x19000005, "NW-S786" },
173 { 0x19010001, "NW-E083" },
174 { 0x19010002, "NW-E084" },
175 { 0x19010004, "NW-E085" },
176 { 0x19010005, "NW-E086" },
177 { 0x19020001, "NWZ-E583" },
178 { 0x19020002, "NWZ-E584" },
179 { 0x19020004, "NWZ-E585" },
180 { 0x19020005, "NWZ-E586" },
181 { 0x1a000001, "NW-A13" },
182 { 0x1a000002, "NW-A14" },
183 { 0x1a000004, "NW-A15" },
184 { 0x1a000005, "NW-A16" },
185 { 0x1a000006, "NW-A17" },
186 { 0x1a010001, "NWZ-A13" },
187 { 0x1a010002, "NWZ-A14" },
188 { 0x1a010004, "NWZ-A15" },
189 { 0x1a010005, "NWZ-A16" },
190 { 0x1a010006, "NWZ-A17" },
191 { 0, NULL },
192};