From patchwork Wed Oct 26 06:51:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangwon Jee X-Patchwork-Id: 9396007 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 2247A60234 for ; Wed, 26 Oct 2016 06:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF0A4292EC for ; Wed, 26 Oct 2016 06:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D378A297E8; Wed, 26 Oct 2016 06:51:38 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 DFBE1292EC for ; Wed, 26 Oct 2016 06:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753994AbcJZGvf (ORCPT ); Wed, 26 Oct 2016 02:51:35 -0400 Received: from sbs.melfas.com ([39.118.242.30]:45290 "EHLO sbs.melfas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753777AbcJZGve (ORCPT ); Wed, 26 Oct 2016 02:51:34 -0400 Received: from unknown (HELO localhost.localdomain) (jeesw@melfas.com@172.16.10.138) by 172.16.0.30 with ESMTP; 26 Oct 2016 15:51:23 +0900 X-Original-SENDERIP: 172.16.10.138 X-Original-MAILFROM: jeesw@melfas.com X-Original-RCPTTO: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, jeesw@melfas.com From: Sangwon Jee To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, jeesw@melfas.com Subject: Input: melfas_mip4 - use product id for firmware name Date: Wed, 26 Oct 2016 15:51:24 +0900 Message-Id: <1477464684-5848-1-git-send-email-jeesw@melfas.com> X-Mailer: git-send-email 1.9.1 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 Use product id for firmware name to request compatible firmware. Signed-off-by: Sangwon Jee --- drivers/input/touchscreen/melfas_mip4.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index 8739cb7..0f2230a 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -162,6 +162,7 @@ struct mip4_ts { char product_name[16]; u16 product_id; char ic_name[4]; + char fw_name[32]; unsigned int max_x; unsigned int max_y; @@ -280,6 +281,11 @@ static int mip4_query_device(struct mip4_ts *ts) dev_dbg(&ts->client->dev, "product id: %04X\n", ts->product_id); } + /* Firmware name */ + snprintf(ts->fw_name, sizeof(ts->fw_name), + "melfas_mip4_%04X.fw", ts->product_id); + dev_dbg(&ts->client->dev, "firmware name: %s\n", ts->fw_name); + /* IC name */ cmd[0] = MIP4_R0_INFO; cmd[1] = MIP4_R1_INFO_IC_NAME; @@ -1285,11 +1291,11 @@ static ssize_t mip4_sysfs_fw_update(struct device *dev, const struct firmware *fw; int error; - error = request_firmware(&fw, MIP4_FW_NAME, dev); + error = request_firmware(&fw, ts->fw_name, dev); if (error) { dev_err(&ts->client->dev, "Failed to retrieve firmware %s: %d\n", - MIP4_FW_NAME, error); + ts->fw_name, error); return error; } @@ -1608,6 +1614,6 @@ static struct i2c_driver mip4_driver = { module_i2c_driver(mip4_driver); MODULE_DESCRIPTION("MELFAS MIP4 Touchscreen"); -MODULE_VERSION("2016.10.20"); +MODULE_VERSION("2016.10.24"); MODULE_AUTHOR("Sangwon Jee "); MODULE_LICENSE("GPL");