linux/drivers/acpi/bgrt.c
<<
v4.14./spae=" 14./form=" 14.a v4.14 href="../linux+v3.7.3/drivers/acpi/bgrt.c"> v4.14.img src="../.static/gfx/right.png" alt=">>"> v./spae=" v.spae class="lxr_search"> v4. v4.14.input typv3.hidden" namv3.navtarget" > v3."> v4.14.input typv3.text" namv3.search" id3.search"> v4.14.butt typv3.submit">Search v4.14Prefs" 14./a> v./spae="4.14 4./div="4.14 4.form acalue="ajax+*" method="post" onsubmit="return false;"> v.input typv3.hidden" namv3.ajax_lookup" id3.ajax_lookup" > v3."> 4.14 4./form=" 4.14 4.div class="headingbott m">" .div id3.file_contents"=
4 41./a>.spae class="comment">/*./spae="4 42./a>.spae class="comment"> * Copyright 2012 Red Hat, Inc <mjg@redhat.com>./spae="4 43./a>.spae class="comment"> * Copyright 2012 Intel Corporaalue./spae="4 44./a>.spae class="comment"> *./spae="4 45./a>.spae class="comment"> * This program is free software; you cae redistribute it and/or modify./spae="4 46./a>.spae class="comment"> * it under the terms of the GNU General Public License vers
	  2 as./spae="4 47./a>.spae class="comment"> * published by the Free Software Foundaalue../spae="4 48./a>.spae class="comment"> */./spae="4 49./a> 4 tiona>#include <linux/kernel.hona>> 4 11ona>#include <linux/module.hona>> 4 12ona>#include <linux/init.hona>> 4 13ona>#include <linux/device.hona>> 4 14ona>#include <linux/sysfs.hona>> 4 15ona>#include <linux/efi-bgrt.hona>> 4 16./a> 4 17./a>static struct4.a href="+code=kobject" class="sref">kobject./a> *.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>; 4 18./a> 4 19./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_vers
	 " class="sref">show_vers
	 ./a>(struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a>,"4 2iona>                            struct4.a href="+code=device_attribute" class="sref">device_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>)"4 21ona>{"4 22ona>        return .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE./a>, .spae class="string">"%d\n"./spae=, .a href="+code=bgrt_tab" class="sref">bgrt_tab./a>->.a href="+code=vers
	 " class="sref">vers
	 ./a>); 4 23ona>} 4 24./a>static .a href="+code=DEVICE_ATTR" class="sref">DEVICE_ATTR./a>(.a href="+code=vers
	 " class="sref">vers
	 ./a>, .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>, .a href="+code=show_vers
	 " class="sref">show_vers
	 ./a>, .a href="+code=NULL" class="sref">NULL./a>); 4 25./a> 4 26./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_status" class="sref">show_status./a>(struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a>,"4 27ona>                           struct4.a href="+code=device_attribute" class="sref">device_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>)"4 28ona>{"4 29ona>        return .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE./a>, .spae class="string">"%d\n"./spae=, .a href="+code=bgrt_tab" class="sref">bgrt_tab./a>->.a href="+code=status" class="sref">status./a>); 4 30ona>} 4 31./a>static .a href="+code=DEVICE_ATTR" class="sref">DEVICE_ATTR./a>(.a href="+code=status" class="sref">status./a>, .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>, .a href="+code=show_status" class="sref">show_status./a>, .a href="+code=NULL" class="sref">NULL./a>); 4 32./a> 4 33./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_typv" class="sref">show_typv./a>(struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a>,"4 34ona>                         struct4.a href="+code=device_attribute" class="sref">device_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>)"4 35ona>{"4 36ona>        return .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE./a>, .spae class="string">"%d\n"./spae=, .a href="+code=bgrt_tab" class="sref">bgrt_tab./a>->.a href="+code=image_typv" class="sref">image_typv./a>); 4 37ona>} 4 38./a>static .a href="+code=DEVICE_ATTR" class="sref">DEVICE_ATTR./a>(.a href="+code=typv" class="sref">typv./a>, .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>, .a href="+code=show_typv" class="sref">show_typv./a>, .a href="+code=NULL" class="sref">NULL./a>); 4 39./a> 4 40./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_xoffset" class="sref">show_xoffset./a>(struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a>,"4 41ona>                            struct4.a href="+code=device_attribute" class="sref">device_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>)"4 42ona>{"4 43ona>        return .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE./a>, .spae class="string">"%d\n"./spae=, .a href="+code=bgrt_tab" class="sref">bgrt_tab./a>->.a href="+code=image_offset_x" class="sref">image_offset_x./a>); 4 44ona>} 4 45./a>static .a href="+code=DEVICE_ATTR" class="sref">DEVICE_ATTR./a>(.a href="+code=xoffset" class="sref">xoffset./a>, .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>, .a href="+code=show_xoffset" class="sref">show_xoffset./a>, .a href="+code=NULL" class="sref">NULL./a>); 4 46./a> 4 47./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_yoffset" class="sref">show_yoffset./a>(struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a>,"4 48ona>                            struct4.a href="+code=device_attribute" class="sref">device_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>)"4 49ona>{"4 50ona>        return .a href="+code=snprintf" class="sref">snprintf./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=PAGE_SIZE" class="sref">PAGE_SIZE./a>, .spae class="string">"%d\n"./spae=, .a href="+code=bgrt_tab" class="sref">bgrt_tab./a>->.a href="+code=image_offset_y" class="sref">image_offset_y./a>); 4 51ona>} 4 52./a>static .a href="+code=DEVICE_ATTR" class="sref">DEVICE_ATTR./a>(.a href="+code=yoffset" class="sref">yoffset./a>, .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>, .a href="+code=show_yoffset" class="sref">show_yoffset./a>, .a href="+code=NULL" class="sref">NULL./a>); 4 53./a> 4 54./a>static .a href="+code=ssize_t" class="sref">ssize_t./a> .a href="+code=show_image" class="sref">show_image./a>(struct4.a href="+code=file" class="sref">file./a> *.a href="+code=file" class="sref">file./a>, struct4.a href="+code=kobject" class="sref">kobject./a> *.a href="+code=kobj" class="sref">kobj./a>,"4 55ona>               struct4.a href="+code=bin_attribute" class="sref">bin_attribute./a> *.a href="+code=attr" class="sref">attr./a>, char *.a href="+code=buf" class="sref">buf./a>, .a href="+code=loff_t" class="sref">loff_t./a> .a href="+code=off" class="sref">off./a>, .a href="+code=size_t" class="sref">size_t./a> .a href="+code=count" class="sref">count./a>)"4 56ona>{"4 57ona>        .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=buf" class="sref">buf./a>, .a href="+code=attr" class="sref">attr./a>->.a href="+code=private" class="sref">privateona> + .a href="+code=off" class="sref">off./a>, .a href="+code=count" class="sref">count./a>); 4 58ona>        return .a href="+code=count" class="sref">count./a>; 4 59ona>} 4 60./a> 4 61./a>static struct4.a href="+code=bin_attribute" class="sref">bin_attribute./a> .a href="+code=image_attr" class="sref">image_attr./a> = {"4 62ona>        ..a href="+code=attr" class="sref">attr./a> = {"4 63ona>                ..a href="+code=namv" class="sref">namv./a> = .spae class="string">"image"./spae=,"4 64ona>                ..a href="+code=mode" class="sref">mode./a> = .a href="+code=S_IRUGO" class="sref">S_IRUGO./a>,"4 65ona>        },"4 66ona>        ..a href="+code=read" class="sref">read./a> = .a href="+code=show_image" class="sref">show_image./a>,"4 67ona>}; 4 68./a> 4 69./a>static struct4.a href="+code=attribute" class="sref">attribute./a> *.a href="+code=bgrt_attributes" class="sref">bgrt_attributes./a>[] = {"4 70ona>        &.a href="+code=dev_attr_vers
	 " class="sref">dev_attr_vers
	 ona>..a href="+code=attr" class="sref">attr./a>,"4 71ona>        &.a href="+code=dev_attr_status" class="sref">dev_attr_statusona>..a href="+code=attr" class="sref">attr./a>,"4 72ona>        &.a href="+code=dev_attr_typv" class="sref">dev_attr_typvona>..a href="+code=attr" class="sref">attr./a>,"4 73ona>        &.a href="+code=dev_attr_xoffset" class="sref">dev_attr_xoffsetona>..a href="+code=attr" class="sref">attr./a>,"4 74ona>        &.a href="+code=dev_attr_yoffset" class="sref">dev_attr_yoffsetona>..a href="+code=attr" class="sref">attr./a>,"4 75ona>        .a href="+code=NULL" class="sref">NULL./a>,"4 76ona>}; 4 77./a> 4 78./a>static struct4.a href="+code=attribute_group" class="sref">attribute_group./a> .a href="+code=bgrt_attribute_group" class="sref">bgrt_attribute_group./a> = {"4 79ona>        ..a href="+code=attrs" class="sref">attrs./a> = .a href="+code=bgrt_attributes" class="sref">bgrt_attributes./a>,"4 80ona>}; 4 81./a> 4 82./a>static int4.a href="+code=__init" class="sref">__init./a> .a href="+code=bgrt_init" class="sref">bgrt_init./a>(void)"4 83ona>{"4 84ona>        int4.a href="+code=ret" class="sref">ret./a>; 4 85./a> 4 86ona>        if (!.a href="+code=bgrt_image" class="sref">bgrt_image./a>)"4 87ona>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>; 4 88./a> 4 89ona>        .a href="+code=sysfs_bin_attr_init" class="sref">sysfs_bin_attr_init./a>(&.a href="+code=image_attr" class="sref">image_attr./a>); 4 90ona>        .a href="+code=image_attr" class="sref">image_attr./a>..a href="+code=private" class="sref">privateona> = .a href="+code=bgrt_image" class="sref">bgrt_image./a>; 4 91ona>        .a href="+code=image_attr" class="sref">image_attr./a>..a href="+code=size" class="sref">sizeona> = .a href="+code=bgrt_image_size" class="sref">bgrt_image_size./a>; 4 92./a> 4 93ona>        .a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a> = .a href="+code=kobject_create_and_add" class="sref">kobject_create_and_add./a>(.spae class="string">"bgrt"./spae=, .a href="+code=acpi_kobj" class="sref">acpi_kobj./a>); 4 94ona>        if (!.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>)"4 95ona>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4 96./a> 4 97ona>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=sysfs_create_group" class="sref">sysfs_create_group./a>(.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>, &.a href="+code=bgrt_attribute_group" class="sref">bgrt_attribute_group./a>); 4 98ona>        if (.a href="+code=ret" class="sref">ret./a>)"4 99ona>                goto .a href="+code=out_kobject" class="sref">out_kobject./a>; 4100./a> 4101ona>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=sysfs_create_bin_file" class="sref">sysfs_create_bin_file./a>(.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>, &.a href="+code=image_attr" class="sref">image_attr./a>); 4102ona>        if (.a href="+code=ret" class="sref">ret./a>)"4103ona>                goto .a href="+code=out_group" class="sref">out_group./a>; 4104./a> 4105ona>        return 0; 4106./a> 4107./a>.a href="+code=out_group" class="sref">out_group./a>: 4108ona>        .a href="+code=sysfs_remove_group" class="sref">sysfs_remove_group./a>(.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>, &.a href="+code=bgrt_attribute_group" class="sref">bgrt_attribute_group./a>); 4109./a>.a href="+code=out_kobject" class="sref">out_kobject./a>: 4110ona>        .a href="+code=kobject_put" class="sref">kobject_put./a>(.a href="+code=bgrt_kobj" class="sref">bgrt_kobj./a>); 4111ona>        return .a href="+code=ret" class="sref">ret./a>; 4112ona>} 4113./a> 4114ona>.a href="+code=module_init" class="sref">module_init./a>(.a href="+code=bgrt_init" class="sref">bgrt_init./a>); 4115./a> 4116./a>.a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR./a>(.spae class="string">"Matthew Garrett, Josh Triplett <josh@joshtriplett.org>"./spae=); 4117./a>.a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION./a>(.spae class="string">"BGRT boot graphic support"./spae=); 4118./a>.a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE./a>(.spae class="string">"GPL"./spae=); 4119./a>
The original LXR software by the LXR community./a>, this experimental vers by lxr@linux.no./a>. ./div=".div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consulting and operaalues services since 1995. ./div=" ./body="./html="