From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id C13701EF800; Thu, 31 Aug 2017 15:26:59 -0400 (EDT) Received: from vserver.gregn.net (vserver.gregn.net [IPv6:2607:f2f8:a260::2]) by befuddled.reisers.ca (Postfix) with ESMTPS id 5A38E1EF3CC for ; Thu, 31 Aug 2017 15:26:57 -0400 (EDT) Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::236; helo=mail-wm0-x236.google.com; envelope-from=okash.khawaja@gmail.com; receiver=speakup@linux-speakup.org Authentication-Results: vserver.gregn.net; dkim=pass reason="2048-bit key; insecure key" header.d=gmail.com header.i=@gmail.com header.b=aXERgBip; dkim-adsp=pass; dkim-atps=neutral Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by vserver.gregn.net (Postfix) with ESMTPS id CA9C19C20 for ; Thu, 31 Aug 2017 11:31:01 -0700 (PDT) Received: by mail-wm0-x236.google.com with SMTP id u26so2745263wma.0 for ; Thu, 31 Aug 2017 11:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QyNl08a4MSWJyikWzdlmfO6y4l/WGo3K/bINmr3AGdo=; b=aXERgBipBeOc2Gbgkb2l0YM6hUmgVOu850fbPzD6ePUo9YnOaTwRPJ/FbcfZxS0km3 QAiZpTmDAlMkNYdwxGVwXmrWtRyCObFqnsY1AlQ+1sScDONXPDnivcxdEZUSXCFDbRWx u1YK1OHb8jsczWVGcDrzgQpqh6kK1/8BZ03Vd+m3rMV4Pyeyec/PJK/VHkn+IHWtEbIZ 673osF2NO+OeERiQEeH2JPKsNwrwPpI9k6TcBbs8wrYOxCA9Iu/UOfMhsD0bQuYIo8ob /9wdmNqg5B0XaRwq1vjpyQ40067oo3hyZeFtnVw3MJMh0/+27F7e7gT5eS4YDE6q5464 +aIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QyNl08a4MSWJyikWzdlmfO6y4l/WGo3K/bINmr3AGdo=; b=Iv7ySBJ+VFxDvyn1GLyyY1dXqW8OaMq3AZBt2VYoQo4++Vk4mI4VMFEdh0sVZJpAXi Cq0mnGqFyGynZmwF4iIEICQutY0HSqsz5DDj+W3kjmBgDnrVIqdGTD47ewz5WRtNxBmH TrCfkX2JwhEvXuOOUF+gk4ydhrDKq/5mqLt3u4Pw634oDrYW4M5siXz54f6rir+Yi6b2 EFkLbz3D/lJYZjD1hkvCXYNSZzn5OjuX9NlvFaFzXzH0fMjru1vdHYs2fct1L4dyBZcK zsnJw2Py0rqhrNfsmTj+kNNPzAJixKSPR1ypuoKtwM1ofIerGUb9sP4ryqEHsRD5u6+a PVmQ== X-Gm-Message-State: AHPjjUh3MLE8iqlZQ7ZreIy7Q5CJ4k+wsCmpF5IWn0I2WNKzXN8rR5d6 rncfft4meEYaig== X-Google-Smtp-Source: ADKCNb4426dOeZFiaNRzYEu8yEwSLmCZzhX1bt9q0gH7gzqyEROZJzuD/f8sYhFSRL9Gp6xqBqxQlA== X-Received: by 10.28.30.67 with SMTP id e64mr1239169wme.189.1504203726314; Thu, 31 Aug 2017 11:22:06 -0700 (PDT) Received: from sanghar (92.40.248.111.threembb.co.uk. [92.40.248.111]) by smtp.gmail.com with ESMTPSA id c20sm257498wra.92.2017.08.31.11.22.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Aug 2017 11:22:05 -0700 (PDT) Date: Thu, 31 Aug 2017 19:21:59 +0100 From: Okash Khawaja To: Samuel Thibault Cc: "Speakup is a screen review system for Linux." Subject: Re: usb-autoload Message-ID: <20170831182159.GA480@sanghar> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Virus-Scanned: clamav-milter 0.99.2 at vserver X-Virus-Status: Clean X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 19:27:00 -0000 Hi, On Sat, Aug 26, 2017 at 03:48:40PM +0100, Okash Khawaja wrote: > I am thinking of modifying speakup driver so that it can take in dev > parameter after it has been loaded. Is there a simpler way? Here's what I am thinking for usb autoload. Let's say speakup_usb_serial is the driver which will be automatically loaded based upon usb vendor and product id, when user plugs in native usb synth, such as triple talk. speakup module will be pre-requisite for speakup_usb_serial so it will already be in memory when following flow starts from inside speakup_usb_serial. It assumes the native usb synth requires ltlk. Functions of the form speakup.* are those exposed by speakup module. First speakup_usb_serial will check if ltlk is already loaded ltlk not loaded: 1. speakup.next_load_as_delayed("ltlk"): tell speakup that very next time when ltlk is loaded, don't initialise it, i.e. don't call do_synth_init(). 2. load ltlk 3. speakup.delayed_init("ltlk", "ttyUSBX"): tell speakup to first set dev_name of ltlk synth to ttyUSBX and then call do_synth_init ltlk is already loaded: 1. speakup.is_initialised("ltlk")? YES: > do nothing as ltlk is loaded and initialised so we assume it's being used NO: > speakup.delayed_init("ltlk", "ttyUSBX"); This should cover the scenario when ltlk is built into kernel. Thanks, Okash