# Re: \[PATCH v2 6/8\] HID: sony: Add an IDA allocator to assign unique device ids

- From: Frank Praznik \<hidden\>
- Date: 2014-03-13 14:30:18 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2014/03/8923398
- Thread: https://ratatoskr.run/linux-input/2014/03/8923321/t.md

```text
On 3/10/2014 18:25, Antonio Ospite wrote:
> Hi Frank,
>
> On Thu,  6 Mar 2014 17:32:54 -0500
> Frank Praznik [ref] wrote:
>
>> Add an IDA id allocator to assign unique, sequential device ids to Sixaxis and
>> DualShock 4 controllers.
>>
>> Use explicit module init and exit functions since the IDA allocator must be
>> manually destroyed when the module is unloaded.
>>
>> Use the device id as the unique number for the battery identification string.
>>
> Have you thought about using the bdaddr as the battery id?
>
> I think that decoupling led numbers (from the following patch) and
> battery ids would be saner. For instance in a scenario when userspace
> decided that the _second_ sixaxis has LEDs saying "controller
> 3" (because of different kind of joypads, remember?) we would have
> battery still saying "2" because the battery id is assigned at probe
> time while LEDs can change at any time. This mismatch may become
> confusing.
>

That's a good idea and it will match the naming scheme of the wiimote battery device, which I think is the only other game controller that reports battery status.  I'll make the change for v3.
```
