1]sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget@/translations/zh_CN/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/zh_TW/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/it_IT/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/ja_JP/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/ko_KR/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget@/translations/sp_SP/userspace-api/gpio/gpio-get-linehandle-ioctlmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhZ/var/lib/git/docbuild/linux/Documentation/userspace-api/gpio/gpio-get-linehandle-ioctl.rsthKubhtarget)}(h.. _GPIO_GET_LINEHANDLE_IOCTL:h]h}(h]h ]h"]h$]h&]refidgpio-get-linehandle-ioctluh1hhKhhhhhhubhsection)}(hhh](htitle)}(hGPIO_GET_LINEHANDLE_IOCTLh]hGPIO_GET_LINEHANDLE_IOCTL}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhwarning)}(hTThis ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-get-line-ioctl.rst.h]h paragraph)}(hTThis ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-get-line-ioctl.rst.h]hTThis ioctl is part of chardev_v1.rst and is obsoleted by gpio-v2-get-line-ioctl.rst.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hDGPIO_GET_LINEHANDLE_IOCTL - Request a line or lines from the kernel.h]hDGPIO_GET_LINEHANDLE_IOCTL - Request a line or lines from the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](single#GPIO_GET_LINEHANDLE_IOCTL (C macro)c.GPIO_GET_LINEHANDLE_IOCTLhNtauh1j+hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hGPIO_GET_LINEHANDLE_IOCTLh]hdesc_signature_line)}(hGPIO_GET_LINEHANDLE_IOCTLh]h desc_name)}(hGPIO_GET_LINEHANDLE_IOCTLh]h desc_sig_name)}(hjEh]hGPIO_GET_LINEHANDLE_IOCTL}(hjUhhhNhNubah}(h]h ]nah"]h$]h&]uh1jShjOubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jMhjIhhhhhKubah}(h]h ]h"]h$]h&]hh add_permalinkuh1jGsphinx_line_type declaratorhjChhhhhKubah}(h]j:ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jAhhhKhj>hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jhj>hhhhhKubeh}(h]h ](cmacroeh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1j<hhhjhNhNubh)}(hY``int ioctl(int chip_fd, GPIO_GET_LINEHANDLE_IOCTL, struct gpiohandle_request *request)``h]hliteral)}(hjh]hUint ioctl(int chip_fd, GPIO_GET_LINEHANDLE_IOCTL, struct gpiohandle_request *request)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(hS``chip_fd`` The file descriptor of the GPIO character device returned by `open()`. h](hterm)}(h ``chip_fd``h]j)}(hjh]hchip_fd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(hFThe file descriptor of the GPIO character device returned by `open()`.h](h=The file descriptor of the GPIO character device returned by }(hjhhhNhNubhtitle_reference)}(h`open()`h]hopen()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hv``request`` The :c:type:`handle_request` specifying the lines to request and their configuration. h](j)}(h ``request``h]j)}(hj'h]hrequest}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]uh1jhhhK!hj!ubj)}(hhh]h)}(hiThe :c:type:`handle_request` specifying the lines to request and their configuration.h](hThe }(hj?hhhNhNubh)}(h,:c:type:`handle_request`h]j)}(hjIh]hhandle_request}(hjKhhhNhNubah}(h]h ](xrefjc-typeeh"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]refdoc,userspace-api/gpio/gpio-get-linehandle-ioctl refdomainjreftypetype refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]sb reftargetgpiohandle_requestuh1hhhhK hj?ubh9 specifying the lines to request and their configuration.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hj<ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhhhK!hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK$ubh)}(h(Request a line or lines from the kernel.h]h(Request a line or lines from the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh)}(hbWhile multiple lines may be requested, the same configuration applies to all lines in the request.h]hbWhile multiple lines may be requested, the same configuration applies to all lines in the request.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjhhubh)}(h|On success, the requesting process is granted exclusive access to the line value and write access to the line configuration.h]h|On success, the requesting process is granted exclusive access to the line value and write access to the line configuration.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjhhubh)}(hX The state of a line, including the value of output lines, is guaranteed to remain as requested until the returned file descriptor is closed. Once the file descriptor is closed, the state of the line becomes uncontrolled from the userspace perspective, and may revert to its default state.h]hX The state of a line, including the value of output lines, is guaranteed to remain as requested until the returned file descriptor is closed. Once the file descriptor is closed, the state of the line becomes uncontrolled from the userspace perspective, and may revert to its default state.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjhhubh)}(h9Requesting a line already in use is an error (**EBUSY**).h](h.Requesting a line already in use is an error (}(hjhhhNhNubhstrong)}(h **EBUSY**h]hEBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK3hjhhubh)}(h?Closing the ``chip_fd`` has no effect on existing line handles.h](h Closing the }(hjhhhNhNubj)}(h ``chip_fd``h]hchip_fd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( has no effect on existing line handles.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK5hjhhubh)}(h%.. _gpio-get-linehandle-config-rules:h]h}(h]h ]h"]h$]h&]h gpio-get-linehandle-config-rulesuh1hhK7hjhhhhubh)}(hhh](h)}(hConfiguration Rulesh]hConfiguration Rules}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hhhhhK:ubh)}(h(The following configuration rules apply:h]h(The following configuration rules apply:}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj+hhubh)}(hThe drive flags, ``GPIOHANDLE_REQUEST_OPEN_xxx``, require the ``GPIOHANDLE_REQUEST_OUTPUT`` to be set. Only one drive flag may be set. If none are set then the line is assumed push-pull.h](hThe drive flags, }(hjhhhNhNubj)}(h``GPIOHANDLE_REQUEST_OPEN_xxx``h]hGPIOHANDLE_REQUEST_OPEN_xxx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, require the }(hjhhhNhNubj)}(h``GPIOHANDLE_REQUEST_OUTPUT``h]hGPIOHANDLE_REQUEST_OUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh_ to be set. Only one drive flag may be set. If none are set then the line is assumed push-pull.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKDhj+hhubh)}(hOnly one bias flag, ``GPIOHANDLE_REQUEST_BIAS_xxx``, may be set, and it requires a direction flag to also be set. If no bias flags are set then the bias configuration is not changed.h](hOnly one bias flag, }(hjhhhNhNubj)}(h``GPIOHANDLE_REQUEST_BIAS_xxx``h]hGPIOHANDLE_REQUEST_BIAS_xxx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, may be set, and it requires a direction flag to also be set. If no bias flags are set then the bias configuration is not changed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKIhj+hhubh)}(h=Requesting an invalid configuration is an error (**EINVAL**).h](h1Requesting an invalid configuration is an error (}(hjhhhNhNubj)}(h **EINVAL**h]hEINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKMhj+hhubh)}(h'.. _gpio-get-linehandle-config-support:h]h}(h]h ]h"]h$]h&]h"gpio-get-linehandle-config-supportuh1hhKPhj+hhhhubeh}(h](configuration-rulesj*eh ]h"](configuration rules gpio-get-linehandle-config-ruleseh$]h&]uh1hhjhhhhhK:expect_referenced_by_name}jj sexpect_referenced_by_id}j*j subh)}(hhh](h)}(hConfiguration Supporth]hConfiguration Support}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKSubh)}(hWhere the requested configuration is not directly supported by the underlying hardware and driver, the kernel applies one of these approaches:h]hWhere the requested configuration is not directly supported by the underlying hardware and driver, the kernel applies one of these approaches:}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjhhubh block_quote)}(hZ- reject the request - emulate the feature in software - treat the feature as best effort h]h bullet_list)}(hhh](h list_item)}(hreject the requesth]h)}(hjFh]hreject the request}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjDubah}(h]h ]h"]h$]h&]uh1jBhj?ubjC)}(hemulate the feature in softwareh]h)}(hj]h]hemulate the feature in software}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhj[ubah}(h]h ]h"]h$]h&]uh1jBhj?ubjC)}(h!treat the feature as best effort h]h)}(h treat the feature as best efforth]h treat the feature as best effort}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKZhjrubah}(h]h ]h"]h$]h&]uh1jBhj?ubeh}(h]h ]h"]h$]h&]bullet-uh1j=hhhKXhj9ubah}(h]h ]h"]h$]h&]uh1j7hhhKXhjhhubh)}(hThe approach applied depends on whether the feature can reasonably be emulated in software, and the impact on the hardware and userspace if the feature is not supported. The approach applied for each feature is as follows:h]hThe approach applied depends on whether the feature can reasonably be emulated in software, and the impact on the hardware and userspace if the feature is not supported. The approach applied for each feature is as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(hFeatureh]hFeature}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hApproachh]hApproach}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubhtbody)}(hhh](j)}(hhh](j)}(hhh]h)}(hBiash]hBias}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h best efforth]h best effort}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Directionh]h Direction}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjKubah}(h]h ]h"]h$]h&]uh1jhjHubj)}(hhh]h)}(hrejecth]hreject}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjbubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hDriveh]hDrive}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hemulateh]hemulate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hBias is treated as best effort to allow userspace to apply the same configuration for platforms that support internal bias as those that require external bias. Worst case the line floats rather than being biased as expected.h]hBias is treated as best effort to allow userspace to apply the same configuration for platforms that support internal bias as those that require external bias. Worst case the line floats rather than being biased as expected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjhhubh)}(hWDrive is emulated by switching the line to an input when the line should not be driven.h]hWDrive is emulated by switching the line to an input when the line should not be driven.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjhhubh)}(hIn all cases, the configuration reported by gpio-get-lineinfo-ioctl.rst is the requested configuration, not the resulting hardware configuration. Userspace cannot determine if a feature is supported in hardware, is emulated, or is best effort.h]hIn all cases, the configuration reported by gpio-get-lineinfo-ioctl.rst is the requested configuration, not the resulting hardware configuration. Userspace cannot determine if a feature is supported in hardware, is emulated, or is best effort.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjhhubeh}(h](configuration-supportj eh ]h"](configuration support"gpio-get-linehandle-config-supporteh$]h&]uh1hhjhhhhhKSj}jjsj}j jsubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK$ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKwubh)}(hkOn success 0 and the :c:type:`request.fd` contains the file descriptor for the request.h](hOn success 0 and the }(hjhhhNhNubh)}(h(:c:type:`request.fd`h]j)}(hj!h]h request.fd}(hj#hhhNhNubah}(h]h ](jUjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocja refdomainjreftypetype refexplicitrefwarnjgjkjogpiohandle_requestuh1hhhhKyhjubh. contains the file descriptor for the request.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKyhjhhubh)}(hqOn error -1 and the ``errno`` variable is set appropriately. Common error codes are described in error-codes.rst.h](hOn error -1 and the }(hjHhhhNhNubj)}(h ``errno``h]herrno}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubhT variable is set appropriately. Common error codes are described in error-codes.rst.}(hjHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjhhubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKwubeh}(h](hid1eh ]h"]gpio_get_linehandle_ioctlah$]gpio_get_linehandle_ioctlah&]uh1hhhhhhhhK referencedKj}juhsj}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}(h]haj*]j aj ]jaunameids}(juhjjjjjjjjjj*jj jj jjjmjju nametypes}(jujjjjjjjjjmuh}(hhjrhjhjjj:jCjjjjj*j+j j+j jjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jKsRparse_messages]hsystem_message)}(hhh]h)}(h