aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/gpio-button-hotplug/src
Commit message (Collapse)AuthorAgeFilesLines
* gpio-button-hotplug: remove #ifdef CONFIG_HOTPLUG, it is gone in newer ↵Felix Fietkau2014-05-231-7/+0
| | | | | | | | kernels (fixes #16413) Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40838
* gpio-button-hotplug: add wwan buttonHauke Mehrtens2014-01-141-0/+1
| | | | | | | | | | | The wimax key will be used as a generic wwan key starting with Linux 3.13. The brcm47xx target uses this key for the 3g buttons. Also remove the ifdef around KEY_WPS_BUTTON, this is in the kernel for a long time now. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 39290
* gpio-button-hotplug: fix crash on removeJonas Gorski2013-12-171-1/+1
| | | | | | | | | | Don't call gpio_keys_remove recursively. Setting the platform data to NULL triggered an oops on the second iteration, so there was no infinate loop. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 39124
* gpio-button-hotplug: add irq mode to driverJohn Crispin2013-12-091-94/+176
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 39021
* gpio-button-hotplug: add support for sliding switchesJohn Crispin2013-11-111-12/+8
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38725
* gpio-button-hotplug: add support for power buttonsJohn Crispin2013-10-281-0/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 38557
* gpio-button-hotplug: debounce the initial button state, the first reads at ↵Felix Fietkau2013-08-051-2/+4
| | | | | | | | boot time might be wrong Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37702
* gpio-button-hotplug: cleanup, fix compiler warningFelix Fietkau2013-08-031-4/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37665
* gpio-button-hotplug: fix active_low handling, possibly broken in r37643Felix Fietkau2013-08-031-8/+9
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37664
* gpio-button-hotplug: use gpio_button_get_value() to initialize last_state.John Crispin2013-08-011-1/+1
| | | | | | | | | | | TL-WR720N-v3 has a slider switch composed of 2 GPIO buttons which can be used to swtich between 3 positions. At leat 1 button is in pressed state in any of those positions. Initialize 'last_state' as 0 (released) will cause the device to automatically enter failsafe mode on every bootup. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 37643
* gpio-button-hotplug: use gpio_button_get_value() to fetch state.John Crispin2013-08-011-4/+1
| | | | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 37642
* gpio-button-hotplug: add inline function gpio_button_get_value().John Crispin2013-08-011-0/+9
| | | | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 37641
* gpio-button-hotplug: add support for EV_SWLuka Perkov2013-07-021-7/+21
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 37130
* gpio-button-hotplug: improve gpio button debouncing, verify state changes ↵Felix Fietkau2013-06-291-6/+8
| | | | | | | | over multiple polls. fixes spurious failsafe triggers (#13784) Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37090
* packages: clean up the package folderJohn Crispin2013-06-212-0/+565
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 37007
>sig_add.connect(self._sig_events_add) self.events.sig_refresh.connect(self._sig_events_refresh) self.options.changed.connect(self._sig_options_update) self.addons.add(*addons.default_addons()) self.addons.add( intercept.Intercept(), readfile.ReadFile(), self.view, self.events, ) if with_termlog: self.addons.add(termlog.TermLog(), termstatus.TermStatus()) self.app = app.Application( self, self.options.web_debug ) # This line is just for type hinting self.options = self.options # type: Options def _sig_view_add(self, view, flow): app.ClientConnection.broadcast( resource="flows", cmd="add", data=app.flow_to_json(flow) ) def _sig_view_update(self, view, flow): app.ClientConnection.broadcast( resource="flows", cmd="update", data=app.flow_to_json(flow) ) def _sig_view_remove(self, view, flow): app.ClientConnection.broadcast( resource="flows", cmd="remove", data=flow.id ) def _sig_view_refresh(self, view): app.ClientConnection.broadcast( resource="flows", cmd="reset" ) def _sig_events_add(self, event_store, entry: log.LogEntry): app.ClientConnection.broadcast( resource="events", cmd="add", data=app.logentry_to_json(entry) ) def _sig_events_refresh(self, event_store): app.ClientConnection.broadcast( resource="events", cmd="reset" ) def _sig_options_update(self, options, updated): app.ClientConnection.broadcast( resource="settings", cmd="update", data={k: getattr(options, k) for k in updated} ) def run(self): # pragma: no cover iol = tornado.ioloop.IOLoop.instance() http_server = tornado.httpserver.HTTPServer(self.app) http_server.listen(self.options.web_port, self.options.web_iface) iol.add_callback(self.start) tornado.ioloop.PeriodicCallback(lambda: self.tick(timeout=0), 5).start() web_url = "http://{}:{}/".format(self.options.web_iface, self.options.web_port) self.add_log( "Web server listening at {}".format(web_url), "info" ) if self.options.web_open_browser: success = open_browser(web_url) if not success: self.add_log( "No web browser found. Please open a browser and point it to {}".format(web_url), "info" ) try: iol.start() except KeyboardInterrupt: self.shutdown() def open_browser(url: str) -> bool: """ Open a URL in a browser window. In contrast to webbrowser.open, we limit the list of suitable browsers. This gracefully degrades to a no-op on headless servers, where webbrowser.open would otherwise open lynx. Returns: True, if a browser has been opened False, if no suitable browser has been found. """ browsers = ( "windows-default", "macosx", "google-chrome", "chrome", "chromium", "chromium-browser", "firefox", "opera", "safari", ) for browser in browsers: try: b = webbrowser.get(browser) except webbrowser.Error: pass else: b.open(url) return True return False