From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id BFC761F0A54; Sat, 25 Feb 2017 14:31:14 -0500 (EST) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by befuddled.reisers.ca (Postfix) with ESMTPS id 9EA391F0A50 for ; Sat, 25 Feb 2017 14:30:34 -0500 (EST) Received: by mail-wm0-x243.google.com with SMTP id v77so7705339wmv.0 for ; Sat, 25 Feb 2017 11:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :in-reply-to:user-agent; bh=/sF5A2SGYRH+kk1dTSiMvXKMpAoxdl0MIhRjozrWDB4=; b=Gj9ooO3gbmKdTVbwN9oO8z2h2NkGUXDG5vo+A922RVrUR32EBQ9rNiqzsSM2QGC/rc 4mvYM6+7EdVZdnwDGb87Rjm+9IwcPWHLbvANMmk3Z0X8dMsxdtiurfyE82/gw0G/sj// gbpYNtlrDapdLafBHBcxA+EnfcpkjiDYAdWsL1bbyfHXHXx8NA2KpCFG1Grq9uSWJ74F tjFBQw9RWZbhKkoiSdzCSekc1a6A0fQ9s38CZtFNYCZL7l0bFEzq1/NppriM7B0qaUBH o44lXYoJcNiQRxnS7YztN+ieHskn7eCwMWO6pz1d1NvB5FF40Fhc5qKq5KMCdc9K/8gP 1LGQ== 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:mime-version :content-disposition:in-reply-to:user-agent; bh=/sF5A2SGYRH+kk1dTSiMvXKMpAoxdl0MIhRjozrWDB4=; b=CiWkc+ApfmE7UNQpI9WO4f68UZECchzsJ51CBaBdNVCikB/GwTCRKO17mpcZsHDKV5 4BnTbmh81+LWc4majxOkFrAve+E7+9txqiuFFkGeZ/VqvGhZEkoeDtQzSLTA3lb5rhhg B8fI6xREzmSeK6sxbDN/DUbxtqJAiXQHPSLic2R+SGUE7bVfFzGaNH1jgG/mqOA2PfgO NosJEid37KkGDzIynapZePnGYefiWjUrFya1j+hTtDWtmF86NYn4SdjCJSlbn0se4eyN ls/nwBI8busAKK5dooImDOof6aY2Eqh4iulukTdMZW2knDOAgKaH+wSiLp5nwJLWJe3X lv8w== X-Gm-Message-State: AMke39mINqhDOhayKjwNuEUx0uXDYxdWxYYqJBJS/cl9uxZq5SNgM0lqH+6T59AO9afrJw== X-Received: by 10.28.196.135 with SMTP id u129mr1911307wmf.35.1488051033464; Sat, 25 Feb 2017 11:30:33 -0800 (PST) Received: from sanghar (cpc91372-watf11-2-0-cust614.15-2.cable.virginm.net. [86.14.2.103]) by smtp.gmail.com with ESMTPSA id z1sm15429464wrb.2.2017.02.25.11.30.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Feb 2017 11:30:32 -0800 (PST) Date: Sat, 25 Feb 2017 19:30:31 +0000 From: Okash Khawaja To: samuel.thibault@ens-lyon.org Cc: speakup@linux-speakup.org Subject: [patch 6/6] staging: speakup: Migrate acntsa, bns, dectlk and txprt to ttyio Message-ID: <20170225193031.GA4525@sanghar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170225192842.GA4519@sanghar> User-Agent: Mutt/1.7.2 (2016-11-26) 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: Sat, 25 Feb 2017 19:31:15 -0000 This changes the above four synths to TTY-based comms. They were chosen as a first pass because their serial comms are straightforward, i.e. they don't use serial input and don't do internal port knocking. This also moves spk_serial_synth_probe() into serialio.c in order to segregate those functions which directly use serial comms into serialio.c. Signed-off-by: Okash Khawaja Index: linux-stable/drivers/staging/speakup/speakup_acntsa.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/speakup_acntsa.c +++ linux-stable/drivers/staging/speakup/speakup_acntsa.c @@ -100,9 +100,9 @@ .checkval = SYNTH_CHECK, .vars = vars, .probe = synth_probe, - .release = spk_serial_release, - .serial_out = spk_serial_out, - .synth_immediate = spk_synth_immediate, + .release = spk_ttyio_release, + .serial_out = spk_ttyio_out, + .synth_immediate = spk_ttyio_immediate, .catch_up = spk_do_catch_up, .flush = spk_synth_flush, .is_alive = spk_synth_is_alive_restart, @@ -125,9 +125,9 @@ { int failed; - failed = spk_serial_synth_probe(synth); + failed = spk_ttyio_synth_probe(synth); if (failed == 0) { - spk_synth_immediate(synth, "\033=R\r"); + synth->synth_immediate(synth, "\033=R\r"); mdelay(100); } synth->alive = !failed; Index: linux-stable/drivers/staging/speakup/speakup_bns.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/speakup_bns.c +++ linux-stable/drivers/staging/speakup/speakup_bns.c @@ -96,10 +96,10 @@ .startup = SYNTH_START, .checkval = SYNTH_CHECK, .vars = vars, - .probe = spk_serial_synth_probe, - .release = spk_serial_release, - .serial_out = spk_serial_out, - .synth_immediate = spk_synth_immediate, + .probe = spk_ttyio_synth_probe, + .release = spk_ttyio_release, + .serial_out = spk_ttyio_out, + .synth_immediate = spk_ttyio_immediate, .catch_up = spk_do_catch_up, .flush = spk_synth_flush, .is_alive = spk_synth_is_alive_restart, Index: linux-stable/drivers/staging/speakup/speakup_txprt.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/speakup_txprt.c +++ linux-stable/drivers/staging/speakup/speakup_txprt.c @@ -95,10 +95,10 @@ .startup = SYNTH_START, .checkval = SYNTH_CHECK, .vars = vars, - .probe = spk_serial_synth_probe, - .release = spk_serial_release, - .serial_out = spk_serial_out, - .synth_immediate = spk_synth_immediate, + .probe = spk_ttyio_synth_probe, + .release = spk_ttyio_release, + .serial_out = spk_ttyio_out, + .synth_immediate = spk_ttyio_immediate, .catch_up = spk_do_catch_up, .flush = spk_synth_flush, .is_alive = spk_synth_is_alive_restart, Index: linux-stable/drivers/staging/speakup/speakup_dectlk.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/speakup_dectlk.c +++ linux-stable/drivers/staging/speakup/speakup_dectlk.c @@ -130,10 +130,10 @@ .vars = vars, .default_pitch = ap_defaults, .default_vol = g5_defaults, - .probe = spk_serial_synth_probe, - .serial_out = spk_serial_out, - .release = spk_serial_release, - .synth_immediate = spk_synth_immediate, + .probe = spk_ttyio_synth_probe, + .serial_out = spk_ttyio_out, + .release = spk_ttyio_release, + .synth_immediate = spk_ttyio_immediate, .catch_up = do_catch_up, .flush = synth_flush, .is_alive = spk_synth_is_alive_restart, Index: linux-stable/drivers/staging/speakup/serialio.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/serialio.c +++ linux-stable/drivers/staging/speakup/serialio.c @@ -181,6 +181,36 @@ return 1; } +int spk_serial_synth_probe(struct spk_synth *synth) +{ + const struct old_serial_port *ser; + int failed = 0; + + if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) { + ser = spk_serial_init(synth->ser); + if (ser == NULL) { + failed = -1; + } else { + outb_p(0, ser->port); + mdelay(1); + outb_p('\r', ser->port); + } + } else { + failed = -1; + pr_warn("ttyS%i is an invalid port\n", synth->ser); + } + if (failed) { + pr_info("%s: not found\n", synth->long_name); + return -ENODEV; + } + pr_info("%s: ttyS%i, Driver Version %s\n", + synth->long_name, synth->ser, synth->version); + synth->alive = 1; + return 0; +} +EXPORT_SYMBOL_GPL(spk_serial_synth_probe); + + unsigned char spk_serial_in(void) { int tmout = SPK_SERIAL_TIMEOUT; Index: linux-stable/drivers/staging/speakup/synth.c =================================================================== --- linux-stable.orig/drivers/staging/speakup/synth.c +++ linux-stable/drivers/staging/speakup/synth.c @@ -44,35 +44,6 @@ static int do_synth_init(struct spk_synth *in_synth); -int spk_serial_synth_probe(struct spk_synth *synth) -{ - const struct old_serial_port *ser; - int failed = 0; - - if ((synth->ser >= SPK_LO_TTY) && (synth->ser <= SPK_HI_TTY)) { - ser = spk_serial_init(synth->ser); - if (ser == NULL) { - failed = -1; - } else { - outb_p(0, ser->port); - mdelay(1); - outb_p('\r', ser->port); - } - } else { - failed = -1; - pr_warn("ttyS%i is an invalid port\n", synth->ser); - } - if (failed) { - pr_info("%s: not found\n", synth->long_name); - return -ENODEV; - } - pr_info("%s: ttyS%i, Driver Version %s\n", - synth->long_name, synth->ser, synth->version); - synth->alive = 1; - return 0; -} -EXPORT_SYMBOL_GPL(spk_serial_synth_probe); - /* * Main loop of the progression thread: keep eating from the buffer * and push to the serial port, waiting as needed