ARM: bL_switcher: Add synchronous enable/disable interface
[linux-2.6-block.git] / arch / arm / common / bL_switcher.c
CommitLineData
1c33be57
NP
1/*
2 * arch/arm/common/bL_switcher.c -- big.LITTLE cluster switcher core driver
3 *
4 * Created by: Nicolas Pitre, March 2012
5 * Copyright: (C) 2012-2013 Linaro Limited
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/interrupt.h>
17#include <linux/cpu_pm.h>
71ce1dee 18#include <linux/cpu.h>
3f09d479 19#include <linux/cpumask.h>
71ce1dee
NP
20#include <linux/kthread.h>
21#include <linux/wait.h>
3f09d479
LP
22#include <linux/clockchips.h>
23#include <linux/hrtimer.h>
24#include <linux/tick.h>
1c33be57 25#include <linux/mm.h>
c0f43751 26#include <linux/mutex.h>
1c33be57 27#include <linux/string.h>
6b7437ae 28#include <linux/sysfs.h>
1c33be57 29#include <linux/irqchip/arm-gic.h>
c4821c05 30#include <linux/moduleparam.h>
1c33be57
NP
31
32#include <asm/smp_plat.h>
33#include <asm/suspend.h>
34#include <asm/mcpm.h>
35#include <asm/bL_switcher.h>
36
37
38/*
39 * Use our own MPIDR accessors as the generic ones in asm/cputype.h have
40 * __attribute_const__ and we don't want the compiler to assume any
41 * constness here as the value _does_ change along some code paths.
42 */
43
44static int read_mpidr(void)
45{
46 unsigned int id;
47 asm volatile ("mrc p15, 0, %0, c0, c0, 5" : "=r" (id));
48 return id & MPIDR_HWID_BITMASK;
49}
50
51/*
52 * bL switcher core code.
53 */
54
55static void bL_do_switch(void *_unused)
56{
38c35d4f 57 unsigned ib_mpidr, ib_cpu, ib_cluster;
1c33be57 58
1c33be57
NP
59 pr_debug("%s\n", __func__);
60
38c35d4f
NP
61 ib_mpidr = cpu_logical_map(smp_processor_id());
62 ib_cpu = MPIDR_AFFINITY_LEVEL(ib_mpidr, 0);
63 ib_cluster = MPIDR_AFFINITY_LEVEL(ib_mpidr, 1);
1c33be57
NP
64
65 /*
66 * Our state has been saved at this point. Let's release our
67 * inbound CPU.
68 */
38c35d4f 69 mcpm_set_entry_vector(ib_cpu, ib_cluster, cpu_resume);
1c33be57
NP
70 sev();
71
72 /*
73 * From this point, we must assume that our counterpart CPU might
74 * have taken over in its parallel world already, as if execution
75 * just returned from cpu_suspend(). It is therefore important to
76 * be very careful not to make any change the other guy is not
77 * expecting. This is why we need stack isolation.
78 *
79 * Fancy under cover tasks could be performed here. For now
80 * we have none.
81 */
82
83 /* Let's put ourself down. */
84 mcpm_cpu_power_down();
85
86 /* should never get here */
87 BUG();
88}
89
90/*
c052de26
NP
91 * Stack isolation. To ensure 'current' remains valid, we just use another
92 * piece of our thread's stack space which should be fairly lightly used.
93 * The selected area starts just above the thread_info structure located
94 * at the very bottom of the stack, aligned to a cache line, and indexed
95 * with the cluster number.
1c33be57 96 */
c052de26 97#define STACK_SIZE 512
1c33be57
NP
98extern void call_with_stack(void (*fn)(void *), void *arg, void *sp);
99static int bL_switchpoint(unsigned long _arg)
100{
101 unsigned int mpidr = read_mpidr();
1c33be57 102 unsigned int clusterid = MPIDR_AFFINITY_LEVEL(mpidr, 1);
c052de26 103 void *stack = current_thread_info() + 1;
1c33be57 104 stack = PTR_ALIGN(stack, L1_CACHE_BYTES);
c052de26 105 stack += clusterid * STACK_SIZE + STACK_SIZE;
1c33be57
NP
106 call_with_stack(bL_do_switch, (void *)_arg, stack);
107 BUG();
108}
109
110/*
111 * Generic switcher interface
112 */
113
ed96762e 114static unsigned int bL_gic_id[MAX_CPUS_PER_CLUSTER][MAX_NR_CLUSTERS];
38c35d4f 115static int bL_switcher_cpu_pairing[NR_CPUS];
ed96762e 116
1c33be57
NP
117/*
118 * bL_switch_to - Switch to a specific cluster for the current CPU
119 * @new_cluster_id: the ID of the cluster to switch to.
120 *
121 * This function must be called on the CPU to be switched.
122 * Returns 0 on success, else a negative status code.
123 */
124static int bL_switch_to(unsigned int new_cluster_id)
125{
38c35d4f
NP
126 unsigned int mpidr, this_cpu, that_cpu;
127 unsigned int ob_mpidr, ob_cpu, ob_cluster, ib_mpidr, ib_cpu, ib_cluster;
3f09d479
LP
128 struct tick_device *tdev;
129 enum clock_event_mode tdev_mode;
1c33be57
NP
130 int ret;
131
38c35d4f
NP
132 this_cpu = smp_processor_id();
133 ob_mpidr = read_mpidr();
134 ob_cpu = MPIDR_AFFINITY_LEVEL(ob_mpidr, 0);
135 ob_cluster = MPIDR_AFFINITY_LEVEL(ob_mpidr, 1);
136 BUG_ON(cpu_logical_map(this_cpu) != ob_mpidr);
1c33be57 137
38c35d4f 138 if (new_cluster_id == ob_cluster)
1c33be57
NP
139 return 0;
140
38c35d4f
NP
141 that_cpu = bL_switcher_cpu_pairing[this_cpu];
142 ib_mpidr = cpu_logical_map(that_cpu);
143 ib_cpu = MPIDR_AFFINITY_LEVEL(ib_mpidr, 0);
144 ib_cluster = MPIDR_AFFINITY_LEVEL(ib_mpidr, 1);
145
146 pr_debug("before switch: CPU %d MPIDR %#x -> %#x\n",
147 this_cpu, ob_mpidr, ib_mpidr);
1c33be57
NP
148
149 /* Close the gate for our entry vectors */
38c35d4f
NP
150 mcpm_set_entry_vector(ob_cpu, ob_cluster, NULL);
151 mcpm_set_entry_vector(ib_cpu, ib_cluster, NULL);
1c33be57
NP
152
153 /*
154 * Let's wake up the inbound CPU now in case it requires some delay
155 * to come online, but leave it gated in our entry vector code.
156 */
38c35d4f 157 ret = mcpm_cpu_power_up(ib_cpu, ib_cluster);
1c33be57
NP
158 if (ret) {
159 pr_err("%s: mcpm_cpu_power_up() returned %d\n", __func__, ret);
160 return ret;
161 }
162
163 /*
164 * From this point we are entering the switch critical zone
165 * and can't take any interrupts anymore.
166 */
167 local_irq_disable();
168 local_fiq_disable();
169
1c33be57 170 /* redirect GIC's SGIs to our counterpart */
38c35d4f 171 gic_migrate_target(bL_gic_id[ib_cpu][ib_cluster]);
1c33be57
NP
172
173 /*
174 * Raise a SGI on the inbound CPU to make sure it doesn't stall
175 * in a possible WFI, such as in mcpm_power_down().
176 */
177 arch_send_wakeup_ipi_mask(cpumask_of(this_cpu));
178
3f09d479
LP
179 tdev = tick_get_device(this_cpu);
180 if (tdev && !cpumask_equal(tdev->evtdev->cpumask, cpumask_of(this_cpu)))
181 tdev = NULL;
182 if (tdev) {
183 tdev_mode = tdev->evtdev->mode;
184 clockevents_set_mode(tdev->evtdev, CLOCK_EVT_MODE_SHUTDOWN);
185 }
186
1c33be57
NP
187 ret = cpu_pm_enter();
188
189 /* we can not tolerate errors at this point */
190 if (ret)
191 panic("%s: cpu_pm_enter() returned %d\n", __func__, ret);
192
38c35d4f
NP
193 /* Swap the physical CPUs in the logical map for this logical CPU. */
194 cpu_logical_map(this_cpu) = ib_mpidr;
195 cpu_logical_map(that_cpu) = ob_mpidr;
1c33be57
NP
196
197 /* Let's do the actual CPU switch. */
198 ret = cpu_suspend(0, bL_switchpoint);
199 if (ret > 0)
200 panic("%s: cpu_suspend() returned %d\n", __func__, ret);
201
202 /* We are executing on the inbound CPU at this point */
203 mpidr = read_mpidr();
38c35d4f
NP
204 pr_debug("after switch: CPU %d MPIDR %#x\n", this_cpu, mpidr);
205 BUG_ON(mpidr != ib_mpidr);
1c33be57
NP
206
207 mcpm_cpu_powered_up();
208
209 ret = cpu_pm_exit();
210
3f09d479
LP
211 if (tdev) {
212 clockevents_set_mode(tdev->evtdev, tdev_mode);
213 clockevents_program_event(tdev->evtdev,
214 tdev->evtdev->next_event, 1);
215 }
216
1c33be57
NP
217 local_fiq_enable();
218 local_irq_enable();
219
220 if (ret)
221 pr_err("%s exiting with error %d\n", __func__, ret);
222 return ret;
223}
224
71ce1dee
NP
225struct bL_thread {
226 struct task_struct *task;
227 wait_queue_head_t wq;
228 int wanted_cluster;
6b7437ae 229 struct completion started;
1c33be57
NP
230};
231
71ce1dee
NP
232static struct bL_thread bL_threads[NR_CPUS];
233
234static int bL_switcher_thread(void *arg)
235{
236 struct bL_thread *t = arg;
237 struct sched_param param = { .sched_priority = 1 };
238 int cluster;
239
240 sched_setscheduler_nocheck(current, SCHED_FIFO, &param);
6b7437ae 241 complete(&t->started);
71ce1dee
NP
242
243 do {
244 if (signal_pending(current))
245 flush_signals(current);
246 wait_event_interruptible(t->wq,
247 t->wanted_cluster != -1 ||
248 kthread_should_stop());
249 cluster = xchg(&t->wanted_cluster, -1);
250 if (cluster != -1)
251 bL_switch_to(cluster);
252 } while (!kthread_should_stop());
253
254 return 0;
255}
256
6b7437ae 257static struct task_struct *bL_switcher_thread_create(int cpu, void *arg)
1c33be57 258{
71ce1dee
NP
259 struct task_struct *task;
260
261 task = kthread_create_on_node(bL_switcher_thread, arg,
262 cpu_to_node(cpu), "kswitcher_%d", cpu);
263 if (!IS_ERR(task)) {
264 kthread_bind(task, cpu);
265 wake_up_process(task);
266 } else
267 pr_err("%s failed for CPU %d\n", __func__, cpu);
268 return task;
1c33be57
NP
269}
270
271/*
272 * bL_switch_request - Switch to a specific cluster for the given CPU
273 *
274 * @cpu: the CPU to switch
275 * @new_cluster_id: the ID of the cluster to switch to.
276 *
71ce1dee
NP
277 * This function causes a cluster switch on the given CPU by waking up
278 * the appropriate switcher thread. This function may or may not return
279 * before the switch has occurred.
1c33be57 280 */
71ce1dee 281int bL_switch_request(unsigned int cpu, unsigned int new_cluster_id)
1c33be57 282{
71ce1dee 283 struct bL_thread *t;
1c33be57 284
71ce1dee
NP
285 if (cpu >= ARRAY_SIZE(bL_threads)) {
286 pr_err("%s: cpu %d out of bounds\n", __func__, cpu);
287 return -EINVAL;
1c33be57 288 }
1c33be57 289
71ce1dee
NP
290 t = &bL_threads[cpu];
291 if (IS_ERR(t->task))
292 return PTR_ERR(t->task);
293 if (!t->task)
294 return -ESRCH;
295
296 t->wanted_cluster = new_cluster_id;
297 wake_up(&t->wq);
298 return 0;
1c33be57
NP
299}
300EXPORT_SYMBOL_GPL(bL_switch_request);
71ce1dee 301
9797a0e9
NP
302/*
303 * Activation and configuration code.
304 */
305
c0f43751 306static DEFINE_MUTEX(bL_switcher_activation_lock);
6b7437ae 307static unsigned int bL_switcher_active;
38c35d4f 308static unsigned int bL_switcher_cpu_original_cluster[NR_CPUS];
9797a0e9
NP
309static cpumask_t bL_switcher_removed_logical_cpus;
310
6b7437ae 311static void bL_switcher_restore_cpus(void)
9797a0e9
NP
312{
313 int i;
314
315 for_each_cpu(i, &bL_switcher_removed_logical_cpus)
316 cpu_up(i);
317}
318
6b7437ae 319static int bL_switcher_halve_cpus(void)
9797a0e9 320{
38c35d4f
NP
321 int i, j, cluster_0, gic_id, ret;
322 unsigned int cpu, cluster, mask;
323 cpumask_t available_cpus;
9797a0e9 324
38c35d4f
NP
325 /* First pass to validate what we have */
326 mask = 0;
9797a0e9 327 for_each_online_cpu(i) {
38c35d4f
NP
328 cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 0);
329 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 1);
9797a0e9
NP
330 if (cluster >= 2) {
331 pr_err("%s: only dual cluster systems are supported\n", __func__);
332 return -EINVAL;
333 }
38c35d4f
NP
334 if (WARN_ON(cpu >= MAX_CPUS_PER_CLUSTER))
335 return -EINVAL;
336 mask |= (1 << cluster);
9797a0e9 337 }
38c35d4f
NP
338 if (mask != 3) {
339 pr_err("%s: no CPU pairing possible\n", __func__);
9797a0e9
NP
340 return -EINVAL;
341 }
342
38c35d4f
NP
343 /*
344 * Now let's do the pairing. We match each CPU with another CPU
345 * from a different cluster. To get a uniform scheduling behavior
346 * without fiddling with CPU topology and compute capacity data,
347 * we'll use logical CPUs initially belonging to the same cluster.
348 */
349 memset(bL_switcher_cpu_pairing, -1, sizeof(bL_switcher_cpu_pairing));
350 cpumask_copy(&available_cpus, cpu_online_mask);
351 cluster_0 = -1;
352 for_each_cpu(i, &available_cpus) {
353 int match = -1;
354 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 1);
355 if (cluster_0 == -1)
356 cluster_0 = cluster;
357 if (cluster != cluster_0)
358 continue;
359 cpumask_clear_cpu(i, &available_cpus);
360 for_each_cpu(j, &available_cpus) {
361 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(j), 1);
9797a0e9 362 /*
38c35d4f
NP
363 * Let's remember the last match to create "odd"
364 * pairings on purpose in order for other code not
365 * to assume any relation between physical and
366 * logical CPU numbers.
9797a0e9 367 */
38c35d4f
NP
368 if (cluster != cluster_0)
369 match = j;
370 }
371 if (match != -1) {
372 bL_switcher_cpu_pairing[i] = match;
373 cpumask_clear_cpu(match, &available_cpus);
374 pr_info("CPU%d paired with CPU%d\n", i, match);
375 }
376 }
377
378 /*
379 * Now we disable the unwanted CPUs i.e. everything that has no
380 * pairing information (that includes the pairing counterparts).
381 */
382 cpumask_clear(&bL_switcher_removed_logical_cpus);
383 for_each_online_cpu(i) {
384 cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 0);
385 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(i), 1);
386
387 /* Let's take note of the GIC ID for this CPU */
388 gic_id = gic_get_cpu_id(i);
389 if (gic_id < 0) {
390 pr_err("%s: bad GIC ID for CPU %d\n", __func__, i);
391 bL_switcher_restore_cpus();
392 return -EINVAL;
393 }
394 bL_gic_id[cpu][cluster] = gic_id;
395 pr_info("GIC ID for CPU %u cluster %u is %u\n",
396 cpu, cluster, gic_id);
397
398 if (bL_switcher_cpu_pairing[i] != -1) {
399 bL_switcher_cpu_original_cluster[i] = cluster;
400 continue;
9797a0e9
NP
401 }
402
403 ret = cpu_down(i);
404 if (ret) {
405 bL_switcher_restore_cpus();
406 return ret;
407 }
408 cpumask_set_cpu(i, &bL_switcher_removed_logical_cpus);
409 }
410
411 return 0;
412}
413
6b7437ae 414static int bL_switcher_enable(void)
71ce1dee 415{
9797a0e9 416 int cpu, ret;
71ce1dee 417
c0f43751 418 mutex_lock(&bL_switcher_activation_lock);
6b7437ae
NP
419 cpu_hotplug_driver_lock();
420 if (bL_switcher_active) {
421 cpu_hotplug_driver_unlock();
c0f43751 422 mutex_unlock(&bL_switcher_activation_lock);
6b7437ae 423 return 0;
9797a0e9
NP
424 }
425
6b7437ae
NP
426 pr_info("big.LITTLE switcher initializing\n");
427
9797a0e9
NP
428 ret = bL_switcher_halve_cpus();
429 if (ret) {
430 cpu_hotplug_driver_unlock();
c0f43751 431 mutex_unlock(&bL_switcher_activation_lock);
9797a0e9
NP
432 return ret;
433 }
434
71ce1dee
NP
435 for_each_online_cpu(cpu) {
436 struct bL_thread *t = &bL_threads[cpu];
437 init_waitqueue_head(&t->wq);
6b7437ae 438 init_completion(&t->started);
71ce1dee
NP
439 t->wanted_cluster = -1;
440 t->task = bL_switcher_thread_create(cpu, t);
441 }
6b7437ae
NP
442
443 bL_switcher_active = 1;
71ce1dee 444 pr_info("big.LITTLE switcher initialized\n");
c0f43751
DM
445
446 cpu_hotplug_driver_unlock();
447 mutex_unlock(&bL_switcher_activation_lock);
71ce1dee
NP
448 return 0;
449}
450
6b7437ae
NP
451#ifdef CONFIG_SYSFS
452
453static void bL_switcher_disable(void)
454{
38c35d4f 455 unsigned int cpu, cluster;
6b7437ae
NP
456 struct bL_thread *t;
457 struct task_struct *task;
458
c0f43751 459 mutex_lock(&bL_switcher_activation_lock);
6b7437ae
NP
460 cpu_hotplug_driver_lock();
461 if (!bL_switcher_active) {
462 cpu_hotplug_driver_unlock();
c0f43751 463 mutex_unlock(&bL_switcher_activation_lock);
6b7437ae
NP
464 return;
465 }
466 bL_switcher_active = 0;
467
468 /*
469 * To deactivate the switcher, we must shut down the switcher
470 * threads to prevent any other requests from being accepted.
471 * Then, if the final cluster for given logical CPU is not the
472 * same as the original one, we'll recreate a switcher thread
473 * just for the purpose of switching the CPU back without any
474 * possibility for interference from external requests.
475 */
476 for_each_online_cpu(cpu) {
6b7437ae
NP
477 t = &bL_threads[cpu];
478 task = t->task;
479 t->task = NULL;
480 if (!task || IS_ERR(task))
481 continue;
482 kthread_stop(task);
483 /* no more switch may happen on this CPU at this point */
484 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 1);
485 if (cluster == bL_switcher_cpu_original_cluster[cpu])
486 continue;
487 init_completion(&t->started);
488 t->wanted_cluster = bL_switcher_cpu_original_cluster[cpu];
489 task = bL_switcher_thread_create(cpu, t);
490 if (!IS_ERR(task)) {
491 wait_for_completion(&t->started);
492 kthread_stop(task);
493 cluster = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 1);
494 if (cluster == bL_switcher_cpu_original_cluster[cpu])
495 continue;
496 }
497 /* If execution gets here, we're in trouble. */
498 pr_crit("%s: unable to restore original cluster for CPU %d\n",
499 __func__, cpu);
38c35d4f
NP
500 pr_crit("%s: CPU %d can't be restored\n",
501 __func__, bL_switcher_cpu_pairing[cpu]);
502 cpumask_clear_cpu(bL_switcher_cpu_pairing[cpu],
503 &bL_switcher_removed_logical_cpus);
6b7437ae
NP
504 }
505
506 bL_switcher_restore_cpus();
507 cpu_hotplug_driver_unlock();
c0f43751 508 mutex_unlock(&bL_switcher_activation_lock);
6b7437ae
NP
509}
510
511static ssize_t bL_switcher_active_show(struct kobject *kobj,
512 struct kobj_attribute *attr, char *buf)
513{
514 return sprintf(buf, "%u\n", bL_switcher_active);
515}
516
517static ssize_t bL_switcher_active_store(struct kobject *kobj,
518 struct kobj_attribute *attr, const char *buf, size_t count)
519{
520 int ret;
521
522 switch (buf[0]) {
523 case '0':
524 bL_switcher_disable();
525 ret = 0;
526 break;
527 case '1':
528 ret = bL_switcher_enable();
529 break;
530 default:
531 ret = -EINVAL;
532 }
533
534 return (ret >= 0) ? count : ret;
535}
536
537static struct kobj_attribute bL_switcher_active_attr =
538 __ATTR(active, 0644, bL_switcher_active_show, bL_switcher_active_store);
539
540static struct attribute *bL_switcher_attrs[] = {
541 &bL_switcher_active_attr.attr,
542 NULL,
543};
544
545static struct attribute_group bL_switcher_attr_group = {
546 .attrs = bL_switcher_attrs,
547};
548
549static struct kobject *bL_switcher_kobj;
550
551static int __init bL_switcher_sysfs_init(void)
552{
553 int ret;
554
555 bL_switcher_kobj = kobject_create_and_add("bL_switcher", kernel_kobj);
556 if (!bL_switcher_kobj)
557 return -ENOMEM;
558 ret = sysfs_create_group(bL_switcher_kobj, &bL_switcher_attr_group);
559 if (ret)
560 kobject_put(bL_switcher_kobj);
561 return ret;
562}
563
564#endif /* CONFIG_SYSFS */
565
c0f43751
DM
566bool bL_switcher_get_enabled(void)
567{
568 mutex_lock(&bL_switcher_activation_lock);
569
570 return bL_switcher_active;
571}
572EXPORT_SYMBOL_GPL(bL_switcher_get_enabled);
573
574void bL_switcher_put_enabled(void)
575{
576 mutex_unlock(&bL_switcher_activation_lock);
577}
578EXPORT_SYMBOL_GPL(bL_switcher_put_enabled);
579
27261435
NP
580/*
581 * Veto any CPU hotplug operation on those CPUs we've removed
582 * while the switcher is active.
583 * We're just not ready to deal with that given the trickery involved.
584 */
585static int bL_switcher_hotplug_callback(struct notifier_block *nfb,
586 unsigned long action, void *hcpu)
587{
588 if (bL_switcher_active) {
589 int pairing = bL_switcher_cpu_pairing[(unsigned long)hcpu];
590 switch (action & 0xf) {
591 case CPU_UP_PREPARE:
592 case CPU_DOWN_PREPARE:
593 if (pairing == -1)
594 return NOTIFY_BAD;
595 }
596 }
597 return NOTIFY_DONE;
598}
599
c4821c05
NP
600static bool no_bL_switcher;
601core_param(no_bL_switcher, no_bL_switcher, bool, 0644);
602
6b7437ae
NP
603static int __init bL_switcher_init(void)
604{
605 int ret;
606
607 if (MAX_NR_CLUSTERS != 2) {
608 pr_err("%s: only dual cluster systems are supported\n", __func__);
609 return -EINVAL;
610 }
611
27261435
NP
612 cpu_notifier(bL_switcher_hotplug_callback, 0);
613
c4821c05
NP
614 if (!no_bL_switcher) {
615 ret = bL_switcher_enable();
616 if (ret)
617 return ret;
618 }
6b7437ae
NP
619
620#ifdef CONFIG_SYSFS
621 ret = bL_switcher_sysfs_init();
622 if (ret)
623 pr_err("%s: unable to create sysfs entry\n", __func__);
624#endif
625
626 return 0;
627}
628
71ce1dee 629late_initcall(bL_switcher_init);