From nobody Mon Dec 1 22:03:44 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E70F32C15BB; Mon, 1 Dec 2025 07:30:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764574230; cv=none; b=e0pfs4o5B1+eBT4Lk4WqN2djxZO0p/ooDcmX09gJUTVJKmqoBJp8f4v+eYX1nmboqfbU6oJw13+tq1Z7lAmtAhL9hkItDz6fDhtirHj+hTDrx1CC7ywhr5orXjb7cemgWTKPP6CBM6TrQaz7aqobf4ONoGWhPk80bCXuKOA0zJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764574230; c=relaxed/simple; bh=cQf8kKARSTeUHlo1HHrVBItRsCEzadaHyp7VxsKktT8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CZh3qAPtQEXekpJC3KNbfaZRyzs6fuGI1d5ca+ulzJ4oH+9fXA5r6z6Xh8app76epjGr4+WtNPVbXNyhQHkJNWfmMUbiOHAXaae8e11D1Z6oSmXcY8yeZfKSwbHgZDGDPzLjGB0Of1I5/bySWfzulERDNMxYIcp7M8ek7wep8WQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jDhPLpQh; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jDhPLpQh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1764574229; x=1796110229; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cQf8kKARSTeUHlo1HHrVBItRsCEzadaHyp7VxsKktT8=; b=jDhPLpQhaclqcW3FaGSyc4QFUC9VBpoK0KD4T+IFeNuUgKZC2X1gNiws wPk1j/MM8Th/xSoiNhW1wdv/nrMjydEN1oTiRPvoKhsnYb+kd5YJuoK9f Ymkt0xFaYhguZN8NzYS9PBqqVL2EqSUHrAEeJlLq8imWIjDU0zYQyk2N8 Dm5o2urMq/UbDWpf5SvaifH0ikDZSnYvrblXl0P1QgUoUgLdRQWHWDgmO L8LfafKXe2gB5x9taxnHCJQGXb4WjU0rHbvBenyvUY6nURbGUsPDkIoJH Uh7oSNcKtm2/BGWPdpYtc+Jx4Q+xTDUaI+hnPd/ZbPXVWc8nHi+fdyjCF g==; X-CSE-ConnectionGUID: tUnHWnGtQdWD467P9AiiTQ== X-CSE-MsgGUID: 4on3xuRcTHWFaUw591pd4g== X-IronPort-AV: E=McAfee;i="6800,10657,11629"; a="69097659" X-IronPort-AV: E=Sophos;i="6.20,240,1758610800"; d="scan'208";a="69097659" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2025 23:30:28 -0800 X-CSE-ConnectionGUID: 20/XBXMFQoOC3spPqkk3jQ== X-CSE-MsgGUID: 57qKvULpR3OLw9wtN1QotQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,240,1758610800"; d="scan'208";a="193886851" Received: from shsensorbuild.sh.intel.com ([10.239.132.250]) by fmviesa006.fm.intel.com with ESMTP; 30 Nov 2025 23:30:27 -0800 From: Even Xu To: jikos@kernel.org, bentiss@kernel.org Cc: srinivas.pandruvada@linux.intel.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Even Xu , Rui Zhang Subject: [PATCH v1 4/4] HID: Intel-thc-hid: Intel-quicki2c: Add output report support Date: Mon, 1 Dec 2025 15:30:47 +0800 Message-Id: <20251201073047.3313824-5-even.xu@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20251201073047.3313824-1-even.xu@intel.com> References: <20251201073047.3313824-1-even.xu@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for HID output reports in the intel-quicki2c driver by implementing the output_report callback in the HID low-level driver interface. This enables proper communication with HID devices that require output report functionality, such as setting device configuration or updating device firmware. Tested-by: Rui Zhang Signed-off-by: Even Xu --- .../intel-quicki2c/quicki2c-hid.c | 8 ++++++++ .../intel-quicki2c/quicki2c-protocol.c | 19 +++++++++++++++++++ .../intel-quicki2c/quicki2c-protocol.h | 1 + 3 files changed, 28 insertions(+) diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c b/driv= ers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c index 5c3ec95bb3fd..580a760b3ffc 100644 --- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c @@ -83,6 +83,13 @@ static int quicki2c_hid_power(struct hid_device *hid, in= t lvl) return 0; } =20 +static int quicki2c_hid_output_report(struct hid_device *hid, u8 *buf, siz= e_t count) +{ + struct quicki2c_device *qcdev =3D hid->driver_data; + + return quicki2c_output_report(qcdev, buf, count); +} + static struct hid_ll_driver quicki2c_hid_ll_driver =3D { .parse =3D quicki2c_hid_parse, .start =3D quicki2c_hid_start, @@ -91,6 +98,7 @@ static struct hid_ll_driver quicki2c_hid_ll_driver =3D { .close =3D quicki2c_hid_close, .power =3D quicki2c_hid_power, .raw_request =3D quicki2c_hid_raw_request, + .output_report =3D quicki2c_hid_output_report, }; =20 /** diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c b= /drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c index a287d9ee09c3..4030337dd6f5 100644 --- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c @@ -195,6 +195,25 @@ int quicki2c_set_report(struct quicki2c_device *qcdev,= u8 report_type, return buf_len; } =20 +int quicki2c_output_report(struct quicki2c_device *qcdev, void *buf, size_= t buf_len) +{ + size_t len; + int ret; + + len =3D quicki2c_init_write_buf(qcdev, 0, 0, false, buf, buf_len, + qcdev->report_buf, qcdev->report_len); + if (!len) + return -EINVAL; + + ret =3D thc_dma_write(qcdev->thc_hw, qcdev->report_buf, len); + if (ret) { + dev_err(qcdev->dev, "Output Report failed, ret %d\n", ret); + return ret; + } + + return buf_len; +} + #define HIDI2C_RESET_TIMEOUT 5 =20 int quicki2c_reset(struct quicki2c_device *qcdev) diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.h b= /drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.h index db70e08c8b1c..6642cefb8a67 100644 --- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.h +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.h @@ -13,6 +13,7 @@ int quicki2c_get_report(struct quicki2c_device *qcdev, u8= report_type, unsigned int reportnum, void *buf, size_t buf_len); int quicki2c_set_report(struct quicki2c_device *qcdev, u8 report_type, unsigned int reportnum, void *buf, size_t buf_len); +int quicki2c_output_report(struct quicki2c_device *qcdev, void *buf, size_= t buf_len); int quicki2c_get_device_descriptor(struct quicki2c_device *qcdev); int quicki2c_get_report_descriptor(struct quicki2c_device *qcdev); int quicki2c_reset(struct quicki2c_device *qcdev); --=20 2.40.1