Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp204904rdb; Sat, 27 Jan 2024 03:16:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKc4wUTIzlHjk+BJLMEd+ED28C2ZPGfm1TWl4sN1LNsLMy05lyd/huETDzsgTdjut8roMf X-Received: by 2002:a05:620a:2949:b0:783:c948:796d with SMTP id n9-20020a05620a294900b00783c948796dmr1692852qkp.107.1706354194881; Sat, 27 Jan 2024 03:16:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706354194; cv=pass; d=google.com; s=arc-20160816; b=wvkocFzE5T9TVs478JOyOaEtseZSsExuo+TYTLgp2E35HD21PP/T6LmgagVP1k674G g03QB0C0mRXQGBhKsUzXtYhrQLbKlZU2jyntCOjm0yzqPNYJMrLQrC5Z4arGcvStoLhq Wn+oqziVS9FvQYGjcqH4xA4+P4N3IDwqUC6HYVmCKh1dvC3NR+ZTQdLAWz23RGuP5pKq f6YuN53vEpTRAF/wIK0IYcvJbUyAvNVKAd08r6wk2Lt8pvIQQIfgAYvChVWg7A0S5ssW BaPZ9y3xFO7rhW4FrScZ0ZDnpYAAaD48dWJJYHZE9Wifb5YIuJiuFJ1yc5cDWgmuCGlL X1Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=DVhH52aCcGgD5ZDUeD+yoQaqfWfEL7GSjbITGNZd2AQ=; fh=KK0LdLJ2z2QfPCpSaQ7qdCR27apq2/3U4AiT+qxR8gw=; b=VvgeIpaFMkb2dntQC+GNogg+N//8fD3Jkko31e2/wT5U+x/KVVUl2l4SBz2AsyhkVL jFTsurKo4il6xjdkky9jbWoY0jleZBcK9vgJNPcbep/TDsAZlBQQv7i7s2G06WR/5zNN 28g8kRXcq4Ivula0UpUHGQ5hrI3Kp2JVuTPoH2y3WkEvQu6v9rR5r4aAw422GG0rl12f 0XoEac0wGNJ2T0Fsr0NTova8TRQ22mmKG6XknBv1zLu5ZPJwcDAHTgOzuVmq43zWrELJ xImk9+NjH41fupuz0sem/mBYve7i/+Eyaj/iuYMpdAIv/yde0Bt2jySDRkqav9yTzPGT yYig== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=enpas.org); spf=pass (google.com: domain of linux-kernel+bounces-41170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41170-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g21-20020a17090adb1500b002906b4c1b7csi4588130pjv.189.2024.01.27.03.16.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 03:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=enpas.org); spf=pass (google.com: domain of linux-kernel+bounces-41170-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41170-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7B3D02834B5 for ; Sat, 27 Jan 2024 11:16:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEC3C20B29; Sat, 27 Jan 2024 11:16:25 +0000 (UTC) Received: from mail.enpas.org (zhong.enpas.org [46.38.239.100]) (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 D44E520305; Sat, 27 Jan 2024 11:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.38.239.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706354185; cv=none; b=qP1i0MHib2m5kPB5oFYsNN94DuWJRvDpAThGKIYEfkzGZHCtKde2DfKPN2nzIeRTQZ8BVRz59xGjBAbYIO6ISNSjLa5rLFCgJFqfgdMXIiFPAEjEXIFXzszXnfM+j2Jqlnh0NsRT/SiGopCuRfqOl7RtIkhpIPbw4FKdjGqff6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706354185; c=relaxed/simple; bh=DVhH52aCcGgD5ZDUeD+yoQaqfWfEL7GSjbITGNZd2AQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CKnT+PCCRmYT+Ytbj8f7pQ2CVNLBe9mwwfeehmEwWLPSZehJlw5qy+mqMMiIHkEWwqLXhfuE35TnPLRDsSgh7QgMp+tZ08TB3Mlk1yhtXvMoiwBMN2tRVpsw8L9e47g5VKTv1OA3qOChFluWSCjn20fj69paS3c+rNZgIamVeb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=enpas.org; spf=pass smtp.mailfrom=enpas.org; arc=none smtp.client-ip=46.38.239.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=enpas.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=enpas.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id A402F1015FD; Sat, 27 Jan 2024 11:16:17 +0000 (UTC) Message-ID: Date: Sat, 27 Jan 2024 20:16:14 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 7/7] HID: playstation: DS4: Add VID/PID for SZ-MYPOWER controllers Content-Language: en-US To: Roderick Colenbrander Cc: Roderick Colenbrander , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240115144538.12018-1-max@enpas.org> <20240115144538.12018-8-max@enpas.org> From: Max Staudt Autocrypt: addr=max@enpas.org; keydata= xsNNBFWfXgEBIADcbJMG2xuJBIVNlhj5AFBwKLZ6GPo3tGxHye+Bk3R3W5uIws3Sxbuj++7R PoWqUkvrdsxJAmnkFgMKx4euW/MCzXXgEQOM2nE0CWR7xmutpoXYc9BLZ2HHE2mSkpXVa1Ea UTm00jR+BUXgG/ZzCRkkLvN1W9Hkdb75qE/HIpkkVyDiSteJTIjGnpTnJrwiHbZVvXoR/Bx3 IWFNpuG80xnsGv3X9ierbalXaI3ZrmFiezbPuGzG1kqV1q0gdV4DNuFVi1NjpQU1aTmBV8bv gDi2Wygs1pOSj+dlLPwUJ+9jGVzFXiM3xUkNaJc4UPRKxAGskh1nWDdg0odbs0OarQ0o+E+v d7WbKK7TR1jfYNcQ+Trr0ca0m72XNFk0hUxNyaEv3kkZEpAv0IDKqXFQD700kr3ftZ8ZKOxd CP4UqVYI+1d0nR9LnJYVjRpKI9QqIx492As6Vl1YPjUbmuKi4OT2JdvaT4czGq9EJkbhjC8E KQqc2mWeLnnwiMJwp8fMGTq+1TuBgNIbVSdTeyMnNr5w0UmJ4Y/TNFnTsOR0yytpJlHU4YiW HDQKaw6wzvdxql2DCjRvn+Hgm9ifMmtPn5RO3PGvq7XQJ0bNzJ/lXl9ts9QbeR62vQUuv63S P6WIU+uEUZVtaNJIjmsoEkziMX01Agi+5gCgKkY8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m/qHIC+mnHAe4HRiZ54aML PsRBqTJGs7jw5gOWMMchFaemEnEJtg== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/25/24 10:03, Roderick Colenbrander wrote: > I'm not familiar with this device, but if it indeed works. Then I'm > okay with it. Thanks! I've just tried this patch on real hardware again, and there's a tradeoff here - it improves the situation for one 7545:0104 controller, and worsens it for another. Up to you, and if you don't want to think about it, then let's shelve this patch :) Details follow, if you're curious. I have two controllers with VID/PID 7545:0104, and they're both very quirky multi-emulation devices. One is shaped like a PS4 controller, the other like a hybrid between a PS4 and a Switch controller. Since these controllers exhibit all of the USB related quirks in this series, I've kept them as reproducers. Other controllers that passed through my hands only had a subset of the quirks. Up until now, both controllers worked with hid-sony as PS3 controllers. With this patch, the PS4 controller gains LED support and fine-grained control of the weak rumble motor. The "Switch (?) controller" on the other hand errors out, becomes 0079:181c, and loses the Home key and the accelerometer. This is a user facing change, and the question is how much we really care about these controllers. More details, if you're still reading: Both are "multi-purpose" controllers, appearing as PS4/PS3/Switch/other controllers in sequence. They advertise themselves as one USB device, and if there is no driver sending whatever init sequence they expect, they disconnect and try emulating a different controller. The PS4 controller has rumble and an RGB LED, and this patch series improves its functionality. It cannot emulate a Switch controller. The Switch (?) controller has no rumble and four multicolour player LEDs, but it adds Switch compatibility including accelerometer and gyro. For the PS4 mode, which is the first that they try, and which would unify most functions, they use 7545:0104 instead of cloning a DS4 VID/PID. So I took a guess and found that it works fine with hid-playstation if I add the VID/PID and the init quirks in patches 2/3/4. Well, to be precise, I've only made the DS4 shaped one work in PS4 mode, the Switch controller isn't happy and errors out, see below. On the PS4 controller, this makes the RGB LED work, rumble works, but the gyro and touchpad don't send HID updates. The touchpad can click though, so maybe the controller I have has a hardware defect. The Switch (?) controller is where things get weird. It disconnects, even though it is initialised by hid-playstation, and transitions into a generic controller with VID/PID 0079:181c. This mode is *not* on the list of emulations it usually tries. It's as if the "unfinished" PS4 initialisation transitions it into a hidden fifth emulation mode. In this mode, the home key does not send any HID event, and there are no accelerometer updates that hid-sony would receive in PS3 mode. So, with this patch, the PS4 controller works better on Linux, while the Switch controller works worse. Both were seen as PS3 controllers up until now. I see no way to discern them at driver probe time. Any preference on what to do...? Max