X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fkernel%2Frtas.c;h=fdfe14c4bdefc735640745625cb559fc4908a2fa;hb=4c098bcd55fad34dcf224bf8343db6a9ac58fc68;hp=1f8505c235482c5fea77a9f3fd1ec175a526a202;hpb=429b022af41108f6942d72547592b1d30e9a51f0;p=linux-2.6-omap-h63xx.git diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 1f8505c2354..fdfe14c4bde 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -566,6 +566,32 @@ int rtas_get_sensor(int sensor, int index, int *state) } EXPORT_SYMBOL(rtas_get_sensor); +bool rtas_indicator_present(int token, int *maxindex) +{ + int proplen, count, i; + const struct indicator_elem { + u32 token; + u32 maxindex; + } *indicators; + + indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); + if (!indicators) + return false; + + count = proplen / sizeof(struct indicator_elem); + + for (i = 0; i < count; i++) { + if (indicators[i].token != token) + continue; + if (maxindex) + *maxindex = indicators[i].maxindex; + return true; + } + + return false; +} +EXPORT_SYMBOL(rtas_indicator_present); + int rtas_set_indicator(int indicator, int index, int new_value) { int token = rtas_token("set-indicator");