Replace exisiting TriState, AutoState with more generic TriState

Change-Id: Ida05478aae5a379775c671e0c2f2851d820d78be
error: enumeral and non-enumeral type in conditional expression

Change-Id: I30293ac22fb26e0f7c9bfd335ccaa9a2d263d02f