[PATCH v3] platform/x86: Add new vga-switcheroo gmux driver for ACPI-driven muxes

Daniel Dadap ddadap at nvidia.com
Tue Aug 11 21:22:54 UTC 2020


On 8/10/20 10:43 PM, Lukas Wunner wrote:
> On Mon, Aug 10, 2020 at 01:44:58PM -0500, Daniel Dadap wrote:
>
>> Would it be clearer to write it out as something like 0 << 4 & 1 << 0 for
>> MUX_STATE_SET_IGPU and 1 << 4 & 1 << 0 for MUX_STATE_SET_DGPU?
> BIT(4) | BIT(0) might be clearer, but that gives you an unsigned long
> and I'm not sure if gcc accepts that as an enum (=int) initializer.


Ah yes, I forgot the BIT() macro. And it does seem to work just fine for 
initializing enum values, and there does seem to be precedent in other 
code in the kernel for doing so. And of course I meant | instead of & 
earlier. :)



More information about the dri-devel mailing list