From patchwork Thu Dec 21 13:51:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jeffrey.lin" X-Patchwork-Id: 10127677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F2396019C for ; Thu, 21 Dec 2017 13:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D27D29C91 for ; Thu, 21 Dec 2017 13:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 218A529C98; Thu, 21 Dec 2017 13:51:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA4DF29C91 for ; Thu, 21 Dec 2017 13:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbdLUNvo (ORCPT ); Thu, 21 Dec 2017 08:51:44 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:40177 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbdLUNvn (ORCPT ); Thu, 21 Dec 2017 08:51:43 -0500 Received: by mail-pf0-f194.google.com with SMTP id v26so13964650pfl.7; Thu, 21 Dec 2017 05:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=l47/R8NbSt8/GcXf8cN/oVOI4+E2d7ErCIxxmQxZ0lQ=; b=C7YnwPPSJ4Grc0yN8ILT4U0E12dBdprt3Ql5YER6f+6g6HGqwkH82eiN+RtrZwwIe6 K4Vfs4KfrAbWblezQRIx3sGsebKBXC87Q39UE3QEgeMjcLNmoAOGUNy9fnV+oDkBrPTD R/OulxQI/EMOODJ+jfr/p4IL2QSIW9fpVHYJAyUHqbx/oMEzBkSxk/6Yd46+UIYJE7kc 18cmGsmQKd0hGqSZn6UDKpeZ/LgjkvuP+ULx8lJ6XmaA3NV60ucB1lByEKEc3PpVfg3I RCjA3TGM0bUhdjujOtMF8i73qx9mJPc6yiV8bn2G167ydswHUre3ZYDB84/oi637qTGm rPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l47/R8NbSt8/GcXf8cN/oVOI4+E2d7ErCIxxmQxZ0lQ=; b=l9PJiaTqQbhE4KlNcTlapIqfxfWWLwKwdOsiTWX72iGENUH/5/DSP6mEz8NqCGx5zV Tt05dZJ93iAxcFdJlhR3KzO5u9PjOHnkSlQRTH4D93CuycKwjxo6BPBq9RIXt/etEt/p zi8q1YcmwMPKRqED3ZcqhWY3Vz0JQZY9rypnSvz9Y6x9uLF0JeJEsFnCZXo0JlaRhIlC K5KWh3hHscSDQWEbpfPpLYL8DJAZ9rWlvqCmUYSzWh7mdBnsUnJguYuAZFxPu0e09jJV QPlBNHp/vPBbckIXWl5RA/O/BP+ScOkBdrH3B5uXzIVdJDV+BaNLbbNsYbS/XiF8ipRX 4P2Q== X-Gm-Message-State: AKGB3mLJmABt14MX8NPjSV77nNJ9Gq4tni6dIBcw7cxf/kdMw2Wd/ry8 3WnoVepEDZal4rVbj0Bzcfk= X-Google-Smtp-Source: ACJfBovtqU9h9vcQwyCzEACfgS5UjEtMm0Ji1m6s9iaYA4IlD41YK1GQ9c/v+nO2gXJaoNxlFwUweA== X-Received: by 10.99.120.131 with SMTP id t125mr9394563pgc.83.1513864303195; Thu, 21 Dec 2017 05:51:43 -0800 (PST) Received: from localhost.localdomain (39-8-197-125.adsl.fetnet.net. [39.8.197.125]) by smtp.gmail.com with ESMTPSA id s14sm43729365pfe.36.2017.12.21.05.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 05:51:41 -0800 (PST) From: "jeffrey.lin" X-Google-Original-From: "jeffrey.lin" To: dmitry.torokhov@gmail.com, groeck@chromium.org, keith.tzeng@quantatw.com, Katherine.Hsieh@quantatw.com, bleung@google.com Cc: jeffrey.lin@rad-ic.com, KP.li@rad-ic.com, albert.shieh@rad-ic.com, calvin.tseng@rad-ic.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH] driver: input :touchscreen :Modify Raydium Firmware update input file Date: Thu, 21 Dec 2017 21:51:22 +0800 Message-Id: <20171221135122.345-1-jeffrey.lin@raydium.corp-partner.google.com> X-Mailer: git-send-email 2.12.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Modify update firmware to accept alternative file name Signed-off-by: jeffrey.lin --- drivers/input/touchscreen/raydium_i2c_ts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index a99fb5cac5a0..439d43c3519c 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -130,6 +130,7 @@ struct raydium_data { struct gpio_desc *reset_gpio; struct raydium_info info; + char fw_file[64]; struct mutex sysfs_mutex; @@ -752,12 +753,16 @@ static int raydium_i2c_fw_update(struct raydium_data *ts) { struct i2c_client *client = ts->client; const struct firmware *fw = NULL; - const char *fw_file = "raydium.fw"; int error; - error = request_firmware(&fw, fw_file, &client->dev); + /* Firmware name */ + snprintf(ts->fw_file, sizeof(ts->fw_file), + "raydium_%x.fw", ts->info.hw_ver); + dev_dbg(&client->dev, "firmware name: %s\n", ts->fw_file); + + error = request_firmware(&fw, ts->fw_file, &client->dev); if (error) { - dev_err(&client->dev, "Unable to open firmware %s\n", fw_file); + dev_err(&client->dev, "Unable to open firmware %s\n", ts->fw_file); return error; }