Skip to contentSkip to conversation

mt9m111: mt9m111_get_global_gain() - unsigned <= 0 is always true

PATCH Robert Jarzmik 1 participant 2 messages Nov 29, 2008 2 messages not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · roel kluin

unsigned <= 0 is always true

You're right, your patch is good, but ... there is another mistake I made which should be also fixed.

The real formula is :
gain = (data & 0x2f) * (1 << ((data >> 10) & 1)) * (1 << ((data >> 9) & 1));

That is bits 9 and 10 give a 2x gain factor.

Would you please amend your patch to fix the formula please ?

--
Robert

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Acked-by
#3 lore raw
Quoted 11 lines · roel kluin
Quoted 7 lines

You're right, your patch is good, but ... there is another mistake I made which should be also fixed.

The real formula is :
gain = (data & 0x2f) * (1 << ((data >> 10) & 1)) * (1 << ((data >> 9) & 1));

That is bits 9 and 10 give a 2x gain factor.

unsigned <= 0 is always true and fix formula

Cheers.

--
Robert

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list