It is possible that you have two different conditions. For example, it sounds like you have a long standing history of your jaw popping when you chew, which is definitely not a symptoms of an ear problem! At the same time, your doctor
recently diagnosed you with a likely ear infection. This can be complicated, because an ear infection can cause pain that radiates down into the jaw area. Typically this pain will get better as the infection goes away.
What I would suggest, therefore, is that you go back to see your primary care doctor
to make sure the ear infection is getting better. If so, once you have finished the antibiotics, if the pain is not better it may be time to investigate what is going on in your jaw to cause additional pain.
You are correct that this may be temporo mandibular joint pain syndrome ("TMJ"), a chronic condition in which inflammation in the joint connecting the jaw to the skull causing pain with chewing and trouble opening the mouth completely. Usually, TMJ is treated collaboratively by your primary care doctor and a dentist
, as many of the triggers for TMJ have to do with bad alignment of the teeth.