On Wed, Oct 26, 2022 at 08:18:57PM +0300, Andy Shevchenko wrote: > On Wed, Oct 26, 2022 at 01:18:57PM +0200, Levente Révész wrote: ... > > -#define PCA953X_TYPE BIT(12) > > -#define PCA957X_TYPE BIT(13) > > -#define PCAL653X_TYPE BIT(14) > > +#define PCA953X_TYPE (0x00 << 12) > > +#define PCAL653X_TYPE (0x02 << 12) > > +#define PCA957X_TYPE (0x03 << 12) > > #define PCA_TYPE_MASK GENMASK(15, 12) > > Please, use decimal numbers and drop the shifts... > > > #define PCA_CHIP_TYPE(x) ((x) & PCA_TYPE_MASK) > > ...instead add a shift here. This might require a new macro #define PCA_SET_TYPE(x) ((x) << 12) It's just an idea, look at the result and choose one approach, that looks best. -- With Best Regards, Andy Shevchenko