€•è/Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ0/translations/zh_CN/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/admin-guide/gpio/gpio-mockup”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ%SPDX-License-Identifier: GPL-2.0-only”h]”hŒ%SPDX-License-Identifier: GPL-2.0-only”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒJ/var/lib/git/docbuild/linux/Documentation/admin-guide/gpio/gpio-mockup.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒGPIO Testing Driver”h]”hŒGPIO Testing Driver”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒnote”“”)”}”(hŒýThis module has been obsoleted by the more flexible gpio-sim.rst. New developments should use that API and existing developments are encouraged to migrate as soon as possible. This module will continue to be maintained but no new features will be added.”h]”hŒ paragraph”“”)”}”(hŒýThis module has been obsoleted by the more flexible gpio-sim.rst. New developments should use that API and existing developments are encouraged to migrate as soon as possible. This module will continue to be maintained but no new features will be added.”h]”hŒýThis module has been obsoleted by the more flexible gpio-sim.rst. New developments should use that API and existing developments are encouraged to migrate as soon as possible. This module will continue to be maintained but no new features will be added.”…””}”(hhÑhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KhhËubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhh¶hžhhŸh³h NubhÐ)”}”(hXThe GPIO Testing Driver (gpio-mockup) provides a way to create simulated GPIO chips for testing purposes. The lines exposed by these chips can be accessed using the standard GPIO character device interface as well as manipulated using the dedicated debugfs directory structure.”h]”hXThe GPIO Testing Driver (gpio-mockup) provides a way to create simulated GPIO chips for testing purposes. The lines exposed by these chips can be accessed using the standard GPIO character device interface as well as manipulated using the dedicated debugfs directory structure.”…””}”(hhåhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒ,Creating simulated chips using module params”h]”hŒ,Creating simulated chips using module params”…””}”(hhöhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhóhžhhŸh³h KubhÐ)”}”(hŒWWhen loading the gpio-mockup driver a number of parameters can be passed to the module.”h]”hŒWWhen loading the gpio-mockup driver a number of parameters can be passed to the module.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h KhhóhžhubhŒ block_quote”“”)”}”(hXygpio_mockup_ranges This parameter takes an argument in the form of an array of integer pairs. Each pair defines the base GPIO number (non-negative integer) and the first number after the last of this chip. If the base GPIO is -1, the gpiolib will assign it automatically. while the following parameter is the number of lines exposed by the chip. Example: gpio_mockup_ranges=-1,8,-1,16,405,409 The line above creates three chips. The first one will expose 8 lines, the second 16 and the third 4. The base GPIO for the third chip is set to 405 while for two first chips it will be assigned automatically. gpio_mockup_named_lines This parameter doesn't take any arguments. It lets the driver know that GPIO lines exposed by it should be named. The name format is: gpio-mockup-X-Y where X is mockup chip's ID and Y is the line offset. ”h]”(hÐ)”}”(hŒgpio_mockup_ranges”h]”hŒgpio_mockup_ranges”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khjubj)”}”(hXJThis parameter takes an argument in the form of an array of integer pairs. Each pair defines the base GPIO number (non-negative integer) and the first number after the last of this chip. If the base GPIO is -1, the gpiolib will assign it automatically. while the following parameter is the number of lines exposed by the chip. Example: gpio_mockup_ranges=-1,8,-1,16,405,409 The line above creates three chips. The first one will expose 8 lines, the second 16 and the third 4. The base GPIO for the third chip is set to 405 while for two first chips it will be assigned automatically. ”h]”(hÐ)”}”(hXFThis parameter takes an argument in the form of an array of integer pairs. Each pair defines the base GPIO number (non-negative integer) and the first number after the last of this chip. If the base GPIO is -1, the gpiolib will assign it automatically. while the following parameter is the number of lines exposed by the chip.”h]”hXFThis parameter takes an argument in the form of an array of integer pairs. Each pair defines the base GPIO number (non-negative integer) and the first number after the last of this chip. If the base GPIO is -1, the gpiolib will assign it automatically. while the following parameter is the number of lines exposed by the chip.”…””}”(hj*hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h Khj&ubhÐ)”}”(hŒ.Example: gpio_mockup_ranges=-1,8,-1,16,405,409”h]”hŒ.Example: gpio_mockup_ranges=-1,8,-1,16,405,409”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K!hj&ubhÐ)”}”(hŒÑThe line above creates three chips. The first one will expose 8 lines, the second 16 and the third 4. The base GPIO for the third chip is set to 405 while for two first chips it will be assigned automatically.”h]”hŒÑThe line above creates three chips. The first one will expose 8 lines, the second 16 and the third 4. The base GPIO for the third chip is set to 405 while for two first chips it will be assigned automatically.”…””}”(hjFhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K#hj&ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h KhjubhÐ)”}”(hŒgpio_mockup_named_lines”h]”hŒgpio_mockup_named_lines”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K'hjubj)”}”(hŒÍThis parameter doesn't take any arguments. It lets the driver know that GPIO lines exposed by it should be named. The name format is: gpio-mockup-X-Y where X is mockup chip's ID and Y is the line offset. ”h]”(hÐ)”}”(hŒqThis parameter doesn't take any arguments. It lets the driver know that GPIO lines exposed by it should be named.”h]”hŒsThis parameter doesn’t take any arguments. It lets the driver know that GPIO lines exposed by it should be named.”…””}”(hjlhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K)hjhubhÐ)”}”(hŒYThe name format is: gpio-mockup-X-Y where X is mockup chip's ID and Y is the line offset.”h]”hŒ[The name format is: gpio-mockup-X-Y where X is mockup chip’s ID and Y is the line offset.”…””}”(hjzhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K,hjhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K)hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Khhóhžhubeh}”(h]”Œ,creating-simulated-chips-using-module-params”ah ]”h"]”Œ,creating simulated chips using module params”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒManipulating simulated lines”h]”hŒManipulating simulated lines”…””}”(hjŸhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjœhžhhŸh³h K0ubhÐ)”}”(hŒÜEach mockup chip creates its own subdirectory in /sys/kernel/debug/gpio-mockup/. The directory is named after the chip's label. A symlink is also created, named after the chip's name, which points to the label directory.”h]”hŒàEach mockup chip creates its own subdirectory in /sys/kernel/debug/gpio-mockup/. The directory is named after the chip’s label. A symlink is also created, named after the chip’s name, which points to the label directory.”…””}”(hj­hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K2hjœhžhubhÐ)”}”(hŒŽInside each subdirectory, there's a separate attribute for each GPIO line. The name of the attribute represents the line's offset in the chip.”h]”hŒ’Inside each subdirectory, there’s a separate attribute for each GPIO line. The name of the attribute represents the line’s offset in the chip.”…””}”(hj»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K6hjœhžhubhÐ)”}”(hŒ³Reading from a line attribute returns the current value. Writing to it (0 or 1) changes the configuration of the simulated pull-up/pull-down resistor (1 - pull-up, 0 - pull-down).”h]”hŒ³Reading from a line attribute returns the current value. Writing to it (0 or 1) changes the configuration of the simulated pull-up/pull-down resistor (1 - pull-up, 0 - pull-down).”…””}”(hjÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhŸh³h K9hjœhžhubeh}”(h]”Œmanipulating-simulated-lines”ah ]”h"]”Œmanipulating simulated lines”ah$]”h&]”uh1h´hh¶hžhhŸh³h K0ubeh}”(h]”Œgpio-testing-driver”ah ]”h"]”Œgpio testing driver”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jäjáj™j–jÜjÙuŒ nametypes”}”(jä‰j™‰j܉uh}”(jáh¶j–hójÙjœuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.